@apolitical/component-library 4.3.1 → 4.3.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),ue=require("react-intl"),pn=require("lodash.clonedeep"),bh=require("lodash.set"),gc=require("react-dom"),Pt=require("markdown-to-jsx"),Hn=require("truncate"),Ve=require("@tanstack/react-query"),yh=require("@tanstack/react-query-devtools"),sa=require("posthog-js"),Os=require("react-cookie"),vc=require("lodash.isequal"),Dh=require("react-multi-email"),bc=require("lodash.get"),Ch=require("react-error-boundary");var $r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Dc={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),ue=require("react-intl"),pn=require("lodash.clonedeep"),bh=require("lodash.set"),gc=require("react-dom"),Pt=require("markdown-to-jsx"),Hn=require("truncate"),Ve=require("@tanstack/react-query"),yh=require("@tanstack/react-query-devtools"),oa=require("posthog-js"),Os=require("react-cookie"),vc=require("lodash.isequal"),Dh=require("react-multi-email"),bc=require("lodash.get"),Ch=require("react-error-boundary");var Lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Dc={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&r.push(o)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Dc);var xh=Dc.exports;const Y=wn(xh),wh=({element:e="span",showOnFocus:t=!0,children:n,className:r="",...a})=>C.createElement(e,{...a,className:Y("hidden",r,{"show-on-focus":t}),children:n}),Me=C.memo(wh),Eh=({element:e="span",children:t=null,...n})=>C.createElement(e,{...n,"aria-hidden":!0},t),$a=C.memo(Eh);var es={exports:{}},ir={};/**
5
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&r.push(o)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Dc);var xh=Dc.exports;const Y=wn(xh),wh=({element:e="span",showOnFocus:t=!0,children:n,className:r="",...a})=>C.createElement(e,{...a,className:Y("hidden",r,{"show-on-focus":t}),children:n}),Me=C.memo(wh),Eh=({element:e="span",children:t=null,...n})=>C.createElement(e,{...n,"aria-hidden":!0},t),La=C.memo(Eh);var ts={exports:{}},ir={};/**
6
6
  * @license React
7
7
  * react-jsx-runtime.production.min.js
8
8
  *
@@ -18,23 +18,23 @@
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 Ro;function _h(){return Ro||(Ro=1,process.env.NODE_ENV!=="production"&&function(){var e=C,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),g=Symbol.iterator,f="@@iterator";function D(P){if(P===null||typeof P!="object")return null;var ie=g&&P[g]||P[f];return typeof ie=="function"?ie:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(P){{for(var ie=arguments.length,le=new Array(ie>1?ie-1:0),De=1;De<ie;De++)le[De-1]=arguments[De];A("error",P,le)}}function A(P,ie,le){{var De=y.ReactDebugCurrentFrame,Se=De.getStackAddendum();Se!==""&&(ie+="%s",le=le.concat([Se]));var Re=le.map(function(Be){return String(Be)});Re.unshift("Warning: "+ie),Function.prototype.apply.call(console[P],console,Re)}}var _=!1,E=!1,F=!1,T=!1,I=!1,R;R=Symbol.for("react.module.reference");function M(P){return!!(typeof P=="string"||typeof P=="function"||P===r||P===i||I||P===a||P===u||P===c||T||P===m||_||E||F||typeof P=="object"&&P!==null&&(P.$$typeof===p||P.$$typeof===h||P.$$typeof===s||P.$$typeof===o||P.$$typeof===l||P.$$typeof===R||P.getModuleId!==void 0))}function $(P,ie,le){var De=P.displayName;if(De)return De;var Se=ie.displayName||ie.name||"";return Se!==""?le+"("+Se+")":le}function w(P){return P.displayName||"Context"}function k(P){if(P==null)return null;if(typeof P.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof P=="function")return P.displayName||P.name||null;if(typeof P=="string")return P;switch(P){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof P=="object")switch(P.$$typeof){case o:var ie=P;return w(ie)+".Consumer";case s:var le=P;return w(le._context)+".Provider";case l:return $(P,P.render,"ForwardRef");case h:var De=P.displayName||null;return De!==null?De:k(P.type)||"Memo";case p:{var Se=P,Re=Se._payload,Be=Se._init;try{return k(Be(Re))}catch{return null}}}return null}var O=Object.assign,j=0,z,H,te,J,v,W,ee;function B(){}B.__reactDisabledLog=!0;function S(){{if(j===0){z=console.log,H=console.info,te=console.warn,J=console.error,v=console.group,W=console.groupCollapsed,ee=console.groupEnd;var P={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:P,log:P,warn:P,error:P,group:P,groupCollapsed:P,groupEnd:P})}j++}}function q(){{if(j--,j===0){var P={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:O({},P,{value:z}),info:O({},P,{value:H}),warn:O({},P,{value:te}),error:O({},P,{value:J}),group:O({},P,{value:v}),groupCollapsed:O({},P,{value:W}),groupEnd:O({},P,{value:ee})})}j<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=y.ReactCurrentDispatcher,U;function ne(P,ie,le){{if(U===void 0)try{throw Error()}catch(Se){var De=Se.stack.trim().match(/\n( *(at )?)/);U=De&&De[1]||""}return`
22
- `+U+P}}var re=!1,ae;{var fe=typeof WeakMap=="function"?WeakMap:Map;ae=new fe}function X(P,ie){if(!P||re)return"";{var le=ae.get(P);if(le!==void 0)return le}var De;re=!0;var Se=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Re;Re=L.current,L.current=null,S();try{if(ie){var Be=function(){throw Error()};if(Object.defineProperty(Be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Be,[])}catch(It){De=It}Reflect.construct(P,[],Be)}else{try{Be.call()}catch(It){De=It}P.call(Be.prototype)}}else{try{throw Error()}catch(It){De=It}P()}}catch(It){if(It&&De&&typeof It.stack=="string"){for(var _e=It.stack.split(`
21
+ */var Ro;function _h(){return Ro||(Ro=1,process.env.NODE_ENV!=="production"&&function(){var e=C,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),g=Symbol.iterator,f="@@iterator";function b(O){if(O===null||typeof O!="object")return null;var ie=g&&O[g]||O[f];return typeof ie=="function"?ie:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(O){{for(var ie=arguments.length,le=new Array(ie>1?ie-1:0),De=1;De<ie;De++)le[De-1]=arguments[De];A("error",O,le)}}function A(O,ie,le){{var De=y.ReactDebugCurrentFrame,Se=De.getStackAddendum();Se!==""&&(ie+="%s",le=le.concat([Se]));var Re=le.map(function(Ae){return String(Ae)});Re.unshift("Warning: "+ie),Function.prototype.apply.call(console[O],console,Re)}}var k=!1,w=!1,F=!1,S=!1,z=!1,N;N=Symbol.for("react.module.reference");function $(O){return!!(typeof O=="string"||typeof O=="function"||O===r||O===i||z||O===a||O===u||O===c||S||O===m||k||w||F||typeof O=="object"&&O!==null&&(O.$$typeof===p||O.$$typeof===h||O.$$typeof===s||O.$$typeof===o||O.$$typeof===l||O.$$typeof===N||O.getModuleId!==void 0))}function I(O,ie,le){var De=O.displayName;if(De)return De;var Se=ie.displayName||ie.name||"";return Se!==""?le+"("+Se+")":le}function E(O){return O.displayName||"Context"}function B(O){if(O==null)return null;if(typeof O.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case o:var ie=O;return E(ie)+".Consumer";case s:var le=O;return E(le._context)+".Provider";case l:return I(O,O.render,"ForwardRef");case h:var De=O.displayName||null;return De!==null?De:B(O.type)||"Memo";case p:{var Se=O,Re=Se._payload,Ae=Se._init;try{return B(Ae(Re))}catch{return null}}}return null}var T=Object.assign,M=0,R,W,X,G,D,H,te;function _(){}_.__reactDisabledLog=!0;function j(){{if(M===0){R=console.log,W=console.info,X=console.warn,G=console.error,D=console.group,H=console.groupCollapsed,te=console.groupEnd;var O={configurable:!0,enumerable:!0,value:_,writable:!0};Object.defineProperties(console,{info:O,log:O,warn:O,error:O,group:O,groupCollapsed:O,groupEnd:O})}M++}}function q(){{if(M--,M===0){var O={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},O,{value:R}),info:T({},O,{value:W}),warn:T({},O,{value:X}),error:T({},O,{value:G}),group:T({},O,{value:D}),groupCollapsed:T({},O,{value:H}),groupEnd:T({},O,{value:te})})}M<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=y.ReactCurrentDispatcher,U;function ne(O,ie,le){{if(U===void 0)try{throw Error()}catch(Se){var De=Se.stack.trim().match(/\n( *(at )?)/);U=De&&De[1]||""}return`
22
+ `+U+O}}var re=!1,ae;{var fe=typeof WeakMap=="function"?WeakMap:Map;ae=new fe}function ee(O,ie){if(!O||re)return"";{var le=ae.get(O);if(le!==void 0)return le}var De;re=!0;var Se=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Re;Re=L.current,L.current=null,j();try{if(ie){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(It){De=It}Reflect.construct(O,[],Ae)}else{try{Ae.call()}catch(It){De=It}O.call(Ae.prototype)}}else{try{throw Error()}catch(It){De=It}O()}}catch(It){if(It&&De&&typeof It.stack=="string"){for(var Be=It.stack.split(`
23
23
  `),rt=De.stack.split(`
24
- `),Ue=_e.length-1,Ze=rt.length-1;Ue>=1&&Ze>=0&&_e[Ue]!==rt[Ze];)Ze--;for(;Ue>=1&&Ze>=0;Ue--,Ze--)if(_e[Ue]!==rt[Ze]){if(Ue!==1||Ze!==1)do if(Ue--,Ze--,Ze<0||_e[Ue]!==rt[Ze]){var bt=`
25
- `+_e[Ue].replace(" at new "," at ");return P.displayName&&bt.includes("<anonymous>")&&(bt=bt.replace("<anonymous>",P.displayName)),typeof P=="function"&&ae.set(P,bt),bt}while(Ue>=1&&Ze>=0);break}}}finally{re=!1,L.current=Re,q(),Error.prepareStackTrace=Se}var Fn=P?P.displayName||P.name:"",Po=Fn?ne(Fn):"";return typeof P=="function"&&ae.set(P,Po),Po}function be(P,ie,le){return X(P,!1)}function he(P){var ie=P.prototype;return!!(ie&&ie.isReactComponent)}function xe(P,ie,le){if(P==null)return"";if(typeof P=="function")return X(P,he(P));if(typeof P=="string")return ne(P);switch(P){case u:return ne("Suspense");case c:return ne("SuspenseList")}if(typeof P=="object")switch(P.$$typeof){case l:return be(P.render);case h:return xe(P.type,ie,le);case p:{var De=P,Se=De._payload,Re=De._init;try{return xe(Re(Se),ie,le)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,Fe={},Ke=y.ReactDebugCurrentFrame;function We(P){if(P){var ie=P._owner,le=xe(P.type,P._source,ie?ie.type:null);Ke.setExtraStackFrame(le)}else Ke.setExtraStackFrame(null)}function He(P,ie,le,De,Se){{var Re=Function.call.bind(Ae);for(var Be in P)if(Re(P,Be)){var _e=void 0;try{if(typeof P[Be]!="function"){var rt=Error((De||"React class")+": "+le+" type `"+Be+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof P[Be]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw rt.name="Invariant Violation",rt}_e=P[Be](ie,Be,De,le,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ue){_e=Ue}_e&&!(_e instanceof Error)&&(We(Se),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",De||"React class",le,Be,typeof _e),We(null)),_e instanceof Error&&!(_e.message in Fe)&&(Fe[_e.message]=!0,We(Se),x("Failed %s type: %s",le,_e.message),We(null))}}}var Qe=Array.isArray;function me(P){return Qe(P)}function Te(P){{var ie=typeof Symbol=="function"&&Symbol.toStringTag,le=ie&&P[Symbol.toStringTag]||P.constructor.name||"Object";return le}}function $e(P){try{return K(P),!1}catch{return!0}}function K(P){return""+P}function se(P){if($e(P))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Te(P)),K(P)}var pe=y.ReactCurrentOwner,ge={key:!0,ref:!0,__self:!0,__source:!0},we,Ye,Ge;Ge={};function mt(P){if(Ae.call(P,"ref")){var ie=Object.getOwnPropertyDescriptor(P,"ref").get;if(ie&&ie.isReactWarning)return!1}return P.ref!==void 0}function Mt(P){if(Ae.call(P,"key")){var ie=Object.getOwnPropertyDescriptor(P,"key").get;if(ie&&ie.isReactWarning)return!1}return P.key!==void 0}function Et(P,ie){if(typeof P.ref=="string"&&pe.current&&ie&&pe.current.stateNode!==ie){var le=k(pe.current.type);Ge[le]||(x('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',k(pe.current.type),P.ref),Ge[le]=!0)}}function Xe(P,ie){{var le=function(){we||(we=!0,x("%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)",ie))};le.isReactWarning=!0,Object.defineProperty(P,"key",{get:le,configurable:!0})}}function At(P,ie){{var le=function(){Ye||(Ye=!0,x("%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)",ie))};le.isReactWarning=!0,Object.defineProperty(P,"ref",{get:le,configurable:!0})}}var pt=function(P,ie,le,De,Se,Re,Be){var _e={$$typeof:t,type:P,key:ie,ref:le,props:Be,_owner:Re};return _e._store={},Object.defineProperty(_e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(_e,"_self",{configurable:!1,enumerable:!1,writable:!1,value:De}),Object.defineProperty(_e,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.freeze&&(Object.freeze(_e.props),Object.freeze(_e)),_e};function ei(P,ie,le,De,Se){{var Re,Be={},_e=null,rt=null;le!==void 0&&(se(le),_e=""+le),Mt(ie)&&(se(ie.key),_e=""+ie.key),mt(ie)&&(rt=ie.ref,Et(ie,Se));for(Re in ie)Ae.call(ie,Re)&&!ge.hasOwnProperty(Re)&&(Be[Re]=ie[Re]);if(P&&P.defaultProps){var Ue=P.defaultProps;for(Re in Ue)Be[Re]===void 0&&(Be[Re]=Ue[Re])}if(_e||rt){var Ze=typeof P=="function"?P.displayName||P.name||"Unknown":P;_e&&Xe(Be,Ze),rt&&At(Be,Ze)}return pt(P,_e,rt,Se,De,pe.current,Be)}}var ar=y.ReactCurrentOwner,Ir=y.ReactDebugCurrentFrame;function An(P){if(P){var ie=P._owner,le=xe(P.type,P._source,ie?ie.type:null);Ir.setExtraStackFrame(le)}else Ir.setExtraStackFrame(null)}var ti;ti=!1;function ni(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function Fo(){{if(ar.current){var P=k(ar.current.type);if(P)return`
24
+ `),Ue=Be.length-1,Ze=rt.length-1;Ue>=1&&Ze>=0&&Be[Ue]!==rt[Ze];)Ze--;for(;Ue>=1&&Ze>=0;Ue--,Ze--)if(Be[Ue]!==rt[Ze]){if(Ue!==1||Ze!==1)do if(Ue--,Ze--,Ze<0||Be[Ue]!==rt[Ze]){var bt=`
25
+ `+Be[Ue].replace(" at new "," at ");return O.displayName&&bt.includes("<anonymous>")&&(bt=bt.replace("<anonymous>",O.displayName)),typeof O=="function"&&ae.set(O,bt),bt}while(Ue>=1&&Ze>=0);break}}}finally{re=!1,L.current=Re,q(),Error.prepareStackTrace=Se}var Fn=O?O.displayName||O.name:"",Po=Fn?ne(Fn):"";return typeof O=="function"&&ae.set(O,Po),Po}function be(O,ie,le){return ee(O,!1)}function me(O){var ie=O.prototype;return!!(ie&&ie.isReactComponent)}function xe(O,ie,le){if(O==null)return"";if(typeof O=="function")return ee(O,me(O));if(typeof O=="string")return ne(O);switch(O){case u:return ne("Suspense");case c:return ne("SuspenseList")}if(typeof O=="object")switch(O.$$typeof){case l:return be(O.render);case h:return xe(O.type,ie,le);case p:{var De=O,Se=De._payload,Re=De._init;try{return xe(Re(Se),ie,le)}catch{}}}return""}var Fe=Object.prototype.hasOwnProperty,Te={},Ke=y.ReactDebugCurrentFrame;function We(O){if(O){var ie=O._owner,le=xe(O.type,O._source,ie?ie.type:null);Ke.setExtraStackFrame(le)}else Ke.setExtraStackFrame(null)}function He(O,ie,le,De,Se){{var Re=Function.call.bind(Fe);for(var Ae in O)if(Re(O,Ae)){var Be=void 0;try{if(typeof O[Ae]!="function"){var rt=Error((De||"React class")+": "+le+" type `"+Ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof O[Ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw rt.name="Invariant Violation",rt}Be=O[Ae](ie,Ae,De,le,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ue){Be=Ue}Be&&!(Be instanceof Error)&&(We(Se),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",De||"React class",le,Ae,typeof Be),We(null)),Be instanceof Error&&!(Be.message in Te)&&(Te[Be.message]=!0,We(Se),x("Failed %s type: %s",le,Be.message),We(null))}}}var Qe=Array.isArray;function he(O){return Qe(O)}function ke(O){{var ie=typeof Symbol=="function"&&Symbol.toStringTag,le=ie&&O[Symbol.toStringTag]||O.constructor.name||"Object";return le}}function $e(O){try{return K(O),!1}catch{return!0}}function K(O){return""+O}function se(O){if($e(O))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ke(O)),K(O)}var pe=y.ReactCurrentOwner,ge={key:!0,ref:!0,__self:!0,__source:!0},we,Ye,Ge;Ge={};function mt(O){if(Fe.call(O,"ref")){var ie=Object.getOwnPropertyDescriptor(O,"ref").get;if(ie&&ie.isReactWarning)return!1}return O.ref!==void 0}function Mt(O){if(Fe.call(O,"key")){var ie=Object.getOwnPropertyDescriptor(O,"key").get;if(ie&&ie.isReactWarning)return!1}return O.key!==void 0}function Et(O,ie){if(typeof O.ref=="string"&&pe.current&&ie&&pe.current.stateNode!==ie){var le=B(pe.current.type);Ge[le]||(x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(pe.current.type),O.ref),Ge[le]=!0)}}function Xe(O,ie){{var le=function(){we||(we=!0,x("%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)",ie))};le.isReactWarning=!0,Object.defineProperty(O,"key",{get:le,configurable:!0})}}function At(O,ie){{var le=function(){Ye||(Ye=!0,x("%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)",ie))};le.isReactWarning=!0,Object.defineProperty(O,"ref",{get:le,configurable:!0})}}var pt=function(O,ie,le,De,Se,Re,Ae){var Be={$$typeof:t,type:O,key:ie,ref:le,props:Ae,_owner:Re};return Be._store={},Object.defineProperty(Be._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Be,"_self",{configurable:!1,enumerable:!1,writable:!1,value:De}),Object.defineProperty(Be,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.freeze&&(Object.freeze(Be.props),Object.freeze(Be)),Be};function ti(O,ie,le,De,Se){{var Re,Ae={},Be=null,rt=null;le!==void 0&&(se(le),Be=""+le),Mt(ie)&&(se(ie.key),Be=""+ie.key),mt(ie)&&(rt=ie.ref,Et(ie,Se));for(Re in ie)Fe.call(ie,Re)&&!ge.hasOwnProperty(Re)&&(Ae[Re]=ie[Re]);if(O&&O.defaultProps){var Ue=O.defaultProps;for(Re in Ue)Ae[Re]===void 0&&(Ae[Re]=Ue[Re])}if(Be||rt){var Ze=typeof O=="function"?O.displayName||O.name||"Unknown":O;Be&&Xe(Ae,Ze),rt&&At(Ae,Ze)}return pt(O,Be,rt,Se,De,pe.current,Ae)}}var ar=y.ReactCurrentOwner,$r=y.ReactDebugCurrentFrame;function An(O){if(O){var ie=O._owner,le=xe(O.type,O._source,ie?ie.type:null);$r.setExtraStackFrame(le)}else $r.setExtraStackFrame(null)}var ni;ni=!1;function ri(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Fo(){{if(ar.current){var O=B(ar.current.type);if(O)return`
26
26
 
27
- Check the render method of \``+P+"`."}return""}}function ch(P){{if(P!==void 0){var ie=P.fileName.replace(/^.*[\\\/]/,""),le=P.lineNumber;return`
27
+ Check the render method of \``+O+"`."}return""}}function ch(O){{if(O!==void 0){var ie=O.fileName.replace(/^.*[\\\/]/,""),le=O.lineNumber;return`
28
28
 
29
- Check your code at `+ie+":"+le+"."}return""}}var To={};function dh(P){{var ie=Fo();if(!ie){var le=typeof P=="string"?P:P.displayName||P.name;le&&(ie=`
29
+ Check your code at `+ie+":"+le+"."}return""}}var To={};function dh(O){{var ie=Fo();if(!ie){var le=typeof O=="string"?O:O.displayName||O.name;le&&(ie=`
30
30
 
31
- Check the top-level render call using <`+le+">.")}return ie}}function So(P,ie){{if(!P._store||P._store.validated||P.key!=null)return;P._store.validated=!0;var le=dh(ie);if(To[le])return;To[le]=!0;var De="";P&&P._owner&&P._owner!==ar.current&&(De=" It was passed a child from "+k(P._owner.type)+"."),An(P),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',le,De),An(null)}}function jo(P,ie){{if(typeof P!="object")return;if(me(P))for(var le=0;le<P.length;le++){var De=P[le];ni(De)&&So(De,ie)}else if(ni(P))P._store&&(P._store.validated=!0);else if(P){var Se=D(P);if(typeof Se=="function"&&Se!==P.entries)for(var Re=Se.call(P),Be;!(Be=Re.next()).done;)ni(Be.value)&&So(Be.value,ie)}}}function fh(P){{var ie=P.type;if(ie==null||typeof ie=="string")return;var le;if(typeof ie=="function")le=ie.propTypes;else if(typeof ie=="object"&&(ie.$$typeof===l||ie.$$typeof===h))le=ie.propTypes;else return;if(le){var De=k(ie);He(le,P.props,"prop",De,P)}else if(ie.PropTypes!==void 0&&!ti){ti=!0;var Se=k(ie);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Se||"Unknown")}typeof ie.getDefaultProps=="function"&&!ie.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function hh(P){{for(var ie=Object.keys(P.props),le=0;le<ie.length;le++){var De=ie[le];if(De!=="children"&&De!=="key"){An(P),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",De),An(null);break}}P.ref!==null&&(An(P),x("Invalid attribute `ref` supplied to `React.Fragment`."),An(null))}}function Oo(P,ie,le,De,Se,Re){{var Be=M(P);if(!Be){var _e="";(P===void 0||typeof P=="object"&&P!==null&&Object.keys(P).length===0)&&(_e+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var rt=ch(Se);rt?_e+=rt:_e+=Fo();var Ue;P===null?Ue="null":me(P)?Ue="array":P!==void 0&&P.$$typeof===t?(Ue="<"+(k(P.type)||"Unknown")+" />",_e=" Did you accidentally export a JSX literal instead of a component?"):Ue=typeof P,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ue,_e)}var Ze=ei(P,ie,le,Se,Re);if(Ze==null)return Ze;if(Be){var bt=ie.children;if(bt!==void 0)if(De)if(me(bt)){for(var Fn=0;Fn<bt.length;Fn++)jo(bt[Fn],P);Object.freeze&&Object.freeze(bt)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else jo(bt,P)}return P===r?hh(Ze):fh(Ze),Ze}}function mh(P,ie,le){return Oo(P,ie,le,!0)}function ph(P,ie,le){return Oo(P,ie,le,!1)}var gh=ph,vh=mh;sr.Fragment=r,sr.jsx=gh,sr.jsxs=vh}()),sr}process.env.NODE_ENV==="production"?es.exports=kh():es.exports=_h();var d=es.exports;const Cc=()=>{const[e,t]=C.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return C.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},Un=(e,t)=>{const n=C.useRef(!1);C.useEffect(()=>{n.current?e():n.current=!0},t)};function xc(e,t,n){var r=this,a=C.useRef(null),i=C.useRef(0),s=C.useRef(null),o=C.useRef([]),l=C.useRef(),u=C.useRef(),c=C.useRef(e),h=C.useRef(!0);c.current=e;var p=typeof window<"u",m=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,f=!("trailing"in n)||!!n.trailing,D="maxWait"in n,y="debounceOnServer"in n&&!!n.debounceOnServer,x=D?Math.max(+n.maxWait||0,t):null;C.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var A=C.useMemo(function(){var _=function(M){var $=o.current,w=l.current;return o.current=l.current=null,i.current=M,u.current=c.current.apply(w,$)},E=function(M,$){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(M):setTimeout(M,$)},F=function(M){if(!h.current)return!1;var $=M-a.current;return!a.current||$>=t||$<0||D&&M-i.current>=x},T=function(M){return s.current=null,f&&o.current?_(M):(o.current=l.current=null,u.current)},I=function M(){var $=Date.now();if(F($))return T($);if(h.current){var w=t-($-a.current),k=D?Math.min(w,x-($-i.current)):w;E(M,k)}},R=function(){if(p||y){var M=Date.now(),$=F(M);if(o.current=[].slice.call(arguments),l.current=r,a.current=M,$){if(!s.current&&h.current)return i.current=a.current,E(I,t),g?_(a.current):u.current;if(D)return E(I,t),_(a.current)}return s.current||E(I,t),u.current}};return R.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,o.current=a.current=l.current=s.current=null},R.isPending=function(){return!!s.current},R.flush=function(){return s.current?T(Date.now()):u.current},R},[g,D,t,x,f,m,p,y]);return A}function wc(e,t,n){var r=n===void 0?{}:n,a=r.leading,i=r.trailing;return xc(e,t,{maxWait:t,leading:a===void 0||a,trailing:i===void 0||i})}let ri;const Jn=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,a]=C.useState(0)||[!1,()=>{}],i=n==="window"?[]:[n];C.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(ri),u.flush(),window.removeEventListener("resize",u),window.removeEventListener("hashchange",u),window.removeEventListener("hiddenSectionVisible",l)}),i);const s=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},o=()=>{a(s())},l=({detail:c})=>{const{id:h}=c;n==="window"||!n.closest(`#${h}`)||s()===r||o()},u=wc(()=>{s()!==r&&(t&&(clearTimeout(ri),document.body.classList.add("is-resizing"),ri=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},Ec=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[a,i]=C.useState({current:0,past:0})||[!1,()=>{}],[s,o]=C.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];C.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,h=a.current,p=c-h,m=p>0?"down":"up";if(i({current:c,past:h}),m==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||p>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(p)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=wc(()=>{l()},250);return a},Ps=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=C.useRef(!1);Un(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Ns=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=C.useState(!1);return{showTooltip:t,tooltipProps:{onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),tabIndex:0}}};const Mo={},En=C.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:a,className:i="",functions:s={},callbacks:o={},...l},u)=>{const c=ue.useIntl(),h=C.useRef(null),p=u||h,[m,g]=C.useState(n?"open":"hidden"),{extraPadding:f=!0,hasPointer:D=!1,hasForm:y=!1}=t,{onOpen:x=()=>{},onClose:A=()=>{}}=o;e||(e=Date.now().toString());const _=Mo[e];C.useEffect(()=>{const I=p==null?void 0:p.current;if(I)return I.addEventListener("transitionend",E),I.addEventListener("keydown",F),()=>{I.removeEventListener("transitionend",E),I.removeEventListener("keydown",F)}},[]);const E=({propertyName:I})=>{I==="opacity"&&(_!==!1&&clearTimeout(_),g(R=>(R==="open"?x():R==="closed"&&A(),R==="opening"?"open":R==="closing"?"closed":R==="closed"?"hidden":R)))},F=I=>{I.key==="Escape"&&(I.stopPropagation(),I.preventDefault(),g("closing"))};Un(()=>{_!==!1&&clearTimeout(_);let I="open";n?g("opening"):(g("closing"),I="hidden"),Mo[e||""]=setTimeout(()=>{g(I)},300)},[n]);const T={...l};return s&&s.onBlur&&(T.onBlur=s.onBlur),d.jsx("aside",{ref:p,className:Y("tooltip text-medium",m,i,{loading:r,"extra-padding":f,"has-pointer":D,bottom:D==="bottom","has-form":y}),...T,children:d.jsx("div",{className:"content",hidden:m==="hidden",children:r?d.jsx("p",{children:c.formatMessage({id:"tooltip_loading"})}):typeof a=="string"?d.jsx("p",{children:a}):a})})}),Or=(e,t)=>{Array.isArray(t)||(t=[t]);const n=pn(e);return t.forEach(({type:r,value:a})=>{bh(n,r,a)}),n},kc=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},_c=(e,t,n)=>{let r=n.mobile;for(const a in t){const i=parseInt(String(t[a]));if(e>=i)r=n[i];else if(e<i)break}return r},Bc=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ac=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),Fc=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),Bh=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),Wt="https://storage.googleapis.com/apolitical-assets/",Nn={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},hr={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},ts="SU:",Tc="Invalid token error: Logging user out...",Ah="200,000+",Fh="160+",ns=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,Sc=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$");function jc(e){return e?{"--icon":`url(${Wt}icons/${e}.svg)`}:{}}const fn={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},Oc=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),Rs=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),rs=e=>{let t;const n=va(),r=va(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const a=t/fn.milliseconds.inHour,i=Math.floor(t/fn.milliseconds.inDay);if(i<1)return a<1?{path:"now"}:{path:"hours",number:Math.floor(a)};if(i<7)return{path:"days",number:i};const s=Math.floor(i/7);return s<=fn.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(i/fn.year.days)}},va=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Th=(e,t,n)=>{let r;const a=va(),i=va(new Date(e));try{r=a.getTime()-i.getTime()}catch{return!1}switch(n){case"seconds":return r/fn.milliseconds.inSecond<=t;case"minutes":return r/fn.milliseconds.inMinute<=t;case"hours":return r/fn.milliseconds.inHour<=t}return!1},Sh=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},jh=e=>new Promise(t=>setTimeout(t,e)),Oh=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},Xn={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_communityPage:"Community",card_label_event:"Event",card_label_learningHub:"Programme",card_label_listPage:"List",card_label_microcourse:"Course",card_label_qaQuestion:"Q&A",card_label_solutionArticle:"Article",card_bootcamp:"Email boot camp",card_ended:"Ended",card_new:"New",card_registered:"Registered",card_partner:"{partner} and {number} more",card_contributors_event:"Multiple speakers",card_contributors_solutionArticle:"Multiple authors",card_answers:"{number, plural, =0 {0 answers} one {# answer} other {# answers}}",card_time_ago:"{time} ago",card_time_read:"{time} min read",card_watch:"Watch recording",card_member_type_owner:"Admin",card_member_type_member:"Member",card_member_count:"{count} members",card_cta_people:"View profile",card_cta_communityPage:"Join now",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_communityPage_loading:"Joining...",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_communityPage_done:"Joined",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"Previous",carousel_pagination_next:"Next",carousel_pagination_page:"Page {number} of {total}",carousel_pagination_aria_live:"{direction} {count} cards available",activitySection_notFoundError:"Post not found",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",joinCommunityButton_closed_tooltip:"Please contact the admin of this closed community if you would like to join it.",joinCommunityButton_aria_live:"You are {action} this community",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",courseStructure_section:"{number, plural, =0 {Start here} other {Section #}}",courseStructure_section_end:"End here",courseStructure_time_left:"left",courseStructure_time_completed:"Completed",courseProgression_done:"<percent>{number}%</percent> done",courseProgression_timeLeft:"left","lessonType_analyse-data":"Analyse data","lessonType_analyse-scenarios":"Analyse scenarios","lessonType_attend-webinar":"Attend webinar","lessonType_brainstorm-ideas":"Brainstorm ideas","lessonType_discuss-with-peers":"Discuss with peers","lessonType_discuss-with-team":"Discuss with team","lessonType_do-activity":"Do activity","lessonType_do-assessment":"Do assessment","lessonType_explore-casebook":"Explore casebook","lessonType_fill-out-workbook":"Fill out workbook","lessonType_fill-out-worksheet":"Fill out worksheet","lessonType_investigate-interview":"Investigate interview","lessonType_listen-to-audio":"Listen to audio","lessonType_listen-to-audiocast":"Listen to audiocast","lessonType_listen-to-podcast":"Listen to podcast","lessonType_read-article":"Read article","lessonType_read-article-by-expert":"Read article by expert","lessonType_read-article-by-public-servant":"Read article by public servant","lessonType_read-conclusion":"Read conclusion","lessonType_read-infographic":"Read infographic","lessonType_read-introduction":"Read introduction","lessonType_read-resource":"Read resource","lessonType_reflect-on-content":"Reflect on content","lessonType_share-experiences":"Share experiences","lessonType_take-quiz":"Take quiz","lessonType_use-toolkit":"Use toolkit","lessonType_watch-video":"Watch video","lessonType_watch-webinar":"Watch webinar",markCompleteButton:"Mark as complete",markCompleteButton_completed:"Lesson complete",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
31
+ Check the top-level render call using <`+le+">.")}return ie}}function So(O,ie){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var le=dh(ie);if(To[le])return;To[le]=!0;var De="";O&&O._owner&&O._owner!==ar.current&&(De=" It was passed a child from "+B(O._owner.type)+"."),An(O),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',le,De),An(null)}}function jo(O,ie){{if(typeof O!="object")return;if(he(O))for(var le=0;le<O.length;le++){var De=O[le];ri(De)&&So(De,ie)}else if(ri(O))O._store&&(O._store.validated=!0);else if(O){var Se=b(O);if(typeof Se=="function"&&Se!==O.entries)for(var Re=Se.call(O),Ae;!(Ae=Re.next()).done;)ri(Ae.value)&&So(Ae.value,ie)}}}function fh(O){{var ie=O.type;if(ie==null||typeof ie=="string")return;var le;if(typeof ie=="function")le=ie.propTypes;else if(typeof ie=="object"&&(ie.$$typeof===l||ie.$$typeof===h))le=ie.propTypes;else return;if(le){var De=B(ie);He(le,O.props,"prop",De,O)}else if(ie.PropTypes!==void 0&&!ni){ni=!0;var Se=B(ie);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Se||"Unknown")}typeof ie.getDefaultProps=="function"&&!ie.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function hh(O){{for(var ie=Object.keys(O.props),le=0;le<ie.length;le++){var De=ie[le];if(De!=="children"&&De!=="key"){An(O),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",De),An(null);break}}O.ref!==null&&(An(O),x("Invalid attribute `ref` supplied to `React.Fragment`."),An(null))}}function Oo(O,ie,le,De,Se,Re){{var Ae=$(O);if(!Ae){var Be="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(Be+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var rt=ch(Se);rt?Be+=rt:Be+=Fo();var Ue;O===null?Ue="null":he(O)?Ue="array":O!==void 0&&O.$$typeof===t?(Ue="<"+(B(O.type)||"Unknown")+" />",Be=" Did you accidentally export a JSX literal instead of a component?"):Ue=typeof O,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ue,Be)}var Ze=ti(O,ie,le,Se,Re);if(Ze==null)return Ze;if(Ae){var bt=ie.children;if(bt!==void 0)if(De)if(he(bt)){for(var Fn=0;Fn<bt.length;Fn++)jo(bt[Fn],O);Object.freeze&&Object.freeze(bt)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else jo(bt,O)}return O===r?hh(Ze):fh(Ze),Ze}}function mh(O,ie,le){return Oo(O,ie,le,!0)}function ph(O,ie,le){return Oo(O,ie,le,!1)}var gh=ph,vh=mh;sr.Fragment=r,sr.jsx=gh,sr.jsxs=vh}()),sr}process.env.NODE_ENV==="production"?ts.exports=kh():ts.exports=_h();var d=ts.exports;const Cc=()=>{const[e,t]=C.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return C.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},Un=(e,t)=>{const n=C.useRef(!1);C.useEffect(()=>{n.current?e():n.current=!0},t)};function xc(e,t,n){var r=this,a=C.useRef(null),i=C.useRef(0),s=C.useRef(null),o=C.useRef([]),l=C.useRef(),u=C.useRef(),c=C.useRef(e),h=C.useRef(!0);c.current=e;var p=typeof window<"u",m=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,f=!("trailing"in n)||!!n.trailing,b="maxWait"in n,y="debounceOnServer"in n&&!!n.debounceOnServer,x=b?Math.max(+n.maxWait||0,t):null;C.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var A=C.useMemo(function(){var k=function($){var I=o.current,E=l.current;return o.current=l.current=null,i.current=$,u.current=c.current.apply(E,I)},w=function($,I){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame($):setTimeout($,I)},F=function($){if(!h.current)return!1;var I=$-a.current;return!a.current||I>=t||I<0||b&&$-i.current>=x},S=function($){return s.current=null,f&&o.current?k($):(o.current=l.current=null,u.current)},z=function $(){var I=Date.now();if(F(I))return S(I);if(h.current){var E=t-(I-a.current),B=b?Math.min(E,x-(I-i.current)):E;w($,B)}},N=function(){if(p||y){var $=Date.now(),I=F($);if(o.current=[].slice.call(arguments),l.current=r,a.current=$,I){if(!s.current&&h.current)return i.current=a.current,w(z,t),g?k(a.current):u.current;if(b)return w(z,t),k(a.current)}return s.current||w(z,t),u.current}};return N.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,o.current=a.current=l.current=s.current=null},N.isPending=function(){return!!s.current},N.flush=function(){return s.current?S(Date.now()):u.current},N},[g,b,t,x,f,m,p,y]);return A}function wc(e,t,n){var r=n===void 0?{}:n,a=r.leading,i=r.trailing;return xc(e,t,{maxWait:t,leading:a===void 0||a,trailing:i===void 0||i})}let ai;const Jn=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,a]=C.useState(0)||[!1,()=>{}],i=n==="window"?[]:[n];C.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(ai),u.flush(),window.removeEventListener("resize",u),window.removeEventListener("hashchange",u),window.removeEventListener("hiddenSectionVisible",l)}),i);const s=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},o=()=>{a(s())},l=({detail:c})=>{const{id:h}=c;n==="window"||!n.closest(`#${h}`)||s()===r||o()},u=wc(()=>{s()!==r&&(t&&(clearTimeout(ai),document.body.classList.add("is-resizing"),ai=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},Ec=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[a,i]=C.useState({current:0,past:0})||[!1,()=>{}],[s,o]=C.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];C.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,h=a.current,p=c-h,m=p>0?"down":"up";if(i({current:c,past:h}),m==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||p>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(p)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=wc(()=>{l()},250);return a},Ps=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=C.useRef(!1);Un(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Ns=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=C.useState(!1);return{showTooltip:t,tooltipProps:{onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),tabIndex:0}}};const Mo={},En=C.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:a,className:i="",functions:s={},callbacks:o={},...l},u)=>{const c=ue.useIntl(),h=C.useRef(null),p=u||h,[m,g]=C.useState(n?"open":"hidden"),{extraPadding:f=!0,hasPointer:b=!1,hasForm:y=!1}=t,{onOpen:x=()=>{},onClose:A=()=>{}}=o;e||(e=Date.now().toString());const k=Mo[e];C.useEffect(()=>{const z=p==null?void 0:p.current;if(z)return z.addEventListener("transitionend",w),z.addEventListener("keydown",F),()=>{z.removeEventListener("transitionend",w),z.removeEventListener("keydown",F)}},[]);const w=({propertyName:z})=>{z==="opacity"&&(k!==!1&&clearTimeout(k),g(N=>(N==="open"?x():N==="closed"&&A(),N==="opening"?"open":N==="closing"?"closed":N==="closed"?"hidden":N)))},F=z=>{z.key==="Escape"&&(z.stopPropagation(),z.preventDefault(),g("closing"))};Un(()=>{k!==!1&&clearTimeout(k);let z="open";n?g("opening"):(g("closing"),z="hidden"),Mo[e||""]=setTimeout(()=>{g(z)},300)},[n]);const S={...l};return s&&s.onBlur&&(S.onBlur=s.onBlur),d.jsx("aside",{ref:p,className:Y("tooltip text-medium",m,i,{loading:r,"extra-padding":f,"has-pointer":b,bottom:b==="bottom","has-form":y}),...S,children:d.jsx("div",{className:"content",hidden:m==="hidden",children:r?d.jsx("p",{children:c.formatMessage({id:"tooltip_loading"})}):typeof a=="string"?d.jsx("p",{children:a}):a})})}),Pr=(e,t)=>{Array.isArray(t)||(t=[t]);const n=pn(e);return t.forEach(({type:r,value:a})=>{bh(n,r,a)}),n},kc=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},_c=(e,t,n)=>{let r=n.mobile;for(const a in t){const i=parseInt(String(t[a]));if(e>=i)r=n[i];else if(e<i)break}return r},Bc=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ac=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),Fc=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),Bh=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),Wt="https://storage.googleapis.com/apolitical-assets/",Nn={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},hr={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},ns="SU:",Tc="Invalid token error: Logging user out...",Ah="200,000+",Fh="160+",Er=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,Sc=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$");function jc(e){return e?{"--icon":`url(${Wt}icons/${e}.svg)`}:{}}const fn={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},Oc=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),Rs=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),rs=e=>{let t;const n=ba(),r=ba(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const a=t/fn.milliseconds.inHour,i=Math.floor(t/fn.milliseconds.inDay);if(i<1)return a<1?{path:"now"}:{path:"hours",number:Math.floor(a)};if(i<7)return{path:"days",number:i};const s=Math.floor(i/7);return s<=fn.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(i/fn.year.days)}},ba=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Th=(e,t,n)=>{let r;const a=ba(),i=ba(new Date(e));try{r=a.getTime()-i.getTime()}catch{return!1}switch(n){case"seconds":return r/fn.milliseconds.inSecond<=t;case"minutes":return r/fn.milliseconds.inMinute<=t;case"hours":return r/fn.milliseconds.inHour<=t}return!1},Sh=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},jh=e=>new Promise(t=>setTimeout(t,e)),Oh=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},Xn={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_communityPage:"Community",card_label_event:"Event",card_label_learningHub:"Programme",card_label_listPage:"List",card_label_microcourse:"Course",card_label_qaQuestion:"Q&A",card_label_solutionArticle:"Article",card_bootcamp:"Email boot camp",card_ended:"Ended",card_new:"New",card_registered:"Registered",card_partner:"{partner} and {number} more",card_contributors_event:"Multiple speakers",card_contributors_solutionArticle:"Multiple authors",card_answers:"{number, plural, =0 {0 answers} one {# answer} other {# answers}}",card_time_ago:"{time} ago",card_time_read:"{time} min read",card_watch:"Watch recording",card_member_type_owner:"Admin",card_member_type_member:"Member",card_member_count:"{count} members",card_cta_people:"View profile",card_cta_communityPage:"Join now",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_communityPage_loading:"Joining...",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_communityPage_done:"Joined",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"Previous",carousel_pagination_next:"Next",carousel_pagination_page:"Page {number} of {total}",carousel_pagination_aria_live:"{direction} {count} cards available",activitySection_notFoundError:"Post not found",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",joinCommunityButton_closed_tooltip:"Please contact the admin of this closed community if you would like to join it.",joinCommunityButton_aria_live:"You are {action} this community",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",courseStructure_section:"{number, plural, =0 {Start here} other {Section #}}",courseStructure_section_end:"End here",courseStructure_time_left:"left",courseStructure_time_completed:"Completed",courseProgression_done:"<percent>{number}%</percent> done",courseProgression_timeLeft:"left","lessonType_analyse-data":"Analyse data","lessonType_analyse-scenarios":"Analyse scenarios","lessonType_attend-webinar":"Attend webinar","lessonType_brainstorm-ideas":"Brainstorm ideas","lessonType_discuss-with-peers":"Discuss with peers","lessonType_discuss-with-team":"Discuss with team","lessonType_do-activity":"Do activity","lessonType_do-assessment":"Do assessment","lessonType_explore-casebook":"Explore casebook","lessonType_fill-out-workbook":"Fill out workbook","lessonType_fill-out-worksheet":"Fill out worksheet","lessonType_investigate-interview":"Investigate interview","lessonType_listen-to-audio":"Listen to audio","lessonType_listen-to-audiocast":"Listen to audiocast","lessonType_listen-to-podcast":"Listen to podcast","lessonType_read-article":"Read article","lessonType_read-article-by-expert":"Read article by expert","lessonType_read-article-by-public-servant":"Read article by public servant","lessonType_read-conclusion":"Read conclusion","lessonType_read-infographic":"Read infographic","lessonType_read-introduction":"Read introduction","lessonType_read-resource":"Read resource","lessonType_reflect-on-content":"Reflect on content","lessonType_share-experiences":"Share experiences","lessonType_take-quiz":"Take quiz","lessonType_use-toolkit":"Use toolkit","lessonType_watch-video":"Watch video","lessonType_watch-webinar":"Watch webinar",markCompleteButton:"Mark as complete",markCompleteButton_completed:"Lesson complete",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
32
32
 
33
33
  Please explain why you're reporting this post. Reasons could include: inappropriate language, harassment, spam, hate speech, false information, among others. Include as much detail as you feel comfortable.
34
34
 
35
- Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"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:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_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 emails 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",profile_image_change_uploading_text:"Uploading image...",profile_image_change_cta_with_picture:"Change photo",profile_image_change_cta_without_picture:"+ Add profile photo",profile_image_change_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",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_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",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 emails below.",inviteModal_cta:"Send",overlay_close:"Close",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",edit_section_placeholder_description:"Add some details",edit_section_placeholder_cta:"add",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"},Ph={...Xn,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>"},Nh={...Xn,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"},Rh={...Xn,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>"},Mh=Object.freeze(Object.defineProperty({__proto__:null,en:Xn,es:Ph,fr:Nh,pt:Rh},Symbol.toStringTag,{value:"Module"})),La=(e,t=Xn)=>e in t,kt=(e,t,n,r,a={})=>{let i="";return La(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},Ih=(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},oa=(e,t)=>C.Children.map(e,n=>Object.is(n,null)?n:C.cloneElement(n,{...t})),Pc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},$h=(e,t,n)=>!t.id||!t.name?"":n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Nc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(ns);if(!a)return e;for(const s of a){const o=s.replace(ns,(c,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"";else{const c=l;if(c.startsWith(ts))try{const h=c.replace(ts,"");u.id=h,await r({id:h}).then(p=>{const{name:m}=p;u.name=m||""})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?$h(e,u,t):s)}return e},Rc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Lh=(e="")=>e.replace(/\s+/g,"").length>0,as=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}};const ke=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:c=!1,children:h=!1,...p})=>{const g=Jn(typeof t=="object"),{showTooltip:f,tooltipProps:D}=Ns(!!u);if(typeof t=="object"&&typeof g=="number"){const _=Object.assign({},t),E=kc(Object.keys(_));t=_c(g,E,_)}!l&&u&&(u="");const y=[];typeof t=="string"&&y.push(t),r&&(y.push("icon"),typeof r=="object"?(y.push(r.icon),r.position?y.push(r.position):y.push("left"),r.hover&&y.push(`hover_${r.hover}`),r.animate&&(y.push("animate"),typeof r.animate=="string"&&y.push(r.animate))):(y.push(r),!r.includes("right")&&!r.includes("left")&&y.push("left"))),n.muted&&y.push("muted"),n.fullWidth&&y.push("full-width");const x={...p,className:Y(e,o,y,{"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",x.href=a);const A=C.createElement(i,x,h||(c?d.jsx(Me,{showOnFocus:!1,children:c}):null));return l&&u?d.jsxs("span",{className:"button-container",...D,children:[d.jsx(En,{isOpen:f,children:u}),A]}):A},kn=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?d.jsx(ke,{...s},o):d.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:d.jsx(ke,{...s})},o)});return C.createElement(a,{className:Y("button-wrapper",n),...r,children:i})};const tn=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return d.jsx("hr",{className:Y(e,{"has-max-width":t}),style:n})},Io={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},zh=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?Io[e]:Io.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},qh=({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},ai=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${qh({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const er=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:c,fetchPriority:h}=e,{range:p,sizes:m}=zh(e),g=ai({format:"avif",query:s,range:p,url:o}),f=ai({format:"webp",query:s,range:p,url:o}),D=ai({format:"",query:s,range:p,url:o});return i&&i.includes("svg")?d.jsx("picture",{className:t,children:d.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):d.jsxs("picture",{className:t,children:[i!=="image/gif"&&d.jsx("source",{type:"image/avif",srcSet:g,sizes:m,"data-testid":"source"}),d.jsx("source",{type:"image/webp",srcSet:f,sizes:m,"data-testid":"source"}),d.jsx("img",{srcSet:D,sizes:m,src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const Wh=({image:e,className:t="",testId:n})=>d.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&d.jsx(er,{image:{...e},className:"image"})}),_n=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),d.jsx("a",{href:e,className:Y("gtm-trackable",r),...l,children:t})}return n?C.createElement(n,{children:t,className:r,...o}):d.jsx(d.Fragment,{children:t})};const Mc=C.forwardRef(({className:e="",children:t},n)=>{const r=C.useRef(null),a=n||r;return d.jsx("aside",{ref:a,className:Y("popover",e),"aria-live":"polite",children:t})}),Ms=({children:e})=>typeof document=="object"?gc.createPortal(e,document.body):null;const Hh=({currentStep:e=1,steps:t=1})=>d.jsxs(d.Fragment,{children:[d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),d.jsx("div",{className:"progress-tracker",children:d.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return d.jsxs("div",{className:"dot-wrapper",children:[d.jsx("div",{className:Y("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),d.jsx("div",{className:Y("line",{active:a<e})})]},r)})})})]});const Uh=({elementId:e,offset:t=20})=>{const n=ue.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return d.jsx(ke,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const Vh=({items:e,className:t="",...n})=>d.jsx("ul",{className:Y("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>d.jsx("li",{className:"bucket text-medium",children:d.jsxs("a",{href:i,...s,children:[d.jsx("p",{className:"title",children:r}),d.jsx("p",{children:a})]})},o))}),$o=300,Lo="ease-in-out";class Kh{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:$o,easing:Lo}),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:$o,easing:Lo}),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 za=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=ue.useIntl(),i=C.useRef(null);return C.useEffect(()=>{let s;return r&&(s=new Kh(i.current)),()=>{r&&s&&s.cleanUp()}},[]),d.jsxs("details",{ref:i,className:Y("collapsible-section",t,{"should-animate":r}),children:[d.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),d.jsx("div",{className:"content",children:n})]})},zo={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Zh=e=>{let t=e;return Object.keys(zo).includes(e)&&(t=zo[e]),`url(${Wt}icons/${t}.svg)`};const qo={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},Ic=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=ue.useIntl(),i=t?{"--custom-icon":Zh(t)}:{},s=La(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:d.jsx("small",{className:Y("content-type-label text-small",e in qo?qo[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Nt=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Wt}icons/${t}.svg)`}:{};return d.jsx("div",{className:Y("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const an=({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=Jn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=kc(Object.keys(h));a=_c(s,p,h)}const{breakpoints:o,text:l="",component:u,...c}=n;return d.jsx(Nt,{variant:"subtle",className:Y("empty-state-box",e,r),children:d.jsxs(d.Fragment,{children:[t&&typeof t=="string"?d.jsx(Pt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||d.jsx(ke,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const is=({children:e,...t})=>d.jsx("p",{...t,children:e}),$c={q:is,blockquote:is};for(let e=1;e<=6;e++)$c[`h${e}`]={component:is,props:{className:"title"}};const Lc=({type:e="default",className:t="",heading:n=!1,children:r})=>d.jsxs("div",{className:Y("helper-text-box text-small",e,t),children:[n&&d.jsx("p",{className:"title",children:n}),typeof r=="string"?d.jsx(Pt,{options:{wrapper:C.Fragment,forceBlock:!0,overrides:$c},children:r}):d.jsx("p",{children:r})]});const zc=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,children:s})=>{const o=ue.useIntl(),l=C.useRef(null);e||(e=Date.now().toString());const[u,c]=C.useState(""),[h,p]=C.useState("closed");C.useEffect(()=>{const f=l.current;if(f)return f.addEventListener("transitionend",m),()=>{f.removeEventListener("transitionend",m)}},[]),C.useEffect(()=>{if(!a||typeof a!="string")return;const f=a.split(`
35
+ Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"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:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_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 emails 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",profile_image_change_uploading_text:"Uploading image...",profile_image_change_cta_with_picture:"Change photo",profile_image_change_cta_without_picture:"+ Add profile photo",profile_image_change_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",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_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",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 emails below.",inviteModal_cta:"Send",overlay_close:"Close",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",edit_section_placeholder_description:"Add some details",edit_section_placeholder_cta:"add",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"},Ph={...Xn,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>"},Nh={...Xn,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"},Rh={...Xn,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>"},Mh=Object.freeze(Object.defineProperty({__proto__:null,en:Xn,es:Ph,fr:Nh,pt:Rh},Symbol.toStringTag,{value:"Module"})),za=(e,t=Xn)=>e in t,kt=(e,t,n,r,a={})=>{let i="";return za(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},Ih=(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},ua=(e,t)=>C.Children.map(e,n=>Object.is(n,null)?n:C.cloneElement(n,{...t})),Pc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},$h=(e,t,n)=>!t.id||!t.name?"":n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Nc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(Er);if(!a)return e;for(const s of a){const o=s.replace(Er,(c,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"";else{const c=l;if(c.startsWith(ns))try{const h=c.replace(ns,"");u.id=h,await r({id:h}).then(p=>{const{name:m}=p;u.name=m||""})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?$h(e,u,t):s)}return e},Rc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Lh=(e="")=>e.replace(/\s+/g,"").length>0,as=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 _e=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:c=!1,children:h=!1,...p})=>{const g=Jn(typeof t=="object"),{showTooltip:f,tooltipProps:b}=Ns(!!u);if(typeof t=="object"&&typeof g=="number"){const k=Object.assign({},t),w=kc(Object.keys(k));t=_c(g,w,k)}!l&&u&&(u="");const y=[];typeof t=="string"&&y.push(t),r&&(y.push("icon"),typeof r=="object"?(y.push(r.icon),r.position?y.push(r.position):y.push("left"),r.hover&&y.push(`hover_${r.hover}`),r.animate&&(y.push("animate"),typeof r.animate=="string"&&y.push(r.animate))):(y.push(r),!r.includes("right")&&!r.includes("left")&&y.push("left"))),n.muted&&y.push("muted"),n.fullWidth&&y.push("full-width");const x={...p,className:Y(e,o,y,{"no-text":!h,disabled:l,button:a}),onClick:k=>{(!a||a[0]==="#")&&s&&(k.preventDefault(),k.stopPropagation()),s&&s(k)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",x.href=a);const A=C.createElement(i,x,h||(c?d.jsx(Me,{showOnFocus:!1,children:c}):null));return l&&u?d.jsxs("span",{className:"button-container",...b,children:[d.jsx(En,{isOpen:f,children:u}),A]}):A},kn=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?d.jsx(_e,{...s},o):d.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:d.jsx(_e,{...s})},o)});return C.createElement(a,{className:Y("button-wrapper",n),...r,children:i})};const tn=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return d.jsx("hr",{className:Y(e,{"has-max-width":t}),style:n})},Io={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},zh=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?Io[e]:Io.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},qh=({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},ii=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${qh({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const er=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:c,fetchPriority:h}=e,{range:p,sizes:m}=zh(e),g=ii({format:"avif",query:s,range:p,url:o}),f=ii({format:"webp",query:s,range:p,url:o}),b=ii({format:"",query:s,range:p,url:o});return i&&i.includes("svg")?d.jsx("picture",{className:t,children:d.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):d.jsxs("picture",{className:t,children:[i!=="image/gif"&&d.jsx("source",{type:"image/avif",srcSet:g,sizes:m,"data-testid":"source"}),d.jsx("source",{type:"image/webp",srcSet:f,sizes:m,"data-testid":"source"}),d.jsx("img",{srcSet:b,sizes:m,src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const Wh=({image:e,className:t="",testId:n})=>d.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&d.jsx(er,{image:{...e},className:"image"})}),_n=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),d.jsx("a",{href:e,className:Y("gtm-trackable",r),...l,children:t})}return n?C.createElement(n,{children:t,className:r,...o}):d.jsx(d.Fragment,{children:t})};const Mc=C.forwardRef(({className:e="",children:t},n)=>{const r=C.useRef(null),a=n||r;return d.jsx("aside",{ref:a,className:Y("popover",e),"aria-live":"polite",children:t})}),Ms=({children:e})=>typeof document=="object"?gc.createPortal(e,document.body):null;const Hh=({currentStep:e=1,steps:t=1})=>d.jsxs(d.Fragment,{children:[d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),d.jsx("div",{className:"progress-tracker",children:d.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return d.jsxs("div",{className:"dot-wrapper",children:[d.jsx("div",{className:Y("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),d.jsx("div",{className:Y("line",{active:a<e})})]},r)})})})]});const Uh=({elementId:e,offset:t=20})=>{const n=ue.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return d.jsx(_e,{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 Vh=({items:e,className:t="",...n})=>d.jsx("ul",{className:Y("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>d.jsx("li",{className:"bucket text-medium",children:d.jsxs("a",{href:i,...s,children:[d.jsx("p",{className:"title",children:r}),d.jsx("p",{children:a})]})},o))}),$o=300,Lo="ease-in-out";class Kh{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:$o,easing:Lo}),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:$o,easing:Lo}),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 qa=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=ue.useIntl(),i=C.useRef(null);return C.useEffect(()=>{let s;return r&&(s=new Kh(i.current)),()=>{r&&s&&s.cleanUp()}},[]),d.jsxs("details",{ref:i,className:Y("collapsible-section",t,{"should-animate":r}),children:[d.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),d.jsx("div",{className:"content",children:n})]})},zo={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Zh=e=>{let t=e;return Object.keys(zo).includes(e)&&(t=zo[e]),`url(${Wt}icons/${t}.svg)`};const qo={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},Ic=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=ue.useIntl(),i=t?{"--custom-icon":Zh(t)}:{},s=za(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:d.jsx("small",{className:Y("content-type-label text-small",e in qo?qo[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Nt=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Wt}icons/${t}.svg)`}:{};return d.jsx("div",{className:Y("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const an=({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=Jn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=kc(Object.keys(h));a=_c(s,p,h)}const{breakpoints:o,text:l="",component:u,...c}=n;return d.jsx(Nt,{variant:"subtle",className:Y("empty-state-box",e,r),children:d.jsxs(d.Fragment,{children:[t&&typeof t=="string"?d.jsx(Pt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||d.jsx(_e,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const is=({children:e,...t})=>d.jsx("p",{...t,children:e}),$c={q:is,blockquote:is};for(let e=1;e<=6;e++)$c[`h${e}`]={component:is,props:{className:"title"}};const Lc=({type:e="default",className:t="",heading:n=!1,children:r})=>d.jsxs("div",{className:Y("helper-text-box text-small",e,t),children:[n&&d.jsx("p",{className:"title",children:n}),typeof r=="string"?d.jsx(Pt,{options:{wrapper:C.Fragment,forceBlock:!0,overrides:$c},children:r}):d.jsx("p",{children:r})]});const zc=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,children:s})=>{const o=ue.useIntl(),l=C.useRef(null);e||(e=Date.now().toString());const[u,c]=C.useState(""),[h,p]=C.useState("closed");C.useEffect(()=>{const f=l.current;if(f)return f.addEventListener("transitionend",m),()=>{f.removeEventListener("transitionend",m)}},[]),C.useEffect(()=>{if(!a||typeof a!="string")return;const f=a.split(`
36
36
  `);c(f.length<3?`${a.substring(0,400)}...`:f.slice(0,3).join(`
37
- `))},[a]),C.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const m=({propertyName:f})=>{f==="max-height"&&p(D=>D==="opening"?"open":D==="closing"?"closed":D)};if(!a)return null;const g=["opening","open"].includes(h);return d.jsxs(Nt,{variant:"subtle",className:Y("hide-show-text-box",t),children:[d.jsxs("div",{ref:l,id:e,className:Y("content",h),children:[d.jsx(Pt,{options:{forceBlock:!0,...i},children:h==="closed"?u:a}),h!=="closed"&&s]}),d.jsx("p",{className:"cta",children:d.jsx(ke,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:Y({"rotate-180":g}),onClick:()=>{p(g?"ready-to-close":"opening")},"aria-expanded":g,"aria-controls":e,children:g?r||o.formatMessage({id:"hideShowTextBox_hide"}):n||o.formatMessage({id:"hideShowTextBox_show"})})})]})};const Yh=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:a={},className:i=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=a;return C.createElement(e,{className:Y("icon-bulleted-list text-medium",n,i,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:C.Fragment,forceInline:!0},h={"--icon":`url(${Wt}icons/${l.icon}.svg)`};return e==="dl"?d.jsxs(C.Fragment,{children:[d.jsx("dt",{style:h,children:d.jsx(Pt,{options:c,children:l.dt||""})},`dt-${u}`),d.jsx("dd",{children:typeof l.text=="string"?d.jsx(Pt,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):d.jsx("li",{style:h,children:typeof l.text=="string"?d.jsx(Pt,{options:c,children:l.text}):l.text},u)})})},tt=()=>C.Fragment,Gh=({children:e})=>d.jsx(Nt,{variant:"secondary",children:e}),Qh=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{className:"center",children:e}):d.jsx("div",{className:"center",children:e}),Jh=["span","strong","h1","h2","h3","h4","h5","h6","p"],Xh=({children:e})=>{const t=ue.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(C.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const s of C.Children.toArray(i.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&C.isValidElement(s)){const o=s.type;if(Jh.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(i);const a=n?n.toString():"";return d.jsx(za,{label:a,className:["Sources","Resources"].includes(a)?"discrete-links":"",children:r.map(i=>i)})},em=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return d.jsx(Nt,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return d.jsx(Nt,{variant:"primary",children:e});case"pink-textbox":return d.jsx(Nt,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{children:e}):e;default:return d.jsx("div",{...t,children:e})}return d.jsx("div",{...t,children:e})},tm=e=>{const t=ue.useIntl(),n=Date.now().toString();let r="default";const a=e.src;return a.includes("youtube")||a.includes("vimeo")?r="video":a.includes("riddle")||a.includes("sli.do")?r="poll":a.includes("padlet")&&(r="padlet"),d.jsxs(d.Fragment,{children:[d.jsx(Me,{element:"a",href:`#content-after-iframe-${n}`,onClick:i=>{var s;i.preventDefault(),i.stopPropagation(),(s=document.getElementById(`content-after-iframe-${n}`))==null||s.scrollIntoView({behavior:"smooth"})},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),d.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),d.jsx("span",{id:`content-after-iframe-${n}`})]})},Wo=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})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,a=!1;for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number")&&C.isValidElement(i)){const s=i.type;if(["button","center","span","strong"].includes(s)&&i.props&&i.props.children&&i.props.children[0])for((s==="button"||Wo(i.props.children[0])==="button")&&(a=!0),r=i.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!C.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&Wo(r)==="button"&&(a=!0);else break}return a?(n={...n,className:"button primary medium"},d.jsx("p",{className:"center",children:d.jsx(ke,{variant:"primary",size:"medium",...n,children:r})})):d.jsx("a",{...n,children:r})},ss=({children:e,...t})=>d.jsx("span",{className:Y({url:t==null?void 0:t.href}),children:e});const rm={default:{a:nm,CollapsibleSection:za,TextBox:Nt,CaseStudy:Gh,style:tt,details:Xh,div:em,iframe:tm,center:Qh},"text-only":{h1:tt,h2:tt,h3:tt,h4:tt,h5:tt,h6:tt,style:tt,details:tt,div:tt,TextBox:tt,CollapsibleSection:tt,CaseStudy:tt,blockquote:tt,iframe:tt,button:tt}},Vn=({className:e="",options:t={},children:n,overrideType:r="default",styling:a={}})=>{if(!n)return null;const{highlightTitles:i=!1}=a;n=n.replace(/^<br\/?>/,"");const s={wrapper:C.Fragment,forceBlock:!0};let o=rm[r];return t.overrides&&(o={...o,...t.overrides}),d.jsx("div",{className:Y("markdown-text",e,{"highlight-titles":i}),children:d.jsx(Pt,{options:{...s,...t,overrides:o},children:n})})};const qc=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:a=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return d.jsxs("section",{className:Y("page-heading",a),children:[d.jsxs("div",{className:Y("content",{"has-max-width":e}),style:i,children:[t&&t.text&&C.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&C.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const hn=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:a="",children:i,...s})=>{const o={"--icon":`url(${Wt}icons/${r}.svg)`},{showTooltip:l,tooltipProps:u}=Ns(!!a),c=d.jsx("span",{...u,className:Y("pill",e,t,n,{"has-icon":r}),style:o,...s,children:i});return a?d.jsxs("span",{className:"pill-wrapper",children:[d.jsx(En,{isOpen:l,children:a}),c]}):c};const Er=({element:e="p",children:t=null,className:n="",...r})=>C.createElement(e,{...r,className:Y("status-banner text-small",n),"aria-live":"assertive"},t);const am=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const a=ue.useIntl(),{showText:i=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return d.jsx("span",{className:Y(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:C.createElement(i?"span":Me,{className:i?"text":"",children:n||a.formatMessage({id:"progressBar"},{number:t})})})},Is=C.memo(am);const ii="loadingBlock_",im=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ue.useIntl();t||(t={0:{text:r.formatMessage({id:`${ii}loading`})},75:{text:r.formatMessage({id:`${ii}almostDone`})},100:{text:r.formatMessage({id:`${ii}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(${Wt}icons/${t[a].icon}.svg)`}:{};return d.jsxs(Nt,{className:Y("loading-block",n,{"has-icon":a&&t[a].icon}),variant:"subtle",style:s,children:[a&&d.jsx("span",{className:"step",children:t[a].text}),d.jsx(Is,{progress:e})]})},sm=C.memo(im);const wt=({element:e="div",className:t="",...n})=>d.jsx($a,{element:e,className:Y("loading-placeholder",t),...n});const os={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},Wc=(e,t)=>e in os?d.jsx("div",{className:e,children:os[e].map((n,r)=>Wc(n,r))},t):d.jsx(wt,{className:e},t),$s=({layout:e="overview-page",...t})=>d.jsx("div",{className:Y("loading-state",e),...t,children:os[e].map((n,r)=>Wc(n,r))}),Hc=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):""},Lr=["#5AB6A3","#A2D7AF","#806056","#3962B3"],om=e=>{const t=Math.ceil(26/Lr.length),n=Hc(e).toLowerCase();if(n==="")return Lr[0];const r=n.charCodeAt(0)-96;for(let a=0;a<Lr.length;a++)if(r<=t*(a+1))return Lr[a]};const Ho=256,sn=({className:e="",src:t="",name:n,alt:r,width:a=Ho,height:i=Ho,...s})=>{const[o,l]=C.useState(!1),u=C.useRef(null),c=r??n;C.useEffect(()=>{const p=u.current;if(!p)return;const m=p.getContext("2d");if(!m)return;const g=a,f=i;typeof window<"u"&&window.devicePixelRatio&&(p.width=g*window.devicePixelRatio,p.height=f*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=om(n),m.fillRect(0,0,g,f),m.font=`${g/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(Hc(n),g/2,f/1.6)},[n]);let h=!1;return t&&t!==""&&!o&&(t.includes("http")||t.includes("//"))&&(h=!0),d.jsx("figure",{className:Y("profile-picture",e,{error:o}),...s,children:h?d.jsx("img",{src:t,alt:c,onError:()=>{l(!0)},width:a,height:i}):d.jsx("canvas",{ref:u})})},Ls=e=>e==="apolitical"?{image:`${Wt}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Wt}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},um=({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=Hn(l,r)),l};const tr=({element:e="div",member:t="community",additionalContent:n=!1,styling:r={},functions:a={},gtmContext:i="member",gtmType:s="member-click",className:o="",alt:l=""})=>{const u=ue.useIntl(),{size:c="medium"}=r,h=Ls(t);h.name||(h.name=u.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:p,image:m}=h;let{url:g}=h;t.link!==void 0&&(t.link===!1?g=void 0:g=t.link);const f=um(h),D=n&&n.createdAt?rs(n.createdAt):!1,y=n&&n.createdAt?Rs(n.createdAt):"";return C.createElement(e,{className:Y("member text-medium",c,o),...a,children:d.jsxs(_n,{href:g,gtmType:s,gtmContext:i,onClick:x=>{x==null||x.stopPropagation()},children:[d.jsx(sn,{name:p,src:m,alt:l}),d.jsxs("p",{className:"details",children:[d.jsxs("strong",{children:[p,n&&d.jsxs("span",{className:"additional-content",children:[n.createdAt&&D&&d.jsx("span",{className:"date",title:y,"aria-label":y,children:u.formatMessage({id:`dates_${D.path}`},{number:D.number})}),n.didEdit&&d.jsx("em",{children:u.formatMessage({id:"discussion_edited"})})]})]}),f&&d.jsx("small",{className:Y({"text-medium":c==="large"}),children:f})]})]})})};const Uo={small:24,medium:48},zs=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:a,showGap:i,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...c})=>{const h=ue.useIntl();return!n||n.length===0?null:C.createElement(e,{...c,className:Y("contributors",u,a,{"has-gap":i}),children:d.jsxs(d.Fragment,{children:[d.jsx("ul",{children:n.map((p,m)=>{let g,f="";if(m<o){const{name:D="",image:y=""}=Ls(p);if(s)return d.jsx(wt,{element:"li",className:"contributor"},m);g=d.jsx(sn,{name:D,src:y,width:Uo[a||"medium"],height:Uo[a||"medium"]})}else if(m===o){const D=(t||n.length)-o;g=d.jsxs("small",{className:Y({"large-number":D>99}),children:["+",Ih(D,0)]}),f="number-left"}return g?d.jsx("li",{className:Y("contributor",f),children:g},m):null})}),r&&d.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?h.formatMessage({id:`member_${n[0]}`}):Hn(n[0].name||"",20):l||null})]})})};const qs=({limit:e,valueLength:t})=>{const n=ue.useIntl(),r="form_fieldWrapper_characterLimit";if(e===0)return null;const a=e-t,i=Math.abs(t-e);return d.jsxs("small",{className:Y("character-limit",{"near-limit":t>=.99*e,"approaching-limit":t>=.9*e&&t<.99*e}),"aria-live":"polite","aria-label":n.formatMessage({id:`${r}_aria_${a<0?"over":"default"}`},{remaining:a,over:i,limit:e}),children:[d.jsx("span",{className:"hidden",children:n.formatMessage({id:r})}),t," / ",e]})},qa=e=>(e==null?void 0:e.toString().length)||0,Uc=(e,t=null)=>{const n={};return e===0||(n["data-character-limit"]=e,t&&(n.functions={onChange:r=>{qa(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t(r)}})),n};const zr="emailHelperTextBox_",Vc=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const a=ue.useIntl(),[i,s]=C.useState({path:`${zr}default`,type:"default",link:{},mail:{},error:""}),[o,l]=C.useState(!1),u=C.useCallback(m=>{m.preventDefault(),m.stopPropagation();const g=f=>{s({path:`${zr}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:D=>u(D),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:f})};if(typeof r!="function"){g(a.formatMessage({id:`${zr}error_noFunction`}));return}l(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(f=>{g(f.message)}).finally(()=>{l(!1)})},[t,n,r]);C.useEffect(()=>{let m=zr,g="default",f={},D={};switch(e){case"gov":m+="autoApproved",g="success";break;case"nonGov":m+="unrecognisedEmail",g="error",f={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":m+="pendingApproval",g="error",D={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":m+="emailUnverified",g="error",f={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:y=>u(y),"data-testid":"send-verify-email-click"};break;case"exists":m+="emailAlreadyExists",g="error",f={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},D={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:m+="default",f={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}s({...i,path:m,type:g,link:f,mail:D})},[e]);const c={};return["link","mail"].forEach(m=>{c[m]=Object.keys(i[m]).length?g=>d.jsx("a",{...i[m],children:g}):g=>g}),d.jsx(Lc,{type:i.type,heading:o?!1:a.formatMessage({id:`${i.path}_title`}),children:o?d.jsxs(d.Fragment,{children:[d.jsx(wt,{element:"span"}),d.jsx(wt,{element:"span"})]}):a.formatMessage({id:`${i.path}_text`},{...c,strong:m=>d.jsx("strong",{children:m}),em:m=>d.jsx("em",{children:m}),br:d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("br",{})]}),error:i.error})})},Rn=({className:e="",element:t="input",id:n,inputRef:r,functions:a={onChange:()=>{}},name:i=n,placeholder:s,type:o="text",value:l,...u})=>{const c=C.useRef(),h=r||c;return C.createElement(t,{ref:h,...u,type:o,id:n,name:i,className:Y(e,t,{"has-scrollbar":o==="textarea"&&h.current&&h.current.clientHeight<h.current.scrollHeight}),value:l,placeholder:s,...a,onChange:p=>{const m=p.target;a.onChange(m.value)}})};const Tn={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},lm=500,cm=({id:e,name:t=e,value:n,placeholder:r,functions:a={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...i})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=a,[{input:l,displayInput:u,debouncedInput:c},h]=C.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:p,activePredictionIndex:m,isPredictionSelected:g},f]=C.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:D}=ue.useIntl();r||(r=D({id:"inputAutocomplete_placeholder"})),C.useEffect(()=>{const _=setTimeout(()=>{g||h(E=>({...E,debouncedInput:l}))},lm);return()=>{clearTimeout(_)}},[l,g]),C.useEffect(()=>{c&&!g?(async()=>{try{const E=await o(c)||[];f(F=>({...F,predictions:E}))}catch(E){console.error("Error fetching predictions:",E),f(F=>({...F,predictions:[]}))}})():f(_=>({..._,predictions:[]}))},[c,g]),C.useEffect(()=>{m>=0&&p[m]&&h(_=>({..._,displayInput:p[m].description}))},[m,p]);const y=_=>{[Tn.DOWN,Tn.UP,Tn.ENTER].includes(_.key)&&(_.preventDefault(),_.key===Tn.DOWN&&m<p.length-1?f(E=>({...E,activePredictionIndex:m+1})):_.key===Tn.UP&&m>0?f(E=>({...E,activePredictionIndex:m-1})):_.key===Tn.ENTER&&m>-1&&(s(p[m].description),h(E=>({...E,input:p[m].description})),f(E=>({...E,predictions:[],isPredictionSelected:!0}))))},x=_=>{s(_.target.value),h(E=>({...E,input:_.target.value,displayInput:_.target.value})),f(E=>({...E,activePredictionIndex:-1,isPredictionSelected:!1}))},A=_=>{s(_.description),h(E=>({...E,input:_.description,displayInput:_.description})),f(E=>({...E,isPredictionSelected:!0,predictions:[]}))};return d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:u,onChange:x,onKeyDown:y,placeholder:r,name:t,id:e,...i}),d.jsx("ul",{className:"predictions-list",children:p.map((_,E)=>d.jsx("li",{onClick:()=>A(_),onMouseEnter:()=>f(F=>({...F,activePredictionIndex:E})),className:Y("predictions-list-item",{active:E===m}),children:_.description},E))})]})};const Kc=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:a,inputRef:i,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:c,...h})=>{const p=ue.useIntl(),{onChange:m,...g}=r,f=()=>{t||m(c?null:l)},D=d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:i,id:a,name:a,type:u,value:l,checked:c,onKeyDown:y=>{(y.key==="Enter"||y.code==="Space")&&(y.preventDefault(),y.stopPropagation(),f())},readOnly:!0,disabled:t}),d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("label",{htmlFor:a,children:o||p.formatMessage({id:s?`${s}_${a}`:a})})]});return C.createElement(n,{onClick:y=>{const x=y.target;x.nodeName.toLowerCase()==="a"||x.parentNode&&x.parentNode.nodeName.toLowerCase()==="a"||(y.preventDefault(),y.stopPropagation(),f())},className:Y("checkbox-wrapper",e),...h,...g},D)};const dm=C.memo(function({direction:t="down"}){return d.jsx($a,{className:Y("rotating-chevron",`direction-${t}`)})});const fm=({className:e,options:t,initialValue:n,value:r,functions:a={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:i}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const c=ue.useIntl(),[h,p]=C.useState(!1),m=r||n,g=Array.isArray(m)?[...m]:m?[m]:[],[f,D]=C.useState(g);let y;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?y=t&&f?t.find(T=>T.id===f[0]):t?t[0]:{id:"",label:""}:Array.isArray(f)&&f.length===1&&typeof f[0]!="string"?y=f[0]:y={id:"",label:""},C.useEffect(()=>{D(g)},[r,n]);const{onChange:x,onMultiSelectSubmit:A,..._}=a,E=T=>{if(o){let I=[];f!=null&&f.includes(T.id)?I=f.filter(R=>R!==T.id):I=[...f,T.id],D([...I]),x&&x([...I])}else D([T]),x&&x(T.id),p(!1)},F=T=>{if(T==="all"){const I=(t==null?void 0:t.map(R=>R.id))||[];D(I),x&&x(I)}else D([]),x&&x([])};return d.jsxs("div",{className:Y("dropdown-wrapper",e),children:[d.jsxs("button",{className:"input","aria-expanded":h,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:T=>{T.preventDefault(),T.stopPropagation(),p(!h)},"data-testid":"dropdown-selector",..._,children:[o?`${s} · ${f.length}`:y.label,d.jsx(dm,{direction:h?"up":"down"})]}),d.jsx("select",{defaultValue:y.id,onChange:T=>{T.preventDefault(),T.stopPropagation();const I=t&&t.find(R=>R.id===T.target.value);E(I)},hidden:!h,..._,children:t==null?void 0:t.map(T=>d.jsx("option",{value:T.id,children:T.label},T.id))}),d.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!h,children:[d.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&d.jsxs("div",{className:"action-bar",children:[d.jsx("p",{children:`${f==null?void 0:f.length} selected`}),d.jsxs("ul",{children:[d.jsx("li",{children:d.jsx(ke,{variant:"tertiary",size:"small",onClick:()=>F("all"),className:"gtm-trackable",children:c.formatMessage({id:"dropdown_menu_multiselect_all"})})}),d.jsx("li",{children:d.jsx(ke,{variant:"tertiary",size:"small",onClick:()=>F("none"),className:"gtm-trackable",children:c.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),d.jsx("ul",{children:t==null?void 0:t.map(T=>{const I=T.id===y.id||(f==null?void 0:f.includes(T))||(f==null?void 0:f.includes(T.id));return d.jsx("li",{"data-testid":"dropdown-options",children:d.jsxs("button",{className:Y("gtm-trackable",{selected:I,"selected-single":I&&!o}),"data-gtm-event-type":`${T}-click`,"data-gtm-event-context":i,onClick:R=>{R.preventDefault(),R.stopPropagation(),E(T)},role:"menuitem","aria-current":I,"data-testid":I?"current-selection":"",children:[o&&d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("span",{className:Y({"menu-option-label":o}),children:T.label})]})},T.id)})})]}),(l==null?void 0:l.submitSection)&&d.jsx("p",{className:"submit",children:d.jsx(ke,{variant:"secondary",onClick:()=>{A&&A(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),p(!1)},children:c.formatMessage({id:"form_submit"})})})]})]})};const hm=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:a,multiSelect:i=!1,name:s,options:o,required:l,type:u="checkboxes",value:c,...h})=>{const p=ue.useIntl(),m=i?c:[],g=c;return d.jsx("ul",{...h,className:Y("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:f,label:D=!1,value:y=f,disabled:x=!1})=>{const A=`${r}_${f}`,_=()=>{if(x)return;let E;if(i){const F=m==null?void 0:m.indexOf(y);Array.isArray(m)&&F>=0?(E=m,E.splice(F,1)):(!m||m.length===0?E=[]:E=m,E.push(y))}else E=g===y?void 0:y;t.onChange(E)};return d.jsx(Kc,{element:"li",id:A,type:u==="checkboxes"?"checkbox":"radio",shownValue:y,value:i?m==null?void 0:m.includes(y):g===y,functions:{...t,onChange:_},intlPath:n,label:D||p.formatMessage({id:n?`${n}_${f}`:f}),disabled:x},A)})})};const mm=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},...r})=>{const a=ue.useIntl(),i=C.useRef(),s=e||i,[o,l]=C.useState(!1),[u,c]=C.useState(t),h=()=>{var p;l(!o),c(o?"password":"text"),(p=s.current)==null||p.focus()};return d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:Y("show-password gtm-trackable",{"password-visible":o}),"data-gtm-event-context":n,"data-gtm-event-type":`${o?"hide":"show"}-password-click`,onClick:h,"aria-label":a.formatMessage({id:`showpassword_aria_${o?"hide":"show"}`}),children:a.formatMessage({id:`showpassword_${o?"hide":"show"}`})}),d.jsx(Rn,{inputRef:s,type:u,...r})]})};const Sn={text:{component:Rn},email:{component:Rn},url:{component:Rn},textarea:{component:Rn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Kc},checkboxes:{component:hm,props:{multiSelect:!0}},select:{component:fm},password:{component:mm},autocomplete:{component:cm}},pm=({id:e,intlPath:t=!1,className:n="",error:r,functions:a={onChange:()=>{}},limit:i=0,showRequiredLabels:s=!0,type:o,validation:l,value:u,submitOnEnter:c,...h})=>{const p=ue.useIntl(),m=l&&l.some(({condition:E})=>E==="required"),g=qa(u),f=o&&Sn[o]&&Sn[o].component?Sn[o].component:Rn,D={};o&&["checkboxes"].includes(o)?D.element="span":D.htmlFor=e;let y={...h,id:e,name:e,className:r?"error":"",type:o,required:m,"aria-required":m,functions:pn(a),value:u};if(i>0){const E=Uc(i,a.onChange);y={...y,...E},E.functions&&typeof E.functions=="object"&&(y.functions={...y.functions,...E.functions})}o&&Sn[o]&&Sn[o].props&&(y={...y,...Sn[o].props}),o&&["checkboxes"].includes(o)&&(y.intlPath=`${t}_${e}`),r&&(y["aria-invalid"]=!0,y["aria-describedby"]=`error-${e}`);const x=h.label||p.formatMessage({id:t?`${t}_${e}`:e}),A=({...E})=>r?C.createElement(E.as||"dd",{id:`error-${e}`,className:"error text-small",role:"alert","aria-live":"assertive",...E},r):null;if(o&&["checkbox"].includes(o))return d.jsxs(d.Fragment,{children:[d.jsx(f,{...y,label:x,className:Y("field-wrapper",n)}),d.jsx(A,{as:"p"})]});const _=E=>C.createElement(E.element||"label",{...E,className:"checkboxes-label text-small","data-testid":`label-${e}`});return d.jsxs("dl",{className:Y("field-wrapper text-medium",n),children:[d.jsx("dt",{children:d.jsxs(_,{...D,children:[x,m&&s&&d.jsxs(d.Fragment,{children:[" ",d.jsxs("small",{children:["(",p.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})}),d.jsxs("dd",{children:[d.jsx(f,{...y}),d.jsx(qs,{limit:i,valueLength:g})]}),d.jsx(A,{})]})},gm=(e,t)=>{const{type:n,payload:r}=t,a=e.errors?pn(e.errors):{},i=e.values?pn(e.values):{};switch(n){case"toggleSubmitting":return{...e,isSubmitting:!e.isSubmitting};case"updateValue":if(r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:a,[r==null?void 0:r.key]:r==null?void 0:r.value};i[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:a,values:i};case"addError":return r!=null&&r.key&&!a[r==null?void 0:r.key]&&(a[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:a};case"removeError":return r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],{...e,errors:a};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:c}=r,h=pn(Object.keys(a));for(const p of s)if(p.validation)for(let m=0;m<p.validation.length;m++){const{condition:g="required",error:f=!1}=p.validation[m];let D=!1;if(typeof g=="function"){const y=g(i);y&&(D=f||y)}else{const y=i[p.id];switch(g){case"required":(!y||typeof y=="string"&&y.trim().length===0)&&(D=f||(c==null?void 0:c.formatMessage({id:"form_error_required"})));break;case"no-numbers":{y&&!/^([^0-9]*)$/.test(y)&&(D=f||(c==null?void 0:c.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{y&&!/^(([^<>()[\]\\.,;:\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(y)&&(D=f||(c==null?void 0:c.formatMessage({id:"form_error_email"})));break}case"valid-url":{y&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(y)&&(D=f||(c==null?void 0:c.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(D){o({type:"addError",payload:{key:p.id,value:D}}),h.push(p.id);break}}return h.length===0?l(i):u(i,h),{...e,isSubmitting:!1}}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let si=null;const nr=({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,gtm:u={context:"Form",event:"form-submit-click"},functions:{onSuccess:c=async()=>{},onCancel:h=()=>{},onCatch:p=()=>{},onFailure:m=()=>{}}={onSuccess:async()=>{},onCancel:()=>{},onCatch:()=>{},onFailure:()=>{}},...g})=>{const{customOnSubmit:f,hideButton:D,...y}=s,x=40,{shouldShowCancelButton:A=!1,shouldReset:_=!0,showRequiredLabels:E=!0,showSuccessMessage:F=!1}=l||{},T=ue.useIntl(),I={};t.length&&t.forEach(v=>{const W=v.id||v.name;W&&(I[W]=v.value||"")});const[R,M]=C.useReducer(gm,{isSubmitting:!1,formSubmitted:!1,errors:{},values:I}),{errors:$,isSubmitting:w,formSubmitted:k,values:O}=R;C.useEffect(()=>{_&&k&&(si=setTimeout(()=>{M({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[k]),C.useEffect(()=>()=>{si&&clearTimeout(si)},[]),C.useEffect(()=>{const v=W=>{M({type:"updateValue",payload:{key:W.detail.id,value:W.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",v),()=>{document.removeEventListener("dropdownMultiSelectSubmit",v)}},[]);const j=C.useRef(null),z=a||j;if(!t.length)return null;s.text||(s.text=T.formatMessage({id:"form_submit"}));const H=()=>{if(!w){if(M({type:"toggleSubmitting"}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&M({type:"submitForm",payload:{fields:t,dispatch:M,intl:T}});return}M({type:"submitForm",payload:{fields:t,dispatch:M,onSuccess:async v=>{try{await c(v),M({type:_?"formSubmittedAndReset":"formSubmitted"})}catch(W){p(W),M({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(v,W)=>{m(v,W),M({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:T}})}},J=[{...y,icon:k?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:v=>{var B;if(v.preventDefault(),v.stopPropagation(),w)return;let W=0;if((B=z==null?void 0:z.current)!=null&&B.id){const S=document.getElementById(z.current.id);S&&(W=S.getBoundingClientRect().top+window.scrollY)}const ee=document.getElementById("header");ee&&(W=W-ee.offsetHeight-x),W<0&&(W=0),window.scrollTo({top:W,behavior:"smooth"}),H()},disabled:w||k||s.disabled,"data-gtm-event-context":u.context,"data-gtm-event-type":u.event,children:w||k?T.formatMessage({id:`form_${w?"submitting":"submitted"}`}):s.text}];return A&&J.unshift({...o,className:"gtm-trackable","data-gtm-event-context":u.context,"data-gtm-event-type":u.event,disabled:w||k,onClick:h,children:o.text||T.formatMessage({id:"form_cancel"})}),d.jsxs(d.Fragment,{children:[C.createElement(e,{...g,id:r,className:Y("form",n),ref:z},d.jsxs(d.Fragment,{children:[$!=null&&$.general?d.jsx(an,{variant:"error",text:T.formatMessage({id:"form_error_generalError"})}):null,(!_||!w&&!k||f)&&t.map((v,W)=>{const{id:ee=v.name||W,component:B,functions:S={onChange:()=>{}},submitOnEnter:q=!1}=v;if(B)return d.jsx(B,{...v.props||{}},`component-${ee}-${W}`);const L=O?O[ee]:"",U={...S,onChange:ne=>{M({type:"updateValue",payload:{key:ee,value:ne}}),S.onChange(ne&&ne.toString(),M)}};return q&&(U.onKeyDown=ne=>{ne.key==="Enter"&&(ne.stopPropagation(),ne.preventDefault(),H()),S.onKeyDown&&S.onKeyDown(ne)}),d.jsx(pm,{intlPath:i,...v,showRequiredLabels:E,value:L,error:$==null?void 0:$[ee],functions:U},ee)}),D?null:(w||k)&&f?f:d.jsx(kn,{className:Y("cta",{center:w||k,submitted:k}),buttons:J})]})),F&&k&&d.jsx(Er,{className:"success",children:typeof F=="string"?F:T.formatMessage({id:"form_success"})})]})};const qr="passwordRules_",Zc="isMoreThanEightCharacters",Yc="includesNumberAndSymbol",Gc="includesLowerAndUppercase",vm={[Zc]:"8Characters",[Yc]:"numberSymbol",[Gc]:"lowercaseUppercase"},bm=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ue.useIntl();return d.jsxs("aside",{className:Y("password-rules",t),children:[d.jsx("small",{children:n.formatMessage({id:`${qr}intro`})}),d.jsx("ul",{children:[Zc,Yc,Gc].map(r=>d.jsxs("li",{className:Y({matches:e[r]}),children:[d.jsxs(Me,{children:[n.formatMessage({id:`${qr}rule_label`})," "]}),d.jsx("span",{children:n.formatMessage({id:`${qr}rule_${vm[r]}`})}),!e[r]&&d.jsxs(Me,{element:"strong",children:[" ",n.formatMessage({id:`${qr}notMet`})]})]},`rule-${r}`))})]})},Qc=C.memo(bm);const ym=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:a=()=>{}},className:i="",hasLoaded:s=!1})=>{const o=ue.useIntl(),[l,u]=C.useState({setUp:!1,id:null,rating:null,disabled:!0}),c=async()=>{try{const y=await n();u(x=>({...x,setUp:!0,id:y&&y.id,disabled:!1}))}catch(y){u(x=>({...x,setUp:!0,disabled:!0})),a(y)}};if(C.useEffect(()=>{s&&!l.setUp&&c()},[s]),!s)return d.jsx(wt,{className:"rating-placeholder"});const{id:h,rating:p,disabled:m}=l,g="ratings_",f={text:o.formatMessage({id:`${g}text`}),low:o.formatMessage({id:`${g}low`}),high:o.formatMessage({id:`${g}high`}),success:o.formatMessage({id:`${g}success`}),...e},D=async y=>{if(!(!h||m))try{u(x=>({...x,rating:y,disabled:!0})),await r({id:h,value:y})}catch(x){u(A=>({...A,rating:null})),a(x)}finally{u(x=>({...x,disabled:!1}))}};return d.jsxs("div",{className:Y("rating",i),children:[d.jsx("span",{className:"label",children:f[p?"success":"text"]}),d.jsx("ol",{children:Array.from(new Array(t).keys()).map(y=>{const x=y+1;return d.jsx("li",{className:Y({selected:p&&x<=p}),children:d.jsx(ke,{variant:"tertiary",size:"small",icon:{icon:`star${!p||x>p?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:x,total:t})}${x===1||x===t?` - ${f[x===1?"low":"high"]}`:""}`,onClick:A=>{A.preventDefault(),A.stopPropagation(),D(x)},disabled:m})},`rating-${x}`)})})]})};function Dm(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 us(e,t){return Array(t+1).join(e)}function Cm(e){return e.replace(/^\n*/,"")}function xm(e){for(var t=e.length;t>0&&e[t-1]===`
37
+ `))},[a]),C.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const m=({propertyName:f})=>{f==="max-height"&&p(b=>b==="opening"?"open":b==="closing"?"closed":b)};if(!a)return null;const g=["opening","open"].includes(h);return d.jsxs(Nt,{variant:"subtle",className:Y("hide-show-text-box",t),children:[d.jsxs("div",{ref:l,id:e,className:Y("content",h),children:[d.jsx(Pt,{options:{forceBlock:!0,...i},children:h==="closed"?u:a}),h!=="closed"&&s]}),d.jsx("p",{className:"cta",children:d.jsx(_e,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:Y({"rotate-180":g}),onClick:()=>{p(g?"ready-to-close":"opening")},"aria-expanded":g,"aria-controls":e,children:g?r||o.formatMessage({id:"hideShowTextBox_hide"}):n||o.formatMessage({id:"hideShowTextBox_show"})})})]})};const Yh=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:a={},className:i=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=a;return C.createElement(e,{className:Y("icon-bulleted-list text-medium",n,i,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:C.Fragment,forceInline:!0},h={"--icon":`url(${Wt}icons/${l.icon}.svg)`};return e==="dl"?d.jsxs(C.Fragment,{children:[d.jsx("dt",{style:h,children:d.jsx(Pt,{options:c,children:l.dt||""})},`dt-${u}`),d.jsx("dd",{children:typeof l.text=="string"?d.jsx(Pt,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):d.jsx("li",{style:h,children:typeof l.text=="string"?d.jsx(Pt,{options:c,children:l.text}):l.text},u)})})},tt=()=>C.Fragment,Gh=({children:e})=>d.jsx(Nt,{variant:"secondary",children:e}),Qh=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{className:"center",children:e}):d.jsx("div",{className:"center",children:e}),Jh=["span","strong","h1","h2","h3","h4","h5","h6","p"],Xh=({children:e})=>{const t=ue.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(C.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const s of C.Children.toArray(i.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&C.isValidElement(s)){const o=s.type;if(Jh.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(i);const a=n?n.toString():"";return d.jsx(qa,{label:a,className:["Sources","Resources"].includes(a)?"discrete-links":"",children:r.map(i=>i)})},em=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return d.jsx(Nt,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return d.jsx(Nt,{variant:"primary",children:e});case"pink-textbox":return d.jsx(Nt,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{children:e}):e;default:return d.jsx("div",{...t,children:e})}return d.jsx("div",{...t,children:e})},tm=e=>{const t=ue.useIntl(),n=Date.now().toString();let r="default";const a=e.src;return a.includes("youtube")||a.includes("vimeo")?r="video":a.includes("riddle")||a.includes("sli.do")?r="poll":a.includes("padlet")&&(r="padlet"),d.jsxs(d.Fragment,{children:[d.jsx(Me,{element:"a",href:`#content-after-iframe-${n}`,onClick:i=>{var s;i.preventDefault(),i.stopPropagation(),(s=document.getElementById(`content-after-iframe-${n}`))==null||s.scrollIntoView({behavior:"smooth"})},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),d.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),d.jsx("span",{id:`content-after-iframe-${n}`})]})},Wo=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})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,a=!1;for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number")&&C.isValidElement(i)){const s=i.type;if(["button","center","span","strong"].includes(s)&&i.props&&i.props.children&&i.props.children[0])for((s==="button"||Wo(i.props.children[0])==="button")&&(a=!0),r=i.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!C.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&Wo(r)==="button"&&(a=!0);else break}return a?(n={...n,className:"button primary medium"},d.jsx("p",{className:"center",children:d.jsx(_e,{variant:"primary",size:"medium",...n,children:r})})):d.jsx("a",{...n,children:r})},ss=({children:e,...t})=>d.jsx("span",{className:Y({url:t==null?void 0:t.href}),children:e});const rm={default:{a:nm,CollapsibleSection:qa,TextBox:Nt,CaseStudy:Gh,style:tt,details:Xh,div:em,iframe:tm,center:Qh},"text-only":{h1:tt,h2:tt,h3:tt,h4:tt,h5:tt,h6:tt,style:tt,details:tt,div:tt,TextBox:tt,CollapsibleSection:tt,CaseStudy:tt,blockquote:tt,iframe:tt,button:tt}},Vn=({className:e="",options:t={},children:n,overrideType:r="default",styling:a={}})=>{if(!n)return null;const{highlightTitles:i=!1}=a;n=n.replace(/^<br\/?>/,"");const s={wrapper:C.Fragment,forceBlock:!0};let o=rm[r];return t.overrides&&(o={...o,...t.overrides}),d.jsx("div",{className:Y("markdown-text",e,{"highlight-titles":i}),children:d.jsx(Pt,{options:{...s,...t,overrides:o},children:n})})};const qc=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:a=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return d.jsxs("section",{className:Y("page-heading",a),children:[d.jsxs("div",{className:Y("content",{"has-max-width":e}),style:i,children:[t&&t.text&&C.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&C.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const hn=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:a="",children:i,...s})=>{const o={"--icon":`url(${Wt}icons/${r}.svg)`},{showTooltip:l,tooltipProps:u}=Ns(!!a),c=d.jsx("span",{...u,className:Y("pill",e,t,n,{"has-icon":r}),style:o,...s,children:i});return a?d.jsxs("span",{className:"pill-wrapper",children:[d.jsx(En,{isOpen:l,children:a}),c]}):c};const kr=({element:e="p",children:t=null,className:n="",...r})=>C.createElement(e,{...r,className:Y("status-banner text-small",n),"aria-live":"assertive"},t);const am=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const a=ue.useIntl(),{showText:i=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return d.jsx("span",{className:Y(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:C.createElement(i?"span":Me,{className:i?"text":"",children:n||a.formatMessage({id:"progressBar"},{number:t})})})},Is=C.memo(am);const si="loadingBlock_",im=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ue.useIntl();t||(t={0:{text:r.formatMessage({id:`${si}loading`})},75:{text:r.formatMessage({id:`${si}almostDone`})},100:{text:r.formatMessage({id:`${si}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(${Wt}icons/${t[a].icon}.svg)`}:{};return d.jsxs(Nt,{className:Y("loading-block",n,{"has-icon":a&&t[a].icon}),variant:"subtle",style:s,children:[a&&d.jsx("span",{className:"step",children:t[a].text}),d.jsx(Is,{progress:e})]})},sm=C.memo(im);const wt=({element:e="div",className:t="",...n})=>d.jsx(La,{element:e,className:Y("loading-placeholder",t),...n});const os={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},Wc=(e,t)=>e in os?d.jsx("div",{className:e,children:os[e].map((n,r)=>Wc(n,r))},t):d.jsx(wt,{className:e},t),$s=({layout:e="overview-page",...t})=>d.jsx("div",{className:Y("loading-state",e),...t,children:os[e].map((n,r)=>Wc(n,r))}),Hc=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):""},zr=["#5AB6A3","#A2D7AF","#806056","#3962B3"],om=e=>{const t=Math.ceil(26/zr.length),n=Hc(e).toLowerCase();if(n==="")return zr[0];const r=n.charCodeAt(0)-96;for(let a=0;a<zr.length;a++)if(r<=t*(a+1))return zr[a]};const Ho=256,sn=({className:e="",src:t="",name:n,alt:r,width:a=Ho,height:i=Ho,...s})=>{const[o,l]=C.useState(!1),u=C.useRef(null),c=r??n;C.useEffect(()=>{const p=u.current;if(!p)return;const m=p.getContext("2d");if(!m)return;const g=a,f=i;typeof window<"u"&&window.devicePixelRatio&&(p.width=g*window.devicePixelRatio,p.height=f*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=om(n),m.fillRect(0,0,g,f),m.font=`${g/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(Hc(n),g/2,f/1.6)},[n]);let h=!1;return t&&t!==""&&!o&&(t.includes("http")||t.includes("//"))&&(h=!0),d.jsx("figure",{className:Y("profile-picture",e,{error:o}),...s,children:h?d.jsx("img",{src:t,alt:c,onError:()=>{l(!0)},width:a,height:i}):d.jsx("canvas",{ref:u})})},Ls=e=>e==="apolitical"?{image:`${Wt}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Wt}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},um=({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=Hn(l,r)),l};const tr=({element:e="div",member:t="community",additionalContent:n=!1,styling:r={},functions:a={},gtmContext:i="member",gtmType:s="member-click",className:o="",alt:l=""})=>{const u=ue.useIntl(),{size:c="medium"}=r,h=Ls(t);h.name||(h.name=u.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:p,image:m}=h;let{url:g}=h;t.link!==void 0&&(t.link===!1?g=void 0:g=t.link);const f=um(h),b=n&&n.createdAt?rs(n.createdAt):!1,y=n&&n.createdAt?Rs(n.createdAt):"";return C.createElement(e,{className:Y("member text-medium",c,o),...a,children:d.jsxs(_n,{href:g,gtmType:s,gtmContext:i,onClick:x=>{x==null||x.stopPropagation()},children:[d.jsx(sn,{name:p,src:m,alt:l}),d.jsxs("p",{className:"details",children:[d.jsxs("strong",{children:[p,n&&d.jsxs("span",{className:"additional-content",children:[n.createdAt&&b&&d.jsx("span",{className:"date",title:y,"aria-label":y,children:u.formatMessage({id:`dates_${b.path}`},{number:b.number})}),n.didEdit&&d.jsx("em",{children:u.formatMessage({id:"discussion_edited"})})]})]}),f&&d.jsx("small",{className:Y({"text-medium":c==="large"}),children:f})]})]})})};const Uo={small:24,medium:48},zs=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:a,showGap:i,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...c})=>{const h=ue.useIntl();return!n||n.length===0?null:C.createElement(e,{...c,className:Y("contributors",u,a,{"has-gap":i}),children:d.jsxs(d.Fragment,{children:[d.jsx("ul",{children:n.map((p,m)=>{let g,f="";if(m<o){const{name:b="",image:y=""}=Ls(p);if(s)return d.jsx(wt,{element:"li",className:"contributor"},m);g=d.jsx(sn,{name:b,src:y,width:Uo[a||"medium"],height:Uo[a||"medium"]})}else if(m===o){const b=(t||n.length)-o;g=d.jsxs("small",{className:Y({"large-number":b>99}),children:["+",Ih(b,0)]}),f="number-left"}return g?d.jsx("li",{className:Y("contributor",f),children:g},m):null})}),r&&d.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?h.formatMessage({id:`member_${n[0]}`}):Hn(n[0].name||"",20):l||null})]})})};const qs=({limit:e,valueLength:t})=>{const n=ue.useIntl(),r="form_fieldWrapper_characterLimit";if(e===0)return null;const a=e-t,i=Math.abs(t-e);return d.jsxs("small",{className:Y("character-limit",{"near-limit":t>=.99*e,"approaching-limit":t>=.9*e&&t<.99*e}),"aria-live":"polite","aria-label":n.formatMessage({id:`${r}_aria_${a<0?"over":"default"}`},{remaining:a,over:i,limit:e}),children:[d.jsx("span",{className:"hidden",children:n.formatMessage({id:r})}),t," / ",e]})},Wa=e=>(e==null?void 0:e.toString().length)||0,Uc=(e,t=null)=>{const n={};return e===0||(n["data-character-limit"]=e,t&&(n.functions={onChange:r=>{Wa(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t(r)}})),n};const qr="emailHelperTextBox_",Vc=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const a=ue.useIntl(),[i,s]=C.useState({path:`${qr}default`,type:"default",link:{},mail:{},error:""}),[o,l]=C.useState(!1),u=C.useCallback(m=>{m.preventDefault(),m.stopPropagation();const g=f=>{s({path:`${qr}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:b=>u(b),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:f})};if(typeof r!="function"){g(a.formatMessage({id:`${qr}error_noFunction`}));return}l(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(f=>{g(f.message)}).finally(()=>{l(!1)})},[t,n,r]);C.useEffect(()=>{let m=qr,g="default",f={},b={};switch(e){case"gov":m+="autoApproved",g="success";break;case"nonGov":m+="unrecognisedEmail",g="error",f={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":m+="pendingApproval",g="error",b={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":m+="emailUnverified",g="error",f={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:y=>u(y),"data-testid":"send-verify-email-click"};break;case"exists":m+="emailAlreadyExists",g="error",f={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},b={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:m+="default",f={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}s({...i,path:m,type:g,link:f,mail:b})},[e]);const c={};return["link","mail"].forEach(m=>{c[m]=Object.keys(i[m]).length?g=>d.jsx("a",{...i[m],children:g}):g=>g}),d.jsx(Lc,{type:i.type,heading:o?!1:a.formatMessage({id:`${i.path}_title`}),children:o?d.jsxs(d.Fragment,{children:[d.jsx(wt,{element:"span"}),d.jsx(wt,{element:"span"})]}):a.formatMessage({id:`${i.path}_text`},{...c,strong:m=>d.jsx("strong",{children:m}),em:m=>d.jsx("em",{children:m}),br:d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("br",{})]}),error:i.error})})},Rn=({className:e="",element:t="input",id:n,inputRef:r,functions:a={onChange:()=>{}},name:i=n,placeholder:s,type:o="text",value:l,...u})=>{const c=C.useRef(),h=r||c;return C.createElement(t,{ref:h,...u,type:o,id:n,name:i,className:Y(e,t,{"has-scrollbar":o==="textarea"&&h.current&&h.current.clientHeight<h.current.scrollHeight}),value:l,placeholder:s,...a,onChange:p=>{const m=p.target;a.onChange(m.value)}})};const Tn={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},lm=500,cm=({id:e,name:t=e,value:n,placeholder:r,functions:a={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...i})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=a,[{input:l,displayInput:u,debouncedInput:c},h]=C.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:p,activePredictionIndex:m,isPredictionSelected:g},f]=C.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:b}=ue.useIntl();r||(r=b({id:"inputAutocomplete_placeholder"})),C.useEffect(()=>{const k=setTimeout(()=>{g||h(w=>({...w,debouncedInput:l}))},lm);return()=>{clearTimeout(k)}},[l,g]),C.useEffect(()=>{c&&!g?(async()=>{try{const w=await o(c)||[];f(F=>({...F,predictions:w}))}catch(w){console.error("Error fetching predictions:",w),f(F=>({...F,predictions:[]}))}})():f(k=>({...k,predictions:[]}))},[c,g]),C.useEffect(()=>{m>=0&&p[m]&&h(k=>({...k,displayInput:p[m].description}))},[m,p]);const y=k=>{[Tn.DOWN,Tn.UP,Tn.ENTER].includes(k.key)&&(k.preventDefault(),k.key===Tn.DOWN&&m<p.length-1?f(w=>({...w,activePredictionIndex:m+1})):k.key===Tn.UP&&m>0?f(w=>({...w,activePredictionIndex:m-1})):k.key===Tn.ENTER&&m>-1&&(s(p[m].description),h(w=>({...w,input:p[m].description})),f(w=>({...w,predictions:[],isPredictionSelected:!0}))))},x=k=>{s(k.target.value),h(w=>({...w,input:k.target.value,displayInput:k.target.value})),f(w=>({...w,activePredictionIndex:-1,isPredictionSelected:!1}))},A=k=>{s(k.description),h(w=>({...w,input:k.description,displayInput:k.description})),f(w=>({...w,isPredictionSelected:!0,predictions:[]}))};return d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:u,onChange:x,onKeyDown:y,placeholder:r,name:t,id:e,...i}),d.jsx("ul",{className:"predictions-list",children:p.map((k,w)=>d.jsx("li",{onClick:()=>A(k),onMouseEnter:()=>f(F=>({...F,activePredictionIndex:w})),className:Y("predictions-list-item",{active:w===m}),children:k.description},w))})]})};const Kc=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:a,inputRef:i,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:c,...h})=>{const p=ue.useIntl(),{onChange:m,...g}=r,f=()=>{t||m(c?null:l)},b=d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:i,id:a,name:a,type:u,value:l,checked:c,onKeyDown:y=>{(y.key==="Enter"||y.code==="Space")&&(y.preventDefault(),y.stopPropagation(),f())},readOnly:!0,disabled:t}),d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("label",{htmlFor:a,children:o||p.formatMessage({id:s?`${s}_${a}`:a})})]});return C.createElement(n,{onClick:y=>{const x=y.target;x.nodeName.toLowerCase()==="a"||x.parentNode&&x.parentNode.nodeName.toLowerCase()==="a"||(y.preventDefault(),y.stopPropagation(),f())},className:Y("checkbox-wrapper",e),...h,...g},b)};const dm=C.memo(function({direction:t="down"}){return d.jsx(La,{className:Y("rotating-chevron",`direction-${t}`)})});const fm=({className:e,options:t,initialValue:n,value:r,functions:a={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:i}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const c=ue.useIntl(),[h,p]=C.useState(!1),m=r||n,g=Array.isArray(m)?[...m]:m?[m]:[],[f,b]=C.useState(g);let y;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?y=t&&f?t.find(S=>S.id===f[0]):t?t[0]:{id:"",label:""}:Array.isArray(f)&&f.length===1&&typeof f[0]!="string"?y=f[0]:y={id:"",label:""},C.useEffect(()=>{b(g)},[r,n]);const{onChange:x,onMultiSelectSubmit:A,...k}=a,w=S=>{if(o){let z=[];f!=null&&f.includes(S.id)?z=f.filter(N=>N!==S.id):z=[...f,S.id],b([...z]),x&&x([...z])}else b([S]),x&&x(S.id),p(!1)},F=S=>{if(S==="all"){const z=(t==null?void 0:t.map(N=>N.id))||[];b(z),x&&x(z)}else b([]),x&&x([])};return d.jsxs("div",{className:Y("dropdown-wrapper",e),children:[d.jsxs("button",{className:"input","aria-expanded":h,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:S=>{S.preventDefault(),S.stopPropagation(),p(!h)},"data-testid":"dropdown-selector",...k,children:[o?`${s} · ${f.length}`:y.label,d.jsx(dm,{direction:h?"up":"down"})]}),d.jsx("select",{defaultValue:y.id,onChange:S=>{S.preventDefault(),S.stopPropagation();const z=t&&t.find(N=>N.id===S.target.value);w(z)},hidden:!h,...k,children:t==null?void 0:t.map(S=>d.jsx("option",{value:S.id,children:S.label},S.id))}),d.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!h,children:[d.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&d.jsxs("div",{className:"action-bar",children:[d.jsx("p",{children:`${f==null?void 0:f.length} selected`}),d.jsxs("ul",{children:[d.jsx("li",{children:d.jsx(_e,{variant:"tertiary",size:"small",onClick:()=>F("all"),className:"gtm-trackable",children:c.formatMessage({id:"dropdown_menu_multiselect_all"})})}),d.jsx("li",{children:d.jsx(_e,{variant:"tertiary",size:"small",onClick:()=>F("none"),className:"gtm-trackable",children:c.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),d.jsx("ul",{children:t==null?void 0:t.map(S=>{const z=S.id===y.id||(f==null?void 0:f.includes(S))||(f==null?void 0:f.includes(S.id));return d.jsx("li",{"data-testid":"dropdown-options",children:d.jsxs("button",{className:Y("gtm-trackable",{selected:z,"selected-single":z&&!o}),"data-gtm-event-type":`${S}-click`,"data-gtm-event-context":i,onClick:N=>{N.preventDefault(),N.stopPropagation(),w(S)},role:"menuitem","aria-current":z,"data-testid":z?"current-selection":"",children:[o&&d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("span",{className:Y({"menu-option-label":o}),children:S.label})]})},S.id)})})]}),(l==null?void 0:l.submitSection)&&d.jsx("p",{className:"submit",children:d.jsx(_e,{variant:"secondary",onClick:()=>{A&&A(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),p(!1)},children:c.formatMessage({id:"form_submit"})})})]})]})};const hm=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:a,multiSelect:i=!1,name:s,options:o,required:l,type:u="checkboxes",value:c,...h})=>{const p=ue.useIntl(),m=i?c:[],g=c;return d.jsx("ul",{...h,className:Y("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:f,label:b=!1,value:y=f,disabled:x=!1})=>{const A=`${r}_${f}`,k=()=>{if(x)return;let w;if(i){const F=m==null?void 0:m.indexOf(y);Array.isArray(m)&&F>=0?(w=m,w.splice(F,1)):(!m||m.length===0?w=[]:w=m,w.push(y))}else w=g===y?void 0:y;t.onChange(w)};return d.jsx(Kc,{element:"li",id:A,type:u==="checkboxes"?"checkbox":"radio",shownValue:y,value:i?m==null?void 0:m.includes(y):g===y,functions:{...t,onChange:k},intlPath:n,label:b||p.formatMessage({id:n?`${n}_${f}`:f}),disabled:x},A)})})};const mm=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},...r})=>{const a=ue.useIntl(),i=C.useRef(),s=e||i,[o,l]=C.useState(!1),[u,c]=C.useState(t),h=()=>{var p;l(!o),c(o?"password":"text"),(p=s.current)==null||p.focus()};return d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:Y("show-password gtm-trackable",{"password-visible":o}),"data-gtm-event-context":n,"data-gtm-event-type":`${o?"hide":"show"}-password-click`,onClick:h,"aria-label":a.formatMessage({id:`showpassword_aria_${o?"hide":"show"}`}),children:a.formatMessage({id:`showpassword_${o?"hide":"show"}`})}),d.jsx(Rn,{inputRef:s,type:u,...r})]})};const Sn={text:{component:Rn},email:{component:Rn},url:{component:Rn},textarea:{component:Rn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Kc},checkboxes:{component:hm,props:{multiSelect:!0}},select:{component:fm},password:{component:mm},autocomplete:{component:cm}},pm=({id:e,intlPath:t=!1,className:n="",error:r,functions:a={onChange:()=>{}},limit:i=0,showRequiredLabels:s=!0,type:o,validation:l,value:u,submitOnEnter:c,...h})=>{const p=ue.useIntl(),m=l&&l.some(({condition:w})=>w==="required"),g=Wa(u),f=o&&Sn[o]&&Sn[o].component?Sn[o].component:Rn,b={};o&&["checkboxes"].includes(o)?b.element="span":b.htmlFor=e;let y={...h,id:e,name:e,className:r?"error":"",type:o,required:m,"aria-required":m,functions:pn(a),value:u};if(i>0){const w=Uc(i,a.onChange);y={...y,...w},w.functions&&typeof w.functions=="object"&&(y.functions={...y.functions,...w.functions})}o&&Sn[o]&&Sn[o].props&&(y={...y,...Sn[o].props}),o&&["checkboxes"].includes(o)&&(y.intlPath=`${t}_${e}`),r&&(y["aria-invalid"]=!0,y["aria-describedby"]=`error-${e}`);const x=h.label||p.formatMessage({id:t?`${t}_${e}`:e}),A=({...w})=>r?C.createElement(w.as||"dd",{id:`error-${e}`,className:"error text-small",role:"alert","aria-live":"assertive",...w},r):null;if(o&&["checkbox"].includes(o))return d.jsxs(d.Fragment,{children:[d.jsx(f,{...y,label:x,className:Y("field-wrapper",n)}),d.jsx(A,{as:"p"})]});const k=w=>C.createElement(w.element||"label",{...w,className:"checkboxes-label text-small","data-testid":`label-${e}`});return d.jsxs("dl",{className:Y("field-wrapper text-medium",n),children:[d.jsx("dt",{children:d.jsxs(k,{...b,children:[x,m&&s&&d.jsxs(d.Fragment,{children:[" ",d.jsxs("small",{children:["(",p.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})}),d.jsxs("dd",{children:[d.jsx(f,{...y}),d.jsx(qs,{limit:i,valueLength:g})]}),d.jsx(A,{})]})},gm=(e,t)=>{const{type:n,payload:r}=t,a=e.errors?pn(e.errors):{},i=e.values?pn(e.values):{};switch(n){case"toggleSubmitting":return{...e,isSubmitting:!e.isSubmitting};case"updateValue":if(r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:a,[r==null?void 0:r.key]:r==null?void 0:r.value};i[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:a,values:i};case"addError":return r!=null&&r.key&&!a[r==null?void 0:r.key]&&(a[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:a};case"removeError":return r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],{...e,errors:a};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:c}=r,h=pn(Object.keys(a));for(const p of s)if(p.validation)for(let m=0;m<p.validation.length;m++){const{condition:g="required",error:f=!1}=p.validation[m];let b=!1;if(typeof g=="function"){const y=g(i);y&&(b=f||y)}else{const y=i[p.id];switch(g){case"required":(!y||typeof y=="string"&&y.trim().length===0)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_required"})));break;case"no-numbers":{y&&!/^([^0-9]*)$/.test(y)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{y&&!/^(([^<>()[\]\\.,;:\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(y)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_email"})));break}case"valid-url":{y&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(y)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:p.id,value:b}}),h.push(p.id);break}}return h.length===0?l(i):u(i,h),{...e,isSubmitting:!1}}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let oi=null;const nr=({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,gtm:u={context:"Form",event:"form-submit-click"},functions:{onSuccess:c=async()=>{},onCancel:h=()=>{},onCatch:p=()=>{},onFailure:m=()=>{}}={onSuccess:async()=>{},onCancel:()=>{},onCatch:()=>{},onFailure:()=>{}},...g})=>{const{customOnSubmit:f,hideButton:b,...y}=s,x=40,{shouldShowCancelButton:A=!1,shouldReset:k=!0,showRequiredLabels:w=!0,showSuccessMessage:F=!1}=l||{},S=ue.useIntl(),z={};t.length&&t.forEach(D=>{const H=D.id||D.name;H&&(z[H]=D.value||"")});const[N,$]=C.useReducer(gm,{isSubmitting:!1,formSubmitted:!1,errors:{},values:z}),{errors:I,isSubmitting:E,formSubmitted:B,values:T}=N;C.useEffect(()=>{k&&B&&(oi=setTimeout(()=>{$({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[B]),C.useEffect(()=>()=>{oi&&clearTimeout(oi)},[]),C.useEffect(()=>{const D=H=>{$({type:"updateValue",payload:{key:H.detail.id,value:H.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",D),()=>{document.removeEventListener("dropdownMultiSelectSubmit",D)}},[]);const M=C.useRef(null),R=a||M;if(!t.length)return null;s.text||(s.text=S.formatMessage({id:"form_submit"}));const W=()=>{if(!E){if($({type:"toggleSubmitting"}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&$({type:"submitForm",payload:{fields:t,dispatch:$,intl:S}});return}$({type:"submitForm",payload:{fields:t,dispatch:$,onSuccess:async D=>{try{await c(D),$({type:k?"formSubmittedAndReset":"formSubmitted"})}catch(H){p(H),$({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(D,H)=>{m(D,H),$({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:S}})}},G=[{...y,icon:B?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:D=>{var _;if(D.preventDefault(),D.stopPropagation(),E)return;let H=0;if((_=R==null?void 0:R.current)!=null&&_.id){const j=document.getElementById(R.current.id);j&&(H=j.getBoundingClientRect().top+window.scrollY)}const te=document.getElementById("header");te&&(H=H-te.offsetHeight-x),H<0&&(H=0),window.scrollTo({top:H,behavior:"smooth"}),W()},disabled:E||B||s.disabled,"data-gtm-event-context":u.context,"data-gtm-event-type":u.event,children:E||B?S.formatMessage({id:`form_${E?"submitting":"submitted"}`}):s.text}];return A&&G.unshift({...o,className:"gtm-trackable","data-gtm-event-context":u.context,"data-gtm-event-type":u.event,disabled:E||B,onClick:h,children:o.text||S.formatMessage({id:"form_cancel"})}),d.jsxs(d.Fragment,{children:[C.createElement(e,{...g,id:r,className:Y("form",n),ref:R},d.jsxs(d.Fragment,{children:[I!=null&&I.general?d.jsx(an,{variant:"error",text:S.formatMessage({id:"form_error_generalError"})}):null,(!k||!E&&!B||f)&&t.map((D,H)=>{const{id:te=D.name||H,component:_,functions:j={onChange:()=>{}},submitOnEnter:q=!1}=D;if(_)return d.jsx(_,{...D.props||{}},`component-${te}-${H}`);const L=T?T[te]:"",U={...j,onChange:ne=>{$({type:"updateValue",payload:{key:te,value:ne}}),j.onChange(ne&&ne.toString(),$)}};return q&&(U.onKeyDown=ne=>{ne.key==="Enter"&&(ne.stopPropagation(),ne.preventDefault(),W()),j.onKeyDown&&j.onKeyDown(ne)}),d.jsx(pm,{intlPath:i,...D,showRequiredLabels:w,value:L,error:I==null?void 0:I[te],functions:U},te)}),b?null:(E||B)&&f?f:d.jsx(kn,{className:Y("cta",{center:E||B,submitted:B}),buttons:G})]})),F&&B&&d.jsx(kr,{className:"success",children:typeof F=="string"?F:S.formatMessage({id:"form_success"})})]})};const Wr="passwordRules_",Zc="isMoreThanEightCharacters",Yc="includesNumberAndSymbol",Gc="includesLowerAndUppercase",vm={[Zc]:"8Characters",[Yc]:"numberSymbol",[Gc]:"lowercaseUppercase"},bm=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ue.useIntl();return d.jsxs("aside",{className:Y("password-rules",t),children:[d.jsx("small",{children:n.formatMessage({id:`${Wr}intro`})}),d.jsx("ul",{children:[Zc,Yc,Gc].map(r=>d.jsxs("li",{className:Y({matches:e[r]}),children:[d.jsxs(Me,{children:[n.formatMessage({id:`${Wr}rule_label`})," "]}),d.jsx("span",{children:n.formatMessage({id:`${Wr}rule_${vm[r]}`})}),!e[r]&&d.jsxs(Me,{element:"strong",children:[" ",n.formatMessage({id:`${Wr}notMet`})]})]},`rule-${r}`))})]})},Qc=C.memo(bm);const ym=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:a=()=>{}},className:i="",hasLoaded:s=!1})=>{const o=ue.useIntl(),[l,u]=C.useState({setUp:!1,id:null,rating:null,disabled:!0}),c=async()=>{try{const y=await n();u(x=>({...x,setUp:!0,id:y&&y.id,disabled:!1}))}catch(y){u(x=>({...x,setUp:!0,disabled:!0})),a(y)}};if(C.useEffect(()=>{s&&!l.setUp&&c()},[s]),!s)return d.jsx(wt,{className:"rating-placeholder"});const{id:h,rating:p,disabled:m}=l,g="ratings_",f={text:o.formatMessage({id:`${g}text`}),low:o.formatMessage({id:`${g}low`}),high:o.formatMessage({id:`${g}high`}),success:o.formatMessage({id:`${g}success`}),...e},b=async y=>{if(!(!h||m))try{u(x=>({...x,rating:y,disabled:!0})),await r({id:h,value:y})}catch(x){u(A=>({...A,rating:null})),a(x)}finally{u(x=>({...x,disabled:!1}))}};return d.jsxs("div",{className:Y("rating",i),children:[d.jsx("span",{className:"label",children:f[p?"success":"text"]}),d.jsx("ol",{children:Array.from(new Array(t).keys()).map(y=>{const x=y+1;return d.jsx("li",{className:Y({selected:p&&x<=p}),children:d.jsx(_e,{variant:"tertiary",size:"small",icon:{icon:`star${!p||x>p?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:x,total:t})}${x===1||x===t?` - ${f[x===1?"low":"high"]}`:""}`,onClick:A=>{A.preventDefault(),A.stopPropagation(),b(x)},disabled:m})},`rating-${x}`)})})]})};function Dm(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 us(e,t){return Array(t+1).join(e)}function Cm(e){return e.replace(/^\n*/,"")}function xm(e){for(var t=e.length;t>0&&e[t-1]===`
38
38
  `;)t--;return e.substring(0,t)}var wm=["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 Ws(e){return Hs(e,wm)}var Jc=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Xc(e){return Hs(e,Jc)}function Em(e){return td(e,Jc)}var ed=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function km(e){return Hs(e,ed)}function _m(e){return td(e,ed)}function Hs(e,t){return t.indexOf(e.nodeName)>=0}function td(e,t){return e.getElementsByTagName&&t.some(function(n){return e.getElementsByTagName(n).length})}var nt={};nt.paragraph={filter:"p",replacement:function(e){return`
39
39
 
40
40
  `+e+`
@@ -76,13 +76,13 @@ Thank you for helping to protect the Apolitical community from abusive content.`
76
76
 
77
77
  `+n.hr+`
78
78
 
79
- `}};nt.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),r=ba(t.getAttribute("title"));return r&&(r=' "'+r+'"'),"["+e+"]("+n+r+")"}};nt.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,n){var r=t.getAttribute("href"),a=ba(t.getAttribute("title"));a&&(a=' "'+a+'"');var i,s;switch(n.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+r+a;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+r+a;break;default:var o=this.references.length+1;i="["+e+"]["+o+"]",s="["+o+"]: "+r+a}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=`
79
+ `}};nt.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),r=ya(t.getAttribute("title"));return r&&(r=' "'+r+'"'),"["+e+"]("+n+r+")"}};nt.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,n){var r=t.getAttribute("href"),a=ya(t.getAttribute("title"));a&&(a=' "'+a+'"');var i,s;switch(n.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+r+a;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+r+a;break;default:var o=this.references.length+1;i="["+e+"]["+o+"]",s="["+o+"]: "+r+a}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=`
80
80
 
81
81
  `+this.references.join(`
82
82
  `)+`
83
83
 
84
- `,this.references=[]),t}};nt.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}};nt.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}};nt.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];r.indexOf(n)!==-1;)n=n+"`";return n+t+e+t+n}};nt.image={filter:"img",replacement:function(e,t){var n=ba(t.getAttribute("alt")),r=t.getAttribute("src")||"",a=ba(t.getAttribute("title")),i=a?' "'+a+'"':"";return r?"!["+n+"]("+r+i+")":""}};function ba(e){return e?e.replace(/(\n+\s*)+/g,`
85
- `):""}function nd(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}nd.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=oi(this.array,e,this.options))||(t=oi(this._keep,e,this.options))||(t=oi(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};function oi(e,t,n){for(var r=0;r<e.length;r++){var a=e[r];if(Bm(a,t,n))return a}}function Bm(e,t,n){var r=e.filter;if(typeof r=="string"){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof r=="function"){if(r.call(e,t,n))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Am(e){var t=e.element,n=e.isBlock,r=e.isVoid,a=e.isPre||function(h){return h.nodeName==="PRE"};if(!(!t.firstChild||a(t))){for(var i=null,s=!1,o=null,l=Vo(o,t,a);l!==t;){if(l.nodeType===3||l.nodeType===4){var u=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&u[0]===" "&&(u=u.substr(1)),!u){l=ui(l);continue}l.data=u,i=l}else if(l.nodeType===1)n(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):r(l)||a(l)?(i=null,s=!0):i&&(s=!1);else{l=ui(l);continue}var c=Vo(o,l,a);o=l,l=c}i&&(i.data=i.data.replace(/ $/,""),i.data||ui(i))}}function ui(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Vo(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var Us=typeof window<"u"?window:{};function Fm(){var e=Us.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function Tm(){var e=function(){};return Sm()?e.prototype.parseFromString=function(t){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(t),n.close(),n}:e.prototype.parseFromString=function(t){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(t),n.close(),n},e}function Sm(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{Us.ActiveXObject&&(e=!0)}return e}var jm=Fm()?Us.DOMParser:Tm();function Om(e,t){var n;if(typeof e=="string"){var r=Pm().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");n=r.getElementById("turndown-root")}else n=e.cloneNode(!0);return Am({element:n,isBlock:Ws,isVoid:Xc,isPre:t.preformattedCode?Nm:null}),n}var li;function Pm(){return li=li||new jm,li}function Nm(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Rm(e,t){return e.isBlock=Ws(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Mm(e),e.flankingWhitespace=Im(e,t),e}function Mm(e){return!Xc(e)&&!km(e)&&/^\s*$/i.test(e.textContent)&&!Em(e)&&!_m(e)}function Im(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=$m(e.textContent);return n.leadingAscii&&Ko("left",e,t)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&Ko("right",e,t)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}function $m(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function Ko(e,t,n){var r,a,i;return e==="left"?(r=t.previousSibling,a=/ $/):(r=t.nextSibling,a=/^ /),r&&(r.nodeType===3?i=a.test(r.nodeValue):n.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!Ws(r)&&(i=a.test(r.textContent))),i}var Lm=Array.prototype.reduce,zm=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function ya(e){if(!(this instanceof ya))return new ya(e);var t={rules:nt,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(n,r){return r.isBlock?`
84
+ `,this.references=[]),t}};nt.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}};nt.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}};nt.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];r.indexOf(n)!==-1;)n=n+"`";return n+t+e+t+n}};nt.image={filter:"img",replacement:function(e,t){var n=ya(t.getAttribute("alt")),r=t.getAttribute("src")||"",a=ya(t.getAttribute("title")),i=a?' "'+a+'"':"";return r?"!["+n+"]("+r+i+")":""}};function ya(e){return e?e.replace(/(\n+\s*)+/g,`
85
+ `):""}function nd(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}nd.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=ui(this.array,e,this.options))||(t=ui(this._keep,e,this.options))||(t=ui(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};function ui(e,t,n){for(var r=0;r<e.length;r++){var a=e[r];if(Bm(a,t,n))return a}}function Bm(e,t,n){var r=e.filter;if(typeof r=="string"){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof r=="function"){if(r.call(e,t,n))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Am(e){var t=e.element,n=e.isBlock,r=e.isVoid,a=e.isPre||function(h){return h.nodeName==="PRE"};if(!(!t.firstChild||a(t))){for(var i=null,s=!1,o=null,l=Vo(o,t,a);l!==t;){if(l.nodeType===3||l.nodeType===4){var u=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&u[0]===" "&&(u=u.substr(1)),!u){l=li(l);continue}l.data=u,i=l}else if(l.nodeType===1)n(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):r(l)||a(l)?(i=null,s=!0):i&&(s=!1);else{l=li(l);continue}var c=Vo(o,l,a);o=l,l=c}i&&(i.data=i.data.replace(/ $/,""),i.data||li(i))}}function li(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Vo(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var Us=typeof window<"u"?window:{};function Fm(){var e=Us.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function Tm(){var e=function(){};return Sm()?e.prototype.parseFromString=function(t){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(t),n.close(),n}:e.prototype.parseFromString=function(t){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(t),n.close(),n},e}function Sm(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{Us.ActiveXObject&&(e=!0)}return e}var jm=Fm()?Us.DOMParser:Tm();function Om(e,t){var n;if(typeof e=="string"){var r=Pm().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");n=r.getElementById("turndown-root")}else n=e.cloneNode(!0);return Am({element:n,isBlock:Ws,isVoid:Xc,isPre:t.preformattedCode?Nm:null}),n}var ci;function Pm(){return ci=ci||new jm,ci}function Nm(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Rm(e,t){return e.isBlock=Ws(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Mm(e),e.flankingWhitespace=Im(e,t),e}function Mm(e){return!Xc(e)&&!km(e)&&/^\s*$/i.test(e.textContent)&&!Em(e)&&!_m(e)}function Im(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=$m(e.textContent);return n.leadingAscii&&Ko("left",e,t)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&Ko("right",e,t)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}function $m(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function Ko(e,t,n){var r,a,i;return e==="left"?(r=t.previousSibling,a=/ $/):(r=t.nextSibling,a=/^ /),r&&(r.nodeType===3?i=a.test(r.nodeValue):n.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!Ws(r)&&(i=a.test(r.textContent))),i}var Lm=Array.prototype.reduce,zm=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Da(e){if(!(this instanceof Da))return new Da(e);var t={rules:nt,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(n,r){return r.isBlock?`
86
86
 
87
87
  `:""},keepReplacement:function(n,r){return r.isBlock?`
88
88
 
@@ -92,26 +92,26 @@ Thank you for helping to protect the Apolitical community from abusive content.`
92
92
 
93
93
  `+n+`
94
94
 
95
- `:n}};this.options=Dm({},t,e),this.rules=new nd(this.options)}ya.prototype={turndown:function(e){if(!Hm(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=rd.call(this,new Om(e,this.options));return qm.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return zm.reduce(function(t,n){return t.replace(n[0],n[1])},e)}};function rd(e){var t=this;return Lm.call(e.childNodes,function(n,r){r=new Rm(r,t.options);var a="";return r.nodeType===3?a=r.isCode?r.nodeValue:t.escape(r.nodeValue):r.nodeType===1&&(a=Wm.call(t,r)),ad(n,a)},"")}function qm(e){var t=this;return this.rules.forEach(function(n){typeof n.append=="function"&&(e=ad(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Wm(e){var t=this.rules.forNode(e),n=rd.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function ad(e,t){var n=xm(e),r=Cm(t),a=Math.max(e.length-n.length,t.length-r.length),i=`
95
+ `:n}};this.options=Dm({},t,e),this.rules=new nd(this.options)}Da.prototype={turndown:function(e){if(!Hm(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=rd.call(this,new Om(e,this.options));return qm.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return zm.reduce(function(t,n){return t.replace(n[0],n[1])},e)}};function rd(e){var t=this;return Lm.call(e.childNodes,function(n,r){r=new Rm(r,t.options);var a="";return r.nodeType===3?a=r.isCode?r.nodeValue:t.escape(r.nodeValue):r.nodeType===1&&(a=Wm.call(t,r)),ad(n,a)},"")}function qm(e){var t=this;return this.rules.forEach(function(n){typeof n.append=="function"&&(e=ad(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Wm(e){var t=this.rules.forNode(e),n=rd.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function ad(e,t){var n=xm(e),r=Cm(t),a=Math.max(e.length-n.length,t.length-r.length),i=`
96
96
 
97
97
  `.substring(0,a);return n+i+r}function Hm(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}/*!
98
98
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
99
99
  *
100
100
  * Copyright (c) 2014-2017, Jon Schlinkert.
101
101
  * Released under the MIT License.
102
- */function Zo(e){return Object.prototype.toString.call(e)==="[object Object]"}function et(e){var t,n;return Zo(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(Zo(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var id=Symbol.for("immer-nothing"),Yo=Symbol.for("immer-draftable"),gt=Symbol.for("immer-state"),Um=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function dt(e,...t){if(process.env.NODE_ENV!=="production"){const n=Um[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 Kn=Object.getPrototypeOf;function yn(e){return!!e&&!!e[gt]}function Dn(e){var t;return e?sd(e)||Array.isArray(e)||!!e[Yo]||!!((t=e.constructor)!=null&&t[Yo])||Ha(e)||Ua(e):!1}var Vm=Object.prototype.constructor.toString();function sd(e){if(!e||typeof e!="object")return!1;const t=Kn(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)===Vm}function Da(e,t){Wa(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Wa(e){const t=e[gt];return t?t.type_:Array.isArray(e)?1:Ha(e)?2:Ua(e)?3:0}function ls(e,t){return Wa(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function od(e,t,n){const r=Wa(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Km(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ha(e){return e instanceof Map}function Ua(e){return e instanceof Set}function cn(e){return e.copy_||e.base_}function cs(e,t){if(Ha(e))return new Map(e);if(Ua(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&sd(e))return Kn(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[gt];let r=Reflect.ownKeys(n);for(let a=0;a<r.length;a++){const i=r[a],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Kn(e),n)}function Vs(e,t=!1){return Va(e)||yn(e)||!Dn(e)||(Wa(e)>1&&(e.set=e.add=e.clear=e.delete=Zm),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Vs(r,!0))),e}function Zm(){dt(2)}function Va(e){return Object.isFrozen(e)}var Ym={};function Cn(e){const t=Ym[e];return t||dt(0,e),t}var kr;function ud(){return kr}function Gm(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Go(e,t){t&&(Cn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ds(e){fs(e),e.drafts_.forEach(Qm),e.drafts_=null}function fs(e){e===kr&&(kr=e.parent_)}function Qo(e){return kr=Gm(kr,e)}function Qm(e){const t=e[gt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Jo(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[gt].modified_&&(ds(t),dt(4)),Dn(e)&&(e=Ca(t,e),t.parent_||xa(t,e)),t.patches_&&Cn("Patches").generateReplacementPatches_(n[gt].base_,e,t.patches_,t.inversePatches_)):e=Ca(t,n,[]),ds(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==id?e:void 0}function Ca(e,t,n){if(Va(t))return t;const r=t[gt];if(!r)return Da(t,(a,i)=>Xo(e,r,t,a,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return xa(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),Da(i,(o,l)=>Xo(e,r,a,o,l,n,s)),xa(e,a,!1),n&&e.patches_&&Cn("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Xo(e,t,n,r,a,i,s){if(process.env.NODE_ENV!=="production"&&a===n&&dt(5),yn(a)){const o=i&&t&&t.type_!==3&&!ls(t.assigned_,r)?i.concat(r):void 0,l=Ca(e,a,o);if(od(n,r,l),yn(l))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if(Dn(a)&&!Va(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ca(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&xa(e,a)}}function xa(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Vs(t,n)}function Jm(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ud(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=Ks;n&&(a=[r],i=_r);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return r.draft_=o,r.revoke_=s,o}var Ks={get(e,t){if(t===gt)return e;const n=cn(e);if(!ls(n,t))return Xm(e,n,t);const r=n[t];return e.finalized_||!Dn(r)?r:r===ci(e.base_,t)?(di(e),e.copy_[t]=ms(r,e)):r},has(e,t){return t in cn(e)},ownKeys(e){return Reflect.ownKeys(cn(e))},set(e,t,n){const r=ld(cn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=ci(cn(e),t),i=a==null?void 0:a[gt];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Km(n,a)&&(n!==void 0||ls(e.base_,t)))return!0;di(e),hs(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 ci(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,di(e),hs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=cn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){dt(11)},getPrototypeOf(e){return Kn(e.base_)},setPrototypeOf(){dt(12)}},_r={};Da(Ks,(e,t)=>{_r[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});_r.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&dt(13),_r.set.call(this,e,t,void 0)};_r.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&dt(14),Ks.set.call(this,e[0],t,n,e[0])};function ci(e,t){const n=e[gt];return(n?cn(n):e)[t]}function Xm(e,t,n){var a;const r=ld(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function ld(e,t){if(!(t in e))return;let n=Kn(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kn(n)}}function hs(e){e.modified_||(e.modified_=!0,e.parent_&&hs(e.parent_))}function di(e){e.copy_||(e.copy_=cs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ep=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...u){return s.produce(l,c=>n.call(this,c,...u))}}typeof n!="function"&&dt(6),r!==void 0&&typeof r!="function"&&dt(7);let a;if(Dn(t)){const i=Qo(this),s=ms(t,void 0);let o=!0;try{a=n(s),o=!1}finally{o?ds(i):fs(i)}return Go(i,r),Jo(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===id&&(a=void 0),this.autoFreeze_&&Vs(a,!0),r){const i=[],s=[];Cn("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else dt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...o)=>this.produceWithPatches(s,l=>t(l,...o));let r,a;return[this.produce(t,n,(s,o)=>{r=s,a=o}),r,a]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Dn(e)||dt(8),yn(e)&&(e=tp(e));const t=Qo(this),n=ms(e,void 0);return n[gt].isManual_=!0,fs(t),n}finishDraft(e,t){const n=e&&e[gt];(!n||!n.isManual_)&&dt(9);const{scope_:r}=n;return Go(r,t),Jo(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=Cn("Patches").applyPatches_;return yn(e)?r(e,t):this.produce(e,a=>r(a,t))}};function ms(e,t){const n=Ha(e)?Cn("MapSet").proxyMap_(e,t):Ua(e)?Cn("MapSet").proxySet_(e,t):Jm(e,t);return(t?t.scope_:ud()).drafts_.push(n),n}function tp(e){return yn(e)||dt(10,e),cd(e)}function cd(e){if(!Dn(e)||Va(e))return e;const t=e[gt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=cs(e,!0);return Da(n,(r,a)=>{od(n,r,cd(a))}),t&&(t.finalized_=!1),n}var vt=new ep,Zs=vt.produce;vt.produceWithPatches.bind(vt);vt.setAutoFreeze.bind(vt);vt.setUseStrictShallowCopy.bind(vt);vt.applyPatches.bind(vt);var eu=vt.createDraft.bind(vt),tu=vt.finishDraft.bind(vt),np={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()}}},rp={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=Ee.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},ap={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=V.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},wa=new WeakMap,Ea=new WeakMap,gr=new WeakMap,dd=new WeakMap,nu=new WeakMap,ru=new WeakMap,au=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:c}=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]>=c&&(r[u.length-1]+=1,r[u.length]-=c);break}case"move_node":{var{path:h,newPath:p}=t;if(N.equals(h,p))return r;if(N.isAncestor(h,r)||N.equals(h,r)){var m=p.slice();return N.endsBefore(h,p)&&h.length<p.length&&(m[h.length-1]-=1),m.concat(r.slice(h.length))}else N.isSibling(h,p)&&(N.isAncestor(p,r)||N.equals(p,r))?N.endsBefore(h,r)?r[h.length-1]-=1:r[h.length-1]+=1:N.endsBefore(p,r)||N.equals(p,r)||N.isAncestor(p,r)?(N.endsBefore(h,r)&&(r[h.length-1]-=1),r[p.length-1]+=1):N.endsBefore(h,r)&&(N.equals(p,r)&&(r[p.length-1]+=1),r[h.length-1]-=1);break}}return r}};function Br(e){"@babel/helpers - typeof";return Br=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},Br(e)}function ip(e,t){if(Br(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Br(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sp(e){var t=ip(e,"string");return Br(t)==="symbol"?t:String(t)}function ut(e,t,n){return t=sp(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function or(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var op=(e,t,n)=>{switch(n.type){case"insert_node":{var{path:r,node:a}=n,i=oe.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 V.points(t))t[l]=Ee.transform(o,n);break}case"insert_text":{var{path:u,offset:c,text:h}=n;if(h.length===0)break;var p=oe.leaf(e,u),m=p.text.slice(0,c),g=p.text.slice(c);if(p.text=m+h+g,t)for(var[f,D]of V.points(t))t[D]=Ee.transform(f,n);break}case"merge_node":{var{path:y}=n,x=oe.get(e,y),A=N.previous(y),_=oe.get(e,A),E=oe.parent(e,y),F=y[y.length-1];if(de.isText(x)&&de.isText(_))_.text+=x.text;else if(!de.isText(x)&&!de.isText(_))_.children.push(...x.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(y,"] to nodes of different interfaces: ").concat(Je.stringify(x)," ").concat(Je.stringify(_)));if(E.children.splice(F,1),t)for(var[T,I]of V.points(t))t[I]=Ee.transform(T,n);break}case"move_node":{var{path:R,newPath:M}=n;if(N.isAncestor(R,M))throw new Error("Cannot move a path [".concat(R,"] to new path [").concat(M,"] because the destination is inside itself."));var $=oe.get(e,R),w=oe.parent(e,R),k=R[R.length-1];w.children.splice(k,1);var O=N.transform(R,n),j=oe.get(e,N.parent(O)),z=O[O.length-1];if(j.children.splice(z,0,$),t)for(var[H,te]of V.points(t))t[te]=Ee.transform(H,n);break}case"remove_node":{var{path:J}=n,v=J[J.length-1],W=oe.parent(e,J);if(W.children.splice(v,1),t)for(var[ee,B]of V.points(t)){var S=Ee.transform(ee,n);if(t!=null&&S!=null)t[B]=S;else{var q=void 0,L=void 0;for(var[U,ne]of oe.texts(e))if(N.compare(ne,J)===-1)q=[U,ne];else{L=[U,ne];break}var re=!1;q&&L&&(N.equals(L[1],J)?re=!N.hasPrevious(L[1]):re=N.common(q[1],J).length<N.common(L[1],J).length),q&&!re?(ee.path=q[1],ee.offset=q[0].text.length):L?(ee.path=L[1],ee.offset=0):t=null}}break}case"remove_text":{var{path:ae,offset:fe,text:X}=n;if(X.length===0)break;var be=oe.leaf(e,ae),he=be.text.slice(0,fe),xe=be.text.slice(fe+X.length);if(be.text=he+xe,t)for(var[Ae,Fe]of V.points(t))t[Fe]=Ee.transform(Ae,n);break}case"set_node":{var{path:Ke,properties:We,newProperties:He}=n;if(Ke.length===0)throw new Error("Cannot set properties on the root node!");var Qe=oe.get(e,Ke);for(var me in He){if(me==="children"||me==="text")throw new Error('Cannot set the "'.concat(me,'" property of nodes!'));var Te=He[me];Te==null?delete Qe[me]:Qe[me]=Te}for(var $e in We)He.hasOwnProperty($e)||delete Qe[$e];break}case"set_selection":{var{newProperties:K}=n;if(K==null)t=K;else{if(t==null){if(!V.isRange(K))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Je.stringify(K)," when there is no current selection."));t=or({},K)}for(var se in K){var pe=K[se];if(pe==null){if(se==="anchor"||se==="focus")throw new Error('Cannot remove the "'.concat(se,'" selection property'));delete t[se]}else t[se]=pe}}break}case"split_node":{var{path:ge,position:we,properties:Ye}=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 Ge=oe.get(e,ge),mt=oe.parent(e,ge),Mt=ge[ge.length-1],Et;if(de.isText(Ge)){var Xe=Ge.text.slice(0,we),At=Ge.text.slice(we);Ge.text=Xe,Et=or(or({},Ye),{},{text:At})}else{var pt=Ge.children.slice(0,we),ei=Ge.children.slice(we);Ge.children=pt,Et=or(or({},Ye),{},{children:ei})}if(mt.children.splice(Mt+1,0,Et),t)for(var[ar,Ir]of V.points(t))t[Ir]=Ee.transform(ar,n);break}}return t},up={transform(e,t){e.children=eu(e.children);var n=e.selection&&eu(e.selection);try{n=op(e,n,t)}finally{e.children=tu(e.children),n?e.selection=yn(n)?tu(n):n:e.selection=null}}},lp={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)}},cp={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)}},fd=(e,t)=>{for(var n in e){var r=e[n],a=t[n];if(et(r)&&et(a)){if(!fd(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 dp(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 Ht(e,t){if(e==null)return{};var n=dp(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 fp=["anchor","focus"];function su(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 hp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?su(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):su(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var V={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:a}=e;return V.isBackward(e)===n?[r,a]:[a,r]},end(e){var[,t]=V.edges(e);return t},equals(e,t){return Ee.equals(e.anchor,t.anchor)&&Ee.equals(e.focus,t.focus)},includes(e,t){if(V.isRange(t)){if(V.includes(e,t.anchor)||V.includes(e,t.focus))return!0;var[n,r]=V.edges(e),[a,i]=V.edges(t);return Ee.isBefore(n,a)&&Ee.isAfter(r,i)}var[s,o]=V.edges(e),l=!1,u=!1;return Ee.isPoint(t)?(l=Ee.compare(t,s)>=0,u=Ee.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=Ht(e,fp),[r,a]=V.edges(e),[i,s]=V.edges(t),o=Ee.isBefore(r,i)?i:r,l=Ee.isBefore(a,s)?a:s;return Ee.isBefore(l,o)?null:hp({anchor:o,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return Ee.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Ee.equals(t,n)},isExpanded(e){return!V.isCollapsed(e)},isForward(e){return!V.isBackward(e)},isRange(e){return et(e)&&Ee.isPoint(e.anchor)&&Ee.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=V.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zs(e,r=>{if(r===null)return null;var{affinity:a="inward"}=n,i,s;if(a==="inward"){var o=V.isCollapsed(r);V.isForward(r)?(i="forward",s=o?i:"backward"):(i="backward",s=o?i:"forward")}else a==="outward"?V.isForward(r)?(i="backward",s="forward"):(i="forward",s="backward"):(i=a,s=a);var l=Ee.transform(r.anchor,t,{affinity:i}),u=Ee.transform(r.focus,t,{affinity:s});if(!l||!u)return null;r.anchor=l,r.focus=u})}},ou=e=>et(e)&&oe.isNodeList(e.children)&&!b.isEditor(e),ce={isAncestor(e){return et(e)&&oe.isNodeList(e.children)},isElement:ou,isElementList(e){return Array.isArray(e)&&e.every(t=>ce.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 ou(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},mp=["children"],pp=["text"],uu=new WeakMap,oe={ancestor(e,t){var n=oe.get(e,t);if(de.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Je.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=oe.ancestor(e,r),i=[a,r];yield i}}()},child(e,t){if(de.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Je.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Je.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=oe.ancestor(e,t),{children:i}=a,s=r?i.length-1:0;r?s>=0:s<i.length;){var o=oe.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=oe.get(e,r);return[a,r]},descendant(e,t){var n=oe.get(e,t);if(b.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Je.stringify(n)));return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of oe.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 oe.nodes(e,t))ce.isElement(n)&&(yield[n,r])}()},extractProps(e){if(ce.isAncestor(e)){var t=Ht(e,mp);return t}else{var t=Ht(e,pp);return t}},first(e,t){for(var n=t.slice(),r=oe.get(e,n);r&&!(de.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(de.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Je.stringify(e)));var n=Zs({children:e.children},r=>{var[a,i]=V.edges(t),s=oe.nodes(r,{reverse:!0,pass:p=>{var[,m]=p;return!V.includes(t,m)}});for(var[,o]of s){if(!V.includes(t,o)){var l=oe.parent(r,o),u=o[o.length-1];l.children.splice(u,1)}if(N.equals(o,i.path)){var c=oe.leaf(r,o);c.text=c.text.slice(0,i.offset)}if(N.equals(o,a.path)){var h=oe.leaf(r,o);h.text=h.text.slice(a.offset)}}b.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(de.isText(n)||!n.children[a])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Je.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(de.isText(n)||!n.children[a])return!1;n=n.children[a]}return!0},isNode(e){return de.isText(e)||ce.isElement(e)||b.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=uu.get(e);if(t!==void 0)return t;var n=e.every(r=>oe.isNode(r));return uu.set(e,n),n},last(e,t){for(var n=t.slice(),r=oe.get(e,n);r&&!(de.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=oe.get(e,t);if(!de.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Je.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=oe.get(e,r);yield[a,r]}}()},matches(e,t){return ce.isElement(e)&&ce.isElementProps(t)&&ce.matches(e,t)||de.isText(e)&&de.isTextProps(t)&&de.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)&&!de.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=oe.get(e,o);continue}if(o.length===0)break;if(!r){var c=N.next(o);if(oe.has(e,c)){o=c,l=oe.get(e,o);continue}}if(r&&o[o.length-1]!==0){var h=N.previous(o);o=h,l=oe.get(e,o);continue}o=N.parent(o),l=oe.get(e,o),s.add(l)}}()},parent(e,t){var n=N.parent(t),r=oe.get(e,n);if(de.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 de.isText(e)?e.text:e.children.map(oe.string).join("")},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of oe.nodes(e,t))de.isText(n)&&(yield[n,r])}()}};function lu(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 Le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Xt={isNodeOperation(e){return Xt.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!et(e))return!1;switch(e.type){case"insert_node":return N.isPath(e.path)&&oe.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)&&et(e.properties);case"move_node":return N.isPath(e.path)&&N.isPath(e.newPath);case"remove_node":return N.isPath(e.path)&&oe.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)&&et(e.properties)&&et(e.newProperties);case"set_selection":return e.properties===null&&V.isRange(e.newProperties)||e.newProperties===null&&V.isRange(e.properties)||et(e.properties)&&et(e.newProperties);case"split_node":return N.isPath(e.path)&&typeof e.position=="number"&&et(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>Xt.isOperation(t))},isSelectionOperation(e){return Xt.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return Xt.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return Le(Le({},e),{},{type:"remove_node"});case"insert_text":return Le(Le({},e),{},{type:"remove_text"});case"merge_node":return Le(Le({},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 Le(Le({},e),{},{path:t,newPath:n});var r=N.transform(n,e),a=N.transform(N.next(n),e);return Le(Le({},e),{},{path:r,newPath:a})}case"remove_node":return Le(Le({},e),{},{type:"insert_node"});case"remove_text":return Le(Le({},e),{},{type:"insert_text"});case"set_node":{var{properties:i,newProperties:s}=e;return Le(Le({},e),{},{properties:s,newProperties:i})}case"set_selection":{var{properties:o,newProperties:l}=e;return o==null?Le(Le({},e),{},{properties:l,newProperties:null}):l==null?Le(Le({},e),{},{properties:null,newProperties:o}):Le(Le({},e),{},{properties:l,newProperties:o})}case"split_node":return Le(Le({},e),{},{type:"merge_node",path:N.next(e.path)})}}},cu=new WeakMap,gp=e=>{var t=cu.get(e);if(t!==void 0)return t;if(!et(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||et(e.marks))&&(e.selection===null||V.isRange(e.selection))&&oe.isNodeList(e.children)&&Xt.isOperationList(e.operations);return cu.set(e,n),n},b={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 gp(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)}},vp={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(N.isPath)}};function du(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 fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?du(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ee={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 Ee.compare(e,t)===1},isBefore(e,t){return Ee.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&N.equals(e.path,t.path)},isPoint(e){return et(e)&&typeof e.offset=="number"&&N.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zs(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,fu(fu({},n),{},{affinity:"forward"})))}else r.path=N.transform(i,t,n);break}}})}},hu=void 0,Je={setScrubber(e){hu=e},stringify(e){return JSON.stringify(e,hu)}},bp=["text"],yp=["anchor","focus"];function mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var de={equals(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:r=!1}=n;function a(i){var s=Ht(i,bp);return s}return fd(r?a(e):e,r?a(t):t)},isText(e){return et(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>de.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=[$t({},e)];for(var r of t){var a=Ht(r,yp),[i,s]=V.edges(r),o=[],l=0,u=i.offset,c=s.offset;for(var h of n){var{length:p}=h.text,m=l;if(l+=p,u<=m&&l<=c){Object.assign(h,a),o.push(h);continue}if(u!==c&&(u===l||c===m)||u>l||c<m||c===m&&m!==0){o.push(h);continue}var g=h,f=void 0,D=void 0;if(c<l){var y=c-m;D=$t($t({},g),{},{text:g.text.slice(y)}),g=$t($t({},g),{},{text:g.text.slice(0,y)})}if(u>m){var x=u-m;f=$t($t({},g),{},{text:g.text.slice(0,x)}),g=$t($t({},g),{},{text:g.text.slice(x)})}Object.assign(g,a),f&&o.push(f),o.push(g),D&&o.push(D)}n=o}return n}},Ys=e=>e.selection?e.selection:e.children.length>0?b.end(e,[]):[0],rr=(e,t)=>{var[n]=b.node(e,t);return r=>r===n},Gs=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,a=n?kp(t):t,i=Ce.None,s=Ce.None,o=0,l=null,u=null;for(var c of a){var h=c.codePointAt(0);if(!h)break;var p=Mp(c,h);if([i,s]=r?[s,p]:[p,i],Mn(i,Ce.ZWJ)&&Mn(s,Ce.ExtPict)&&(r?l=pu(t.substring(0,o)):l=pu(t.substring(0,t.length-o)),!l)||Mn(i,Ce.RI)&&Mn(s,Ce.RI)&&(u!==null?u=!u:r?u=!0:u=qp(t.substring(0,t.length-o)),!u)||i!==Ce.None&&s!==Ce.None&&$p(i,s))break;o+=c.length}return o||1},Dp=/\s/,Cp=/[\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]/,xp=/['\u2018\u2019]/,wp=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,a=!1;t.length>0;){var i=Gs(t,n),[s,o]=Qs(t,i,n);if(Ep(s,o,n))a=!0,r+=i;else if(!a)r+=i;else break;t=o}return r},Qs=(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)]},Ep=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(Dp.test(t))return!1;if(xp.test(t)){var a=Gs(n,r),[i,s]=Qs(n,a,r);if(e(i,s,r))return!0}return!Cp.test(t)},kp=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var a=t.charAt(n-r);if(Bp(a.charCodeAt(0))){var i=t.charAt(n-r-1);if(_p(i.charCodeAt(0))){yield i+a,r++;continue}}yield a}},_p=e=>e>=55296&&e<=56319,Bp=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 Ap=/^(?:[\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])$/,Fp=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Tp=/^(?:[\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])$/,Sp=/^[\u1100-\u115F\uA960-\uA97C]$/,jp=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Op=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Pp=/^[\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]$/,Np=/^[\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]$/,Rp=/^(?:[\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])$/,Mp=(e,t)=>{var n=Ce.Any;return e.search(Ap)!==-1&&(n|=Ce.Extend),t===8205&&(n|=Ce.ZWJ),t>=127462&&t<=127487&&(n|=Ce.RI),e.search(Fp)!==-1&&(n|=Ce.Prepend),e.search(Tp)!==-1&&(n|=Ce.SpacingMark),e.search(Sp)!==-1&&(n|=Ce.L),e.search(jp)!==-1&&(n|=Ce.V),e.search(Op)!==-1&&(n|=Ce.T),e.search(Pp)!==-1&&(n|=Ce.LV),e.search(Np)!==-1&&(n|=Ce.LVT),e.search(Rp)!==-1&&(n|=Ce.ExtPict),n};function Mn(e,t){return(e&t)!==0}var Ip=[[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 $p(e,t){return Ip.findIndex(n=>Mn(e,n[0])&&Mn(t,n[1]))===-1}var Lp=/(?:[\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$/,pu=e=>e.search(Lp)!==-1,zp=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,qp=e=>{var t=e.match(zp);if(t===null)return!1;var n=t[0].length/2;return n%2===1},Wp={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]:{};b.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:a=Ys(e)}=n;if(N.isPath(a)&&(a=b.range(e,a)),V.isRange(a))if(V.isCollapsed(a))a=a.anchor;else{var i=V.end(a);if(!r&&b.void(e,{at:i}))return;var s=V.start(a),o=b.pointRef(e,s),l=b.pointRef(e,i);G.delete(e,{at:a,voids:r});var u=o.unref(),c=l.unref();a=u||c,G.setSelection(e,{anchor:a,focus:a})}if(!(!r&&b.void(e,{at:a})||b.elementReadOnly(e,{at:a}))){var{path:h,offset:p}=a;t.length>0&&e.apply({type:"insert_text",path:h,offset:p,text:t})}})}};function gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Wr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var G=Wr(Wr(Wr(Wr({},up),lp),cp),Wp),ua=new WeakMap,Hp=e=>ua.get(e)||!1,Up=(e,t,n)=>{var r=ua.get(e)||!1;ua.set(e,!0);try{t(),n()}finally{ua.set(e,r)}};function hd(e,t,n){var r=wa.get(e)||[],a=Ea.get(e)||new Set,i,s,o=h=>{if(h){var p=h.join(",");s.has(p)||(s.add(p),i.push(h))}};if(n){i=[],s=new Set;for(var l of r){var u=n(l);o(u)}}else i=r,s=a;for(var c of t)o(c);wa.set(e,i),Ea.set(e,s)}var Vp=(e,t)=>{for(var n of b.pathRefs(e))np.transform(n,t);for(var r of b.pointRefs(e))rp.transform(r,t);for(var a of b.rangeRefs(e))ap.transform(a,t);if(!Hp(e)){var i=N.operationCanTransformPath(t)?s=>N.transform(s,t):void 0;hd(e,e.getDirtyPaths(t),i)}G.transform(e,t),e.operations.push(t),b.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),gr.get(e)||(gr.set(e,!0),Promise.resolve().then(()=>{gr.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},Kp=(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=de.isText(r)?[]:Array.from(oe.nodes(r),M=>{var[,$]=M;return a.concat($)});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:c,newPath:h}=t;if(N.equals(c,h))return[];var p=[],m=[];for(var g of N.ancestors(c)){var f=N.transform(g,t);p.push(f)}for(var D of N.ancestors(h)){var y=N.transform(D,t);m.push(y)}var x=m[m.length-1],A=h[h.length-1],_=x.concat(A);return[...p,...m,_]}case"remove_node":{var{path:E}=t,F=N.ancestors(E);return[...F]}case"split_node":{var{path:T}=t,I=N.levels(T),R=N.next(T);return[...I,R]}default:return[]}},Zp=e=>{var{selection:t}=e;return t?oe.fragment(e,t):[]},Yp=(e,t)=>{var[n,r]=t;if(!de.isText(n)){if(ce.isElement(n)&&n.children.length===0){var a={text:""};G.insertNodes(e,a,{at:r.concat(0),voids:!0});return}for(var i=b.isEditor(n)?!1:ce.isElement(n)&&(e.isInline(n)||n.children.length===0||de.isText(n.children[0])||e.isInline(n.children[0])),s=0,o=0;o<n.children.length;o++,s++){var l=oe.get(e,r);if(!de.isText(l)){var u=l.children[s],c=l.children[s-1],h=o===n.children.length-1,p=de.isText(u)||ce.isElement(u)&&e.isInline(u);if(p!==i)G.removeNodes(e,{at:r.concat(s),voids:!0}),s--;else if(ce.isElement(u)){if(e.isInline(u)){if(c==null||!de.isText(c)){var m={text:""};G.insertNodes(e,m,{at:r.concat(s),voids:!0}),s++}else if(h){var g={text:""};G.insertNodes(e,g,{at:r.concat(s+1),voids:!0}),s++}}}else c!=null&&de.isText(c)&&(de.equals(u,c,{loose:!0})?(G.mergeNodes(e,{at:r.concat(s),voids:!0}),s--):c.text===""?(G.removeNodes(e,{at:r.concat(s-1),voids:!0}),s--):u.text===""&&(G.removeNodes(e,{at:r.concat(s),voids:!0}),s--))}}}},Gp=(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},Qp=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=b.path(t,i),l=a==="lowest";for(var[u,c]of b.levels(t,{at:o,voids:r,match:s,reverse:l}))if(!de.isText(u)){if(V.isRange(i)){if(N.isAncestor(c,i.anchor.path)&&N.isAncestor(c,i.focus.path))return[u,c]}else if(!N.equals(o,c))return[u,c]}}};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 bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Jp=(e,t,n)=>{var{selection:r}=e;if(r){var a=(h,p)=>{if(!de.isText(h))return!1;var[m,g]=b.parent(e,p);return!e.isVoid(m)||e.markableVoid(m)},i=V.isExpanded(r),s=!1;if(!i){var[o,l]=b.node(e,r);if(o&&a(o,l)){var[u]=b.parent(e,l);s=u&&e.markableVoid(u)}}if(i||s)G.setNodes(e,{[t]:n},{match:a,split:!0,voids:!0});else{var c=bu(bu({},b.marks(e)||{}),{},{[t]:n});e.marks=c,gr.get(e)||e.onChange()}}};function yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Xp=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=b.point(t,n,{edge:"end"}),i=b.end(t,[]),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of b.positions(t,Du(Du({},r),{},{at:s}))){if(l>o)break;l!==0&&(u=c),l++}return u};function Cu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var eg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=b.start(t,[]),i=b.point(t,n,{edge:"start"}),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of b.positions(t,xu(xu({},r),{},{at:s,reverse:!0}))){if(l>o)break;l!==0&&(u=c),l++}return u},tg=(e,t)=>{var{selection:n}=e;n&&V.isCollapsed(n)&&G.delete(e,{unit:t,reverse:!0})},ng=(e,t)=>{var{selection:n}=e;n&&V.isCollapsed(n)&&G.delete(e,{unit:t})},rg=function(t){var{direction:n="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t;r&&V.isExpanded(r)&&G.delete(t,{reverse:n==="backward"})},ag=(e,t)=>[b.start(e,t),b.end(e,t)];function wu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function 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){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ig=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return b.above(t,Eu(Eu({},n),{},{match:r=>ce.isElement(r)&&b.isElementReadOnly(t,r)}))},sg=(e,t)=>b.point(e,t,{edge:"end"}),og=(e,t)=>{var n=b.path(e,t,{edge:"start"});return b.node(e,n)},ug=(e,t)=>{var n=b.range(e,t);return oe.fragment(e,n)};function ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ku(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ku(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var lg=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return b.above(t,_u(_u({},n),{},{match:r=>ce.isElement(r)&&b.isVoid(t,r)}))},cg=(e,t)=>t.children.some(n=>ce.isElement(n)&&b.isBlock(e,n)),dg=(e,t)=>t.children.some(n=>de.isText(n)||b.isInline(e,n)),fg=(e,t)=>oe.has(e,t),hg=(e,t)=>t.children.every(n=>de.isText(n)),mg=e=>{G.splitNodes(e,{always:!0})},pg=(e,t,n)=>{G.insertNodes(e,t,n)},gg=e=>{G.splitNodes(e,{always:!0})};function Bu(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 vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var bg=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=vg({text:n},i);G.insertNodes(t,s,{at:r.at,voids:r.voids})}else G.insertText(t,n,r);t.marks=null}},yg=(e,t)=>!e.isInline(t),Dg=(e,t,n)=>b.isStart(e,t,n)||b.isEnd(e,t,n),Cg=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&de.isText(r)&&r.text===""&&!e.isVoid(t)},xg=(e,t,n)=>{var r=b.end(e,n);return Ee.equals(t,r)},wg=e=>{var t=dd.get(e);return t===void 0?!0:t},Eg=(e,t,n)=>{if(t.offset!==0)return!1;var r=b.start(e,n);return Ee.equals(t,r)},kg=(e,t)=>{var n=b.path(e,t,{edge:"end"});return b.node(e,n)},_g=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=b.path(t,n,r),i=oe.leaf(t,a);return[i,a]};function Bg(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=b.path(e,n);for(var[l,u]of oe.levels(e,o))if(i(l,u)&&(s.push([l,u]),!a&&ce.isElement(l)&&b.isVoid(e,l)))break;r&&s.reverse(),yield*s}}()}var Ag=["text"],Fg=["text"],Tg=function(t){var{marks:n,selection:r}=t;if(!r)return null;var{anchor:a,focus:i}=r;if(n)return n;if(V.isExpanded(r)){var s=b.isEnd(t,a,a.path);if(s){var o=b.after(t,a);o&&(a=o)}var[l]=b.nodes(t,{match:de.isText,at:{anchor:a,focus:i}});if(l){var[u]=l,c=Ht(u,Ag);return c}else return{}}var{path:h}=a,[p]=b.leaf(t,h);if(a.offset===0){var m=b.previous(t,{at:h,match:de.isText}),g=b.above(t,{match:_=>ce.isElement(_)&&b.isVoid(t,_)&&t.markableVoid(_)});if(!g){var f=b.above(t,{match:_=>ce.isElement(_)&&b.isBlock(t,_)});if(m&&f){var[D,y]=m,[,x]=f;N.isAncestor(x,y)&&(p=D)}}}var A=Ht(p,Fg);return A},Sg=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=b.after(t,s,{voids:a});if(o){var[,l]=b.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[c]=b.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=b.nodes(t,{at:u,match:i,mode:r,voids:a});return h}}},jg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=b.path(t,n,r),i=oe.get(t,a);return[i,a]};function Og(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:a=!1,reverse:i=!1,voids:s=!1,ignoreNonSelectable:o=!1}=t,{match:l}=t;if(l||(l=()=>!0),!!n){var u,c;if(vp.isSpan(n))u=n[0],c=n[1];else{var h=b.path(e,n,{edge:"start"}),p=b.path(e,n,{edge:"end"});u=i?p:h,c=i?h:p}var m=oe.nodes(e,{reverse:i,from:u,to:c,pass:_=>{var[E]=_;return ce.isElement(E)?!!(!s&&(b.isVoid(e,E)||b.isElementReadOnly(e,E))||o&&!b.isSelectable(e,E)):!1}}),g=[],f;for(var[D,y]of m)if(!(o&&ce.isElement(D)&&!b.isSelectable(e,D))){var x=f&&N.compare(y,f[1])===0;if(!(r==="highest"&&x)){if(!l(D,y)){if(a&&!x&&de.isText(D))return;continue}if(r==="lowest"&&x){f=[D,y];continue}var A=r==="lowest"?f:[D,y];A&&(a?g.push(A):yield A),f=[D,y]}}r==="lowest"&&f&&(a?g.push(f):yield f),a&&(yield*g)}}()}var Pg=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:a}=n,i=c=>wa.get(c)||[],s=c=>Ea.get(c)||new Set,o=c=>{var h=i(c).pop(),p=h.join(",");return s(c).delete(p),h};if(b.isNormalizing(t)){if(r){var l=Array.from(oe.nodes(t),c=>{var[,h]=c;return h}),u=new Set(l.map(c=>c.join(",")));wa.set(t,l),Ea.set(t,u)}i(t).length!==0&&b.withoutNormalizing(t,()=>{for(var c of i(t))if(oe.has(t,c)){var h=b.node(t,c),[p,m]=h;ce.isElement(p)&&p.children.length===0&&t.normalizeNode(h,{operation:a})}for(var g=i(t),f=g.length,D=0;g.length!==0;){if(!t.shouldNormalize({dirtyPaths:g,iteration:D,initialDirtyPathsLength:f,operation:a}))return;var y=o(t);if(oe.has(t,y)){var x=b.node(t,y);t.normalizeNode(x,{operation:a})}D++,g=i(t)}})}},Ng=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=b.path(t,n,r),i=N.parent(a),s=b.node(t,i);return s},Rg=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=b.pathRefs(t);return l.delete(i),i.current=null,o}},s=b.pathRefs(t);return s.add(i),i},Mg=e=>{var t=nu.get(e);return t||(t=new Set,nu.set(e,t)),t},Ig=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]=oe.first(t,n);n=s}else if(i==="end"){var[,o]=oe.last(t,n);n=o}}return V.isRange(n)&&(i==="start"?n=V.start(n):i==="end"?n=V.end(n):n=N.common(n.anchor.path,n.focus.path)),Ee.isPoint(n)&&(n=n.path),a!=null&&(n=n.slice(0,a)),n},$g=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=b.pointRefs(t);return l.delete(i),i.current=null,o}},s=b.pointRefs(t);return s.add(i),i},Lg=e=>{var t=ru.get(e);return t||(t=new Set,ru.set(e,t)),t},zg=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]=oe.last(t,n);i=s}else{var[,o]=oe.first(t,n);i=o}var l=oe.get(t,i);if(!de.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(V.isRange(n)){var[u,c]=V.edges(n);return a==="start"?u:c}return n};function qg(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=b.range(e,n),[l,u]=V.edges(o),c=a?u:l,h=!1,p="",m=0,g=0,f=0;for(var[D,y]of b.nodes(e,{at:n,reverse:a,voids:i,ignoreNonSelectable:s})){if(ce.isElement(D)){if(!i&&(e.isVoid(D)||e.isElementReadOnly(D))){yield b.start(e,y);continue}if(e.isInline(D))continue;if(b.hasInlines(e,D)){var x=N.isAncestor(y,u.path)?u:b.end(e,y),A=N.isAncestor(y,l.path)?l:b.start(e,y);p=b.string(e,{anchor:A,focus:x},{voids:i}),h=!0}}if(de.isText(D)){var _=N.equals(y,c.path);for(_?(g=a?c.offset:D.text.length-c.offset,f=c.offset):(g=D.text.length,f=a?g:0),(_||h||r==="offset")&&(yield{path:y,offset:f},h=!1);;){if(m===0){if(p==="")break;m=E(p,r,a),p=Qs(p,m,a)[1]}if(f=a?f-m:f+m,g=g-m,g<0){m=-g;break}m=0,yield{path:y,offset:f}}}}function E(F,T,I){return T==="character"?Gs(F,I):T==="word"?wp(F,I):T==="line"||T==="block"?F.length:1}}()}var Wg=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=b.before(t,s,{voids:a});if(o){var[,l]=b.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[c]=b.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=b.nodes(t,{reverse:!0,at:u,match:i,mode:r,voids:a});return h}}},Hg=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=b.rangeRefs(t);return l.delete(i),i.current=null,o}},s=b.rangeRefs(t);return s.add(i),i},Ug=e=>{var t=au.get(e);return t||(t=new Set,au.set(e,t)),t},Vg=(e,t,n)=>{if(V.isRange(t)&&!n)return t;var r=b.start(e,t),a=b.end(e,n||t);return{anchor:r,focus:a}};function Au(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 Kg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Au(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Au(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Zg=(e,t)=>{var{selection:n}=e;if(n){var r=(c,h)=>{if(!de.isText(c))return!1;var[p,m]=b.parent(e,h);return!e.isVoid(p)||e.markableVoid(p)},a=V.isExpanded(n),i=!1;if(!a){var[s,o]=b.node(e,n);if(s&&r(s,o)){var[l]=b.parent(e,o);i=l&&e.markableVoid(l)}}if(a||i)G.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var u=Kg({},b.marks(e)||{});delete u[t],e.marks=u,gr.get(e)||e.onChange()}}},Yg=(e,t)=>{dd.set(e,t)},Gg=(e,t)=>b.point(e,t,{edge:"start"}),Qg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,i=b.range(t,n),[s,o]=V.edges(i),l="";for(var[u,c]of b.nodes(t,{at:i,match:de.isText,voids:a})){var h=u.text;N.equals(c,o.path)&&(h=h.slice(0,o.offset)),N.equals(c,s.path)&&(h=h.slice(s.offset)),l+=h}return l},Jg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,[i,s]=V.edges(n);if(i.offset!==0||s.offset!==0||V.isCollapsed(n)||N.hasPrevious(s.path))return n;var o=b.above(t,{at:s,match:g=>ce.isElement(g)&&b.isBlock(t,g),voids:a}),l=o?o[1]:[],u=b.start(t,i),c={anchor:u,focus:s},h=!0;for(var[p,m]of b.nodes(t,{at:c,match:de.isText,reverse:!0,voids:a})){if(h){h=!1;continue}if(p.text!==""||N.isBefore(m,l)){s={path:m,offset:p.text.length};break}}return{anchor:i,focus:s}},Xg=(e,t)=>{var n=b.isNormalizing(e);b.setNormalizing(e,!1);try{t()}finally{b.setNormalizing(e,n)}b.normalize(e)},ev=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,()=>{var r,a,{reverse:i=!1,unit:s="character",distance:o=1,voids:l=!1}=n,{at:u=t.selection,hanging:c=!1}=n;if(u){var h=!1;if(V.isRange(u)&&V.isCollapsed(u)&&(h=!0,u=u.anchor),Ee.isPoint(u)){var p=b.void(t,{at:u,mode:"highest"});if(!l&&p){var[,m]=p;u=m}else{var g={unit:s,distance:o},f=i?b.before(t,u,g)||b.start(t,[]):b.after(t,u,g)||b.end(t,[]);u={anchor:u,focus:f},c=!0}}if(N.isPath(u)){G.removeNodes(t,{at:u,voids:l});return}if(!V.isCollapsed(u)){if(!c){var[,D]=V.edges(u),y=b.end(t,[]);Ee.equals(D,y)||(u=b.unhangRange(t,u,{voids:l}))}var[x,A]=V.edges(u),_=b.above(t,{match:he=>ce.isElement(he)&&b.isBlock(t,he),at:x,voids:l}),E=b.above(t,{match:he=>ce.isElement(he)&&b.isBlock(t,he),at:A,voids:l}),F=_&&E&&!N.equals(_[1],E[1]),T=N.equals(x.path,A.path),I=l?null:(r=b.void(t,{at:x,mode:"highest"}))!==null&&r!==void 0?r:b.elementReadOnly(t,{at:x,mode:"highest"}),R=l?null:(a=b.void(t,{at:A,mode:"highest"}))!==null&&a!==void 0?a:b.elementReadOnly(t,{at:A,mode:"highest"});if(I){var M=b.before(t,x);M&&_&&N.isAncestor(_[1],M.path)&&(x=M)}if(R){var $=b.after(t,A);$&&E&&N.isAncestor(E[1],$.path)&&(A=$)}var w=[],k;for(var O of b.nodes(t,{at:u,voids:l})){var[j,z]=O;k&&N.compare(z,k)===0||(!l&&ce.isElement(j)&&(b.isVoid(t,j)||b.isElementReadOnly(t,j))||!N.isCommon(z,x.path)&&!N.isCommon(z,A.path))&&(w.push(O),k=z)}var H=Array.from(w,he=>{var[,xe]=he;return b.pathRef(t,xe)}),te=b.pointRef(t,x),J=b.pointRef(t,A),v="";if(!T&&!I){var W=te.current,[ee]=b.leaf(t,W),{path:B}=W,{offset:S}=x,q=ee.text.slice(S);q.length>0&&(t.apply({type:"remove_text",path:B,offset:S,text:q}),v=q)}if(H.reverse().map(he=>he.unref()).filter(he=>he!==null).forEach(he=>G.removeNodes(t,{at:he,voids:l})),!R){var L=J.current,[U]=b.leaf(t,L),{path:ne}=L,re=T?x.offset:0,ae=U.text.slice(re,A.offset);ae.length>0&&(t.apply({type:"remove_text",path:ne,offset:re,text:ae}),v=ae)}!T&&F&&J.current&&te.current&&G.mergeNodes(t,{at:J.current,hanging:!0,voids:l}),h&&i&&s==="character"&&v.length>1&&v.match(/[\u0E00-\u0E7F]+/)&&G.insertText(t,v.slice(0,v.length-o));var fe=te.unref(),X=J.unref(),be=i?fe||X:X||fe;n.at==null&&be&&G.select(t,be)}}})},tv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1}=r,{at:s=Ys(t),batchDirty:o=!0}=r;if(n.length){if(V.isRange(s))if(a||(s=b.unhangRange(t,s,{voids:i})),V.isCollapsed(s))s=s.anchor;else{var[,l]=V.edges(s);if(!i&&b.void(t,{at:l}))return;var u=b.pointRef(t,l);G.delete(t,{at:s}),s=u.unref()}else N.isPath(s)&&(s=b.start(t,s));if(!(!i&&b.void(t,{at:s}))){var c=b.above(t,{at:s,match:q=>ce.isElement(q)&&b.isInline(t,q),mode:"highest",voids:i});if(c){var[,h]=c;if(b.isEnd(t,s,h)){var p=b.after(t,h);s=p}else if(b.isStart(t,s,h)){var m=b.before(t,h);s=m}}var g=b.above(t,{match:q=>ce.isElement(q)&&b.isBlock(t,q),at:s,voids:i}),[,f]=g,D=b.isStart(t,s,f),y=b.isEnd(t,s,f),x=D&&y,A=!D||D&&y,_=!y,[,E]=oe.first({children:n},[]),[,F]=oe.last({children:n},[]),T=[],I=q=>{var[L,U]=q,ne=U.length===0;return ne?!1:x?!0:!(A&&N.isAncestor(U,E)&&ce.isElement(L)&&!t.isVoid(L)&&!t.isInline(L)||_&&N.isAncestor(U,F)&&ce.isElement(L)&&!t.isVoid(L)&&!t.isInline(L))};for(var R of oe.nodes({children:n},{pass:I}))I(R)&&T.push(R);var M=[],$=[],w=[],k=!0,O=!1;for(var[j]of T)ce.isElement(j)&&!t.isInline(j)?(k=!1,O=!0,$.push(j)):k?M.push(j):w.push(j);var[z]=b.nodes(t,{at:s,match:q=>de.isText(q)||b.isInline(t,q),mode:"highest",voids:i}),[,H]=z,te=b.isStart(t,s,H),J=b.isEnd(t,s,H),v=b.pathRef(t,y&&!w.length?N.next(f):f),W=b.pathRef(t,J?N.next(H):H);G.splitNodes(t,{at:s,match:q=>O?ce.isElement(q)&&b.isBlock(t,q):de.isText(q)||b.isInline(t,q),mode:O?"lowest":"highest",always:O&&(!D||M.length>0)&&(!y||w.length>0),voids:i});var ee=b.pathRef(t,!te||te&&J?N.next(H):H);if(G.insertNodes(t,M,{at:ee.current,match:q=>de.isText(q)||b.isInline(t,q),mode:"highest",voids:i,batchDirty:o}),x&&!M.length&&$.length&&!w.length&&G.delete(t,{at:f,voids:i}),G.insertNodes(t,$,{at:v.current,match:q=>ce.isElement(q)&&b.isBlock(t,q),mode:"lowest",voids:i,batchDirty:o}),G.insertNodes(t,w,{at:W.current,match:q=>de.isText(q)||b.isInline(t,q),mode:"highest",voids:i,batchDirty:o}),!r.at){var B;if(w.length>0&&W.current?B=N.previous(W.current):$.length>0&&v.current?B=N.previous(v.current):ee.current&&(B=N.previous(ee.current)),B){var S=b.end(t,B);G.select(t,S)}}ee.unref(),v.unref(),W.unref()}}})},nv=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")G.select(t,a.anchor);else if(r==="focus")G.select(t,a.focus);else if(r==="start"){var[i]=V.edges(a);G.select(t,i)}else if(r==="end"){var[,s]=V.edges(a);G.select(t,s)}}else return},rv=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},av=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=V.isBackward(r)?"focus":"anchor"),o==="end"&&(o=V.isBackward(r)?"anchor":"focus");var{anchor:l,focus:u}=r,c={distance:a,unit:i,ignoreNonSelectable:!0},h={};if(o==null||o==="anchor"){var p=s?b.before(t,l,c):b.after(t,l,c);p&&(h.anchor=p)}if(o==null||o==="focus"){var m=s?b.before(t,u,c):b.after(t,u,c);m&&(h.focus=m)}G.setSelection(t,h)}},iv=(e,t)=>{var{selection:n}=e;if(t=b.range(e,t),n){G.setSelection(e,t);return}if(!V.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(Je.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})};function Fu(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 Tu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var sv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:a}=t,{edge:i="both"}=r;if(a){i==="start"&&(i=V.isBackward(a)?"focus":"anchor"),i==="end"&&(i=V.isBackward(a)?"anchor":"focus");var{anchor:s,focus:o}=a,l=i==="anchor"?s:o;G.setSelection(t,{[i==="anchor"?"anchor":"focus"]:Tu(Tu({},l),n)})}},ov=(e,t)=>{var{selection:n}=e,r={},a={};if(n){for(var i in t)(i==="anchor"&&t.anchor!=null&&!Ee.equals(t.anchor,n.anchor)||i==="focus"&&t.focus!=null&&!Ee.equals(t.focus,n.focus)||i!=="anchor"&&i!=="focus"&&t[i]!==n[i])&&(r[i]=n[i],a[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:a})}},uv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1,mode:s="lowest",batchDirty:o=!0}=r,{at:l,match:u,select:c}=r;if(oe.isNode(n)&&(n=[n]),n.length!==0){var[h]=n;if(l||(l=Ys(t),c!==!1&&(c=!0)),c==null&&(c=!1),V.isRange(l))if(a||(l=b.unhangRange(t,l,{voids:i})),V.isCollapsed(l))l=l.anchor;else{var[,p]=V.edges(l),m=b.pointRef(t,p);G.delete(t,{at:l}),l=m.unref()}if(Ee.isPoint(l)){u==null&&(de.isText(h)?u=M=>de.isText(M):t.isInline(h)?u=M=>de.isText(M)||b.isInline(t,M):u=M=>ce.isElement(M)&&b.isBlock(t,M));var[g]=b.nodes(t,{at:l.path,match:u,mode:s,voids:i});if(g){var[,f]=g,D=b.pathRef(t,f),y=b.isEnd(t,l,f);G.splitNodes(t,{at:l,match:u,mode:s,voids:i});var x=D.unref();l=y?N.next(x):x}else return}var A=N.parent(l),_=l[l.length-1];if(!(!i&&b.void(t,{at:A}))){if(o){var E=[],F=N.levels(A);Up(t,()=>{var M=function(){var k=A.concat(_);_++;var O={type:"insert_node",path:k,node:$};t.apply(O),l=N.next(l),E.push(O),de.isText?F.push(...Array.from(oe.nodes($),j=>{var[,z]=j;return k.concat(z)})):F.push(k)};for(var $ of n)M()},()=>{hd(t,F,M=>{var $=M;for(var w of E)if(N.operationCanTransformPath(w)&&($=N.transform($,w),!$))return null;return $})})}else for(var T of n){var I=A.concat(_);_++,t.apply({type:"insert_node",path:I,node:T}),l=N.next(l)}if(l=N.previous(l),c){var R=b.end(t,l);R&&G.select(t,R)}}}})},lv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,()=>{var{at:r=t.selection,mode:a="lowest",voids:i=!1}=n,{match:s}=n;if(s==null&&(s=N.isPath(r)?rr(t,r):_=>ce.isElement(_)&&b.isBlock(t,_)),!!r){var o=b.nodes(t,{at:r,match:s,mode:a,voids:i}),l=Array.from(o,_=>{var[,E]=_;return b.pathRef(t,E)});for(var u of l){var c=u.unref();if(c.length<2)throw new Error("Cannot lift node at a path [".concat(c,"] because it has a depth of less than `2`."));var h=b.node(t,N.parent(c)),[p,m]=h,g=c[c.length-1],{length:f}=p.children;if(f===1){var D=N.next(m);G.moveNodes(t,{at:c,to:D,voids:i}),G.removeNodes(t,{at:m,voids:i})}else if(g===0)G.moveNodes(t,{at:c,to:m,voids:i});else if(g===f-1){var y=N.next(m);G.moveNodes(t,{at:c,to:y,voids:i})}else{var x=N.next(c),A=N.next(m);G.splitNodes(t,{at:x,voids:i}),G.moveNodes(t,{at:c,to:A,voids:i})}}}})},cv=["text"],dv=["children"],md=(e,t)=>{if(ce.isElement(t)){var n=t;return b.isVoid(e,t)?!0:n.children.length===1?md(e,n.children[0]):!1}else return!b.isEditor(t)},fv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.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]=b.parent(t,a);r=M=>l.children.includes(M)}else r=M=>ce.isElement(M)&&b.isBlock(t,M);if(!i&&V.isRange(a)&&(a=b.unhangRange(t,a,{voids:s})),V.isRange(a))if(V.isCollapsed(a))a=a.anchor;else{var[,u]=V.edges(a),c=b.pointRef(t,u);G.delete(t,{at:a}),a=c.unref(),n.at==null&&G.select(t,a)}var[h]=b.nodes(t,{at:a,match:r,voids:s,mode:o}),p=b.previous(t,{at:a,match:r,voids:s,mode:o});if(!(!h||!p)){var[m,g]=h,[f,D]=p;if(!(g.length===0||D.length===0)){var y=N.next(D),x=N.common(g,D),A=N.isSibling(g,D),_=Array.from(b.levels(t,{at:g}),M=>{var[$]=M;return $}).slice(x.length).slice(0,-1),E=b.above(t,{at:g,mode:"highest",match:M=>_.includes(M)&&md(t,M)}),F=E&&b.pathRef(t,E[1]),T,I;if(de.isText(m)&&de.isText(f)){var R=Ht(m,cv);I=f.text.length,T=R}else if(ce.isElement(m)&&ce.isElement(f)){var R=Ht(m,dv);I=f.children.length,T=R}else throw new Error("Cannot merge the node at path [".concat(g,"] with the previous sibling because it is not the same kind: ").concat(Je.stringify(m)," ").concat(Je.stringify(f)));A||G.moveNodes(t,{at:g,to:y,voids:s}),F&&G.removeNodes(t,{at:F.current,voids:s}),ce.isElement(f)&&b.isEmpty(t,f)||de.isText(f)&&f.text===""&&D[D.length-1]!==0?G.removeNodes(t,{at:D,voids:s}):t.apply({type:"merge_node",path:y,position:I,properties:T}),F&&F.unref()}}}})},hv=(e,t)=>{b.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)?rr(e,r):m=>ce.isElement(m)&&b.isBlock(e,m));var o=b.pathRef(e,n),l=b.nodes(e,{at:r,match:s,mode:a,voids:i}),u=Array.from(l,m=>{var[,g]=m;return b.pathRef(e,g)});for(var c of u){var h=c.unref(),p=o.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:p}),o.current&&N.isSibling(p,h)&&N.isAfter(p,h)&&(o.current=N.next(o.current))}o.unref()}})},mv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.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)?rr(t,s):m=>ce.isElement(m)&&b.isBlock(t,m)),!r&&V.isRange(s)&&(s=b.unhangRange(t,s,{voids:a}));var l=b.nodes(t,{at:s,match:o,mode:i,voids:a}),u=Array.from(l,m=>{var[,g]=m;return b.pathRef(t,g)});for(var c of u){var h=c.unref();if(h){var[p]=b.node(t,h);t.apply({type:"remove_node",path:h,node:p})}}}})},pv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,()=>{var{match:a,at:i=t.selection,compare:s,merge:o}=r,{hanging:l=!1,mode:u="lowest",split:c=!1,voids:h=!1}=r;if(i){if(a==null&&(a=N.isPath(i)?rr(t,i):I=>ce.isElement(I)&&b.isBlock(t,I)),!l&&V.isRange(i)&&(i=b.unhangRange(t,i,{voids:h})),c&&V.isRange(i)){if(V.isCollapsed(i)&&b.leaf(t,i.anchor)[0].text.length>0)return;var p=b.rangeRef(t,i,{affinity:"inward"}),[m,g]=V.edges(i),f=u==="lowest"?"lowest":"highest",D=b.isEnd(t,g,g.path);G.splitNodes(t,{at:g,match:a,mode:f,voids:h,always:!D});var y=b.isStart(t,m,m.path);G.splitNodes(t,{at:m,match:a,mode:f,voids:h,always:!y}),i=p.unref(),r.at==null&&G.select(t,i)}s||(s=(I,R)=>I!==R);for(var[x,A]of b.nodes(t,{at:i,match:a,mode:u,voids:h})){var _={},E={};if(A.length!==0){var F=!1;for(var T in n)T==="children"||T==="text"||s(n[T],x[T])&&(F=!0,x.hasOwnProperty(T)&&(_[T]=x[T]),o?n[T]!=null&&(E[T]=o(x[T],n[T])):n[T]!=null&&(E[T]=n[T]));F&&t.apply({type:"set_node",path:A,properties:_,newProperties:E})}}}})},gv=(e,t)=>{if(V.isCollapsed(t))return t.anchor;var[,n]=V.edges(t),r=b.pointRef(e,n);return G.delete(e,{at:t}),r.unref()},vv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.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=J=>ce.isElement(J)&&b.isBlock(t,J)),V.isRange(s)&&(s=gv(t,s)),N.isPath(s)){var u=s,c=b.point(t,u),[h]=b.parent(t,u);i=J=>J===h,o=c.path.length-u.length+1,s=c,l=!0}if(s){var p=b.pointRef(t,s,{affinity:"backward"}),m;try{var[g]=b.nodes(t,{at:s,match:i,mode:r,voids:a});if(!g)return;var f=b.void(t,{at:s,mode:"highest"}),D=0;if(!a&&f){var[y,x]=f;if(ce.isElement(y)&&t.isInline(y)){var A=b.after(t,x);if(!A){var _={text:""},E=N.next(x);G.insertNodes(t,_,{at:E,voids:a}),A=b.point(t,E)}s=A,l=!0}var F=s.path.length-x.length;o=F+1,l=!0}m=b.pointRef(t,s);var T=s.path.length-o,[,I]=g,R=s.path.slice(0,T),M=o===0?s.offset:s.path[T]+D;for(var[$,w]of b.levels(t,{at:R,reverse:!0,voids:a})){var k=!1;if(w.length<I.length||w.length===0||!a&&ce.isElement($)&&b.isVoid(t,$))break;var O=p.current,j=b.isEnd(t,O,w);if(l||!p||!b.isEdge(t,O,w)){k=!0;var z=oe.extractProps($);t.apply({type:"split_node",path:w,position:M,properties:z})}M=w[w.length-1]+(k||j?1:0)}if(n.at==null){var H=m.current||b.end(t,[]);G.select(t,H)}}finally{var te;p.unref(),(te=m)===null||te===void 0||te.unref()}}})},bv=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;G.setNodes(t,a,r)},yv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.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)?rr(t,s):m=>ce.isElement(m)&&b.isBlock(t,m)),N.isPath(s)&&(s=b.range(t,s));var l=V.isRange(s)?b.rangeRef(t,s):null,u=b.nodes(t,{at:s,match:o,mode:r,voids:i}),c=Array.from(u,m=>{var[,g]=m;return b.pathRef(t,g)}).reverse(),h=function(){var g=p.unref(),[f]=b.node(t,g),D=b.range(t,g);a&&l&&(D=V.intersection(l.current,D)),G.liftNodes(t,{at:D,match:y=>ce.isAncestor(f)&&f.children.includes(y),voids:i})};for(var p of c)h();l&&l.unref()}})};function Su(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Su(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Su(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Dv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.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=rr(t,l):t.isInline(n)?o=D=>ce.isElement(D)&&b.isInline(t,D)||de.isText(D):o=D=>ce.isElement(D)&&b.isBlock(t,D)),i&&V.isRange(l)){var[u,c]=V.edges(l),h=b.rangeRef(t,l,{affinity:"inward"});G.splitNodes(t,{at:c,match:o,voids:s}),G.splitNodes(t,{at:u,match:o,voids:s}),l=h.unref(),r.at==null&&G.select(t,l)}var p=Array.from(b.nodes(t,{at:l,match:t.isInline(n)?D=>ce.isElement(D)&&b.isBlock(t,D):D=>b.isEditor(D),mode:"lowest",voids:s})),m=function(){var y=V.isRange(l)?V.intersection(l,b.range(t,f)):l;if(!y)return 0;var x=Array.from(b.nodes(t,{at:y,match:o,mode:a,voids:s}));if(x.length>0){var[A]=x,_=x[x.length-1],[,E]=A,[,F]=_;if(E.length===0&&F.length===0)return 0;var T=N.equals(E,F)?N.parent(E):N.common(E,F),I=b.range(t,E,F),R=b.node(t,T),[M]=R,$=T.length+1,w=N.next(F.slice(0,$)),k=ju(ju({},n),{},{children:[]});G.insertNodes(t,k,{at:w,voids:s}),G.moveNodes(t,{at:I,match:O=>ce.isAncestor(M)&&M.children.includes(O),to:w.concat(0),voids:s})}},g;for(var[,f]of p)g=m()}})},Cv=()=>{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 Vp(e,...r)},addMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jp(e,...r)},deleteBackward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return tg(e,...r)},deleteForward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ng(e,...r)},deleteFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return rg(e,...r)},getFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zp(e,...r)},insertBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return mg(e,...r)},insertSoftBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return gg(e,...r)},insertFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return tv(e,...r)},insertNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return pg(e,...r)},insertText:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return bg(e,...r)},normalizeNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yp(e,...r)},removeMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zg(e,...r)},getDirtyPaths:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Kp(e,...r)},shouldNormalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gp(e,...r)},above:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qp(e,...r)},after:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xp(e,...r)},before:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return eg(e,...r)},collapse:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return nv(e,...r)},delete:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ev(e,...r)},deselect:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return rv(e,...r)},edges:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ag(e,...r)},elementReadOnly:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ig(e,...r)},end:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return sg(e,...r)},first:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return og(e,...r)},fragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ug(e,...r)},getMarks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Tg(e,...r)},hasBlocks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return cg(e,...r)},hasInlines:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return dg(e,...r)},hasPath:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return fg(e,...r)},hasTexts:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return hg(e,...r)},insertNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return uv(e,...r)},isBlock:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return yg(e,...r)},isEdge:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Dg(e,...r)},isEmpty:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Cg(e,...r)},isEnd:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return xg(e,...r)},isNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return wg(e,...r)},isStart:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Eg(e,...r)},last:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return kg(e,...r)},leaf:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return _g(e,...r)},levels:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Bg(e,...r)},liftNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return lv(e,...r)},mergeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return fv(e,...r)},move:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return av(e,...r)},moveNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return hv(e,...r)},next:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Sg(e,...r)},node:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return jg(e,...r)},nodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Og(e,...r)},normalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Pg(e,...r)},parent:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ng(e,...r)},path:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ig(e,...r)},pathRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Rg(e,...r)},pathRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Mg(e,...r)},point:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return zg(e,...r)},pointRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return $g(e,...r)},pointRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Lg(e,...r)},positions:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return qg(e,...r)},previous:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Wg(e,...r)},range:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Vg(e,...r)},rangeRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Hg(e,...r)},rangeRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ug(e,...r)},removeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return mv(e,...r)},select:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return iv(e,...r)},setNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return pv(e,...r)},setNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yg(e,...r)},setPoint:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return sv(e,...r)},setSelection:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ov(e,...r)},splitNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return vv(e,...r)},start:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gg(e,...r)},string:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qg(e,...r)},unhangRange:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jg(e,...r)},unsetNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return bv(e,...r)},unwrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return yv(e,...r)},void:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return lg(e,...r)},withoutNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xg(e,...r)},wrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Dv(e,...r)}};return e},xv={isHistory(e){return et(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||Xt.isOperationList(e.redos[0].operations))&&(e.undos.length===0||Xt.isOperationList(e.undos[0].operations))}},fi=new WeakMap,hi=new WeakMap,In={isHistoryEditor(e){return xv.isHistory(e.history)&&b.isEditor(e)},isMerging(e){return hi.get(e)},isSaving(e){return fi.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=In.isMerging(e);hi.set(e,!1),t(),hi.set(e,n)},withoutSaving(e,t){var n=In.isSaving(e);fi.set(e,!1),t(),fi.set(e,n)}},wv=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&&G.setSelection(t,i.selectionBefore),In.withoutSaving(t,()=>{b.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];In.withoutSaving(t,()=>{b.withoutNormalizing(t,()=>{var s=i.operations.map(Xt.inverse).reverse();for(var o of s)t.apply(o);i.selectionBefore&&G.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=In.isSaving(t),c=In.isMerging(t);if(u==null&&(u=kv(r)),u){if(c==null&&(o==null?c=!1:a.length!==0?c=!0:c=Ev(r,l)),o&&c)o.operations.push(r);else{var h={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",h)}for(;s.length>100;)s.shift();i.redos=[]}n(r)},t.writeHistory=(r,a)=>{t.history[r].push(a)},t},Ev=(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)),kv=(e,t)=>e.type!=="set_selection",_v=Fv,pd="֑-߿יִ-﷽ﹰ-ﻼ",gd="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Bv=new RegExp("^[^"+gd+"]*["+pd+"]"),Av=new RegExp("^[^"+pd+"]*["+gd+"]");function Fv(e){return e=String(e||""),Bv.test(e)?"rtl":Av.test(e)?"ltr":"neutral"}const vd=wn(_v);function Tv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Js=Tv,Sv=typeof $r=="object"&&$r&&$r.Object===Object&&$r,jv=Sv,Ov=jv,Pv=typeof self=="object"&&self&&self.Object===Object&&self,Nv=Ov||Pv||Function("return this")(),bd=Nv,Rv=bd,Mv=function(){return Rv.Date.now()},Iv=Mv,$v=/\s/;function Lv(e){for(var t=e.length;t--&&$v.test(e.charAt(t)););return t}var zv=Lv,qv=zv,Wv=/^\s+/;function Hv(e){return e&&e.slice(0,qv(e)+1).replace(Wv,"")}var Uv=Hv,Vv=bd,Kv=Vv.Symbol,yd=Kv,Ou=yd,Dd=Object.prototype,Zv=Dd.hasOwnProperty,Yv=Dd.toString,ur=Ou?Ou.toStringTag:void 0;function Gv(e){var t=Zv.call(e,ur),n=e[ur];try{e[ur]=void 0;var r=!0}catch{}var a=Yv.call(e);return r&&(t?e[ur]=n:delete e[ur]),a}var Qv=Gv,Jv=Object.prototype,Xv=Jv.toString;function e0(e){return Xv.call(e)}var t0=e0,Pu=yd,n0=Qv,r0=t0,a0="[object Null]",i0="[object Undefined]",Nu=Pu?Pu.toStringTag:void 0;function s0(e){return e==null?e===void 0?i0:a0:Nu&&Nu in Object(e)?n0(e):r0(e)}var o0=s0;function u0(e){return e!=null&&typeof e=="object"}var l0=u0,c0=o0,d0=l0,f0="[object Symbol]";function h0(e){return typeof e=="symbol"||d0(e)&&c0(e)==f0}var m0=h0,p0=Uv,Ru=Js,g0=m0,Mu=0/0,v0=/^[-+]0x[0-9a-f]+$/i,b0=/^0b[01]+$/i,y0=/^0o[0-7]+$/i,D0=parseInt;function C0(e){if(typeof e=="number")return e;if(g0(e))return Mu;if(Ru(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ru(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=p0(e);var n=b0.test(e);return n||y0.test(e)?D0(e.slice(2),n?2:8):v0.test(e)?Mu:+e}var x0=C0,w0=Js,mi=Iv,Iu=x0,E0="Expected a function",k0=Math.max,_0=Math.min;function B0(e,t,n){var r,a,i,s,o,l,u=0,c=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(E0);t=Iu(t)||0,w0(n)&&(c=!!n.leading,h="maxWait"in n,i=h?k0(Iu(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function m(F){var T=r,I=a;return r=a=void 0,u=F,s=e.apply(I,T),s}function g(F){return u=F,o=setTimeout(y,t),c?m(F):s}function f(F){var T=F-l,I=F-u,R=t-T;return h?_0(R,i-I):R}function D(F){var T=F-l,I=F-u;return l===void 0||T>=t||T<0||h&&I>=i}function y(){var F=mi();if(D(F))return x(F);o=setTimeout(y,f(F))}function x(F){return o=void 0,p&&r?m(F):(r=a=void 0,s)}function A(){o!==void 0&&clearTimeout(o),u=0,r=l=a=o=void 0}function _(){return o===void 0?s:x(mi())}function E(){var F=mi(),T=D(F);if(r=arguments,a=this,l=F,T){if(o===void 0)return g(l);if(h)return clearTimeout(o),o=setTimeout(y,t),m(l)}return o===void 0&&(o=setTimeout(y,t)),s}return E.cancel=A,E.flush=_,E}var Cd=B0;const A0=wn(Cd);var F0=Cd,T0=Js,S0="Expected a function";function j0(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(S0);return T0(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),F0(e,t,{leading:r,maxWait:t,trailing:a})}var O0=j0;const P0=wn(O0),$u=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Lu=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",pi=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Lu(n.overflowY,t)||Lu(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},Hr=(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,N0=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},zu=(e,t)=>{var n,r,a,i;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,h=typeof u=="function"?u:z=>z!==u;if(!$u(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,m=[];let g=e;for(;$u(g)&&h(g);){if(g=N0(g),g===p){m.push(g);break}g!=null&&g===document.body&&pi(g)&&!pi(document.documentElement)||g!=null&&pi(g,c)&&m.push(g)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,D=(i=(a=window.visualViewport)==null?void 0:a.height)!=null?i:innerHeight,{scrollX:y,scrollY:x}=window,{height:A,width:_,top:E,right:F,bottom:T,left:I}=e.getBoundingClientRect(),{top:R,right:M,bottom:$,left:w}=(z=>{const H=window.getComputedStyle(z);return{top:parseFloat(H.scrollMarginTop)||0,right:parseFloat(H.scrollMarginRight)||0,bottom:parseFloat(H.scrollMarginBottom)||0,left:parseFloat(H.scrollMarginLeft)||0}})(e);let k=o==="start"||o==="nearest"?E-R:o==="end"?T+$:E+A/2-R+$,O=l==="center"?I+_/2-w+M:l==="end"?F+M:I-w;const j=[];for(let z=0;z<m.length;z++){const H=m[z],{height:te,width:J,top:v,right:W,bottom:ee,left:B}=H.getBoundingClientRect();if(s==="if-needed"&&E>=0&&I>=0&&T<=D&&F<=f&&E>=v&&T<=ee&&I>=B&&F<=W)return j;const S=getComputedStyle(H),q=parseInt(S.borderLeftWidth,10),L=parseInt(S.borderTopWidth,10),U=parseInt(S.borderRightWidth,10),ne=parseInt(S.borderBottomWidth,10);let re=0,ae=0;const fe="offsetWidth"in H?H.offsetWidth-H.clientWidth-q-U:0,X="offsetHeight"in H?H.offsetHeight-H.clientHeight-L-ne:0,be="offsetWidth"in H?H.offsetWidth===0?0:J/H.offsetWidth:0,he="offsetHeight"in H?H.offsetHeight===0?0:te/H.offsetHeight:0;if(p===H)re=o==="start"?k:o==="end"?k-D:o==="nearest"?Hr(x,x+D,D,L,ne,x+k,x+k+A,A):k-D/2,ae=l==="start"?O:l==="center"?O-f/2:l==="end"?O-f:Hr(y,y+f,f,q,U,y+O,y+O+_,_),re=Math.max(0,re+x),ae=Math.max(0,ae+y);else{re=o==="start"?k-v-L:o==="end"?k-ee+ne+X:o==="nearest"?Hr(v,ee,te,L,ne+X,k,k+A,A):k-(v+te/2)+X/2,ae=l==="start"?O-B-q:l==="center"?O-(B+J/2)+fe/2:l==="end"?O-W+U+fe:Hr(B,W,J,q,U+fe,O,O+_,_);const{scrollLeft:xe,scrollTop:Ae}=H;re=he===0?0:Math.max(0,Math.min(Ae+re/he,H.scrollHeight-te/he+X)),ae=be===0?0:Math.max(0,Math.min(xe+ae/be,H.scrollWidth-J/be+fe)),k+=Ae-re,O+=xe-ae}j.push({el:H,top:re,left:ae})}return j},R0=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function M0(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(zu(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:i,left:s}of zu(e,R0(t))){const o=i-n.top+n.bottom,l=s-n.left+n.right;a.scroll({top:o,left:l,behavior:r})}}var gn=[],I0=function(){return gn.some(function(e){return e.activeTargets.length>0})},$0=function(){return gn.some(function(e){return e.skippedTargets.length>0})},qu="ResizeObserver loop completed with undelivered notifications.",L0=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:qu}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=qu),window.dispatchEvent(e)},Ar;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Ar||(Ar={}));var vn=function(e){return Object.freeze(e)},z0=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,vn(this)}return e}(),xd=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,vn(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}(),Xs=function(e){return e instanceof SVGElement&&"getBBox"in e},wd=function(e){if(Xs(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)},Wu=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)},q0=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},vr=typeof window<"u"?window:{},Ur=new WeakMap,Hu=/auto|scroll/,W0=/^tb|vertical/,H0=/msie|trident/i.test(vr.navigator&&vr.navigator.userAgent),Ft=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 z0((n?t:e)||0,(n?e:t)||0)},Uu=vn({devicePixelContentBoxSize:qn(),borderBoxSize:qn(),contentBoxSize:qn(),contentRect:new xd(0,0,0,0)}),Ed=function(e,t){if(t===void 0&&(t=!1),Ur.has(e)&&!t)return Ur.get(e);if(wd(e))return Ur.set(e,Uu),Uu;var n=getComputedStyle(e),r=Xs(e)&&e.ownerSVGElement&&e.getBBox(),a=!H0&&n.boxSizing==="border-box",i=W0.test(n.writingMode||""),s=!r&&Hu.test(n.overflowY||""),o=!r&&Hu.test(n.overflowX||""),l=r?0:Ft(n.paddingTop),u=r?0:Ft(n.paddingRight),c=r?0:Ft(n.paddingBottom),h=r?0:Ft(n.paddingLeft),p=r?0:Ft(n.borderTopWidth),m=r?0:Ft(n.borderRightWidth),g=r?0:Ft(n.borderBottomWidth),f=r?0:Ft(n.borderLeftWidth),D=h+u,y=l+c,x=f+m,A=p+g,_=o?e.offsetHeight-A-e.clientHeight:0,E=s?e.offsetWidth-x-e.clientWidth:0,F=a?D+x:0,T=a?y+A:0,I=r?r.width:Ft(n.width)-F-E,R=r?r.height:Ft(n.height)-T-_,M=I+D+E+x,$=R+y+_+A,w=vn({devicePixelContentBoxSize:qn(Math.round(I*devicePixelRatio),Math.round(R*devicePixelRatio),i),borderBoxSize:qn(M,$,i),contentBoxSize:qn(I,R,i),contentRect:new xd(h,l,I,R)});return Ur.set(e,w),w},kd=function(e,t,n){var r=Ed(e,n),a=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case Ar.DEVICE_PIXEL_CONTENT_BOX:return s;case Ar.BORDER_BOX:return a;default:return i}},U0=function(){function e(t){var n=Ed(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=vn([n.borderBoxSize]),this.contentBoxSize=vn([n.contentBoxSize]),this.devicePixelContentBoxSize=vn([n.devicePixelContentBoxSize])}return e}(),_d=function(e){if(wd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},V0=function(){var e=1/0,t=[];gn.forEach(function(s){if(s.activeTargets.length!==0){var o=[];s.activeTargets.forEach(function(u){var c=new U0(u.target),h=_d(u.target);o.push(c),u.lastReportedSize=kd(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},Vu=function(e){gn.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(a){a.isActive()&&(_d(a.target)>e?n.activeTargets.push(a):n.skippedTargets.push(a))})})},K0=function(){var e=0;for(Vu(e);I0();)e=V0(),Vu(e);return $0()&&L0(),e>0},gi,Bd=[],Z0=function(){return Bd.splice(0).forEach(function(e){return e()})},Y0=function(e){if(!gi){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Z0()}).observe(n,r),gi=function(){n.textContent="".concat(t?t--:t++)}}Bd.push(e),gi()},G0=function(e){Y0(function(){requestAnimationFrame(e)})},la=0,Q0=function(){return!!la},J0=250,X0={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ku=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Zu=function(e){return e===void 0&&(e=0),Date.now()+e},vi=!1,eb=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=J0),!vi){vi=!0;var r=Zu(t);G0(function(){var a=!1;try{a=K0()}finally{if(vi=!1,t=r-Zu(),!Q0())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,X0)};document.body?n():vr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ku.forEach(function(n){return vr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ku.forEach(function(n){return vr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),ps=new eb,Yu=function(e){!la&&e>0&&ps.start(),la+=e,!la&&ps.stop()},tb=function(e){return!Xs(e)&&!q0(e)&&getComputedStyle(e).display==="inline"},nb=function(){function e(t,n){this.target=t,this.observedBox=n||Ar.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=kd(this.target,this.observedBox,!0);return tb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),rb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),Vr=new WeakMap,Gu=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Kr=function(){function e(){}return e.connect=function(t,n){var r=new rb(t,n);Vr.set(t,r)},e.observe=function(t,n,r){var a=Vr.get(t),i=a.observationTargets.length===0;Gu(a.observationTargets,n)<0&&(i&&gn.push(a),a.observationTargets.push(new nb(n,r&&r.box)),Yu(1),ps.schedule())},e.unobserve=function(t,n){var r=Vr.get(t),a=Gu(r.observationTargets,n),i=r.observationTargets.length===1;a>=0&&(i&&gn.splice(gn.indexOf(r),1),r.observationTargets.splice(a,1),Yu(-1))},e.disconnect=function(t){var n=this,r=Vr.get(t);r.observationTargets.slice().forEach(function(a){return n.unobserve(t,a.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),ab=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.");Kr.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(!Wu(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Kr.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(!Wu(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Kr.unobserve(this,t)},e.prototype.disconnect=function(){Kr.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});var ib=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),bi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ad={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:ib?"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 Zr=1;Zr<20;Zr++)eo["f"+Zr]=111+Zr;function Ka(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(s){return Fd(s,t)}),a=function(o){return r.some(function(l){return Td(l,o)})},i=n==null?a:a(n);return i}function sb(e,t){return Ka(e,t)}function ob(e,t){return Ka(e,{byKey:!0},t)}function Fd(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var s in bi)r[bi[s]]=!1;var o=!0,l=!1,u=void 0;try{for(var c=a[Symbol.iterator](),h;!(o=(h=c.next()).done);o=!0){var p=h.value,m=p.endsWith("?")&&p.length>1;m&&(p=p.slice(0,-1));var g=to(p),f=bi[g];if(p.length>1&&!f&&!Ad[p]&&!eo[g])throw new TypeError('Unknown modifier: "'+p+'"');(i===1||!f)&&(n?r.key=g:r.which=Sd(p)),f&&(r[f]=m?null:!0)}}catch(D){l=!0,u=D}finally{try{!o&&c.return&&c.return()}finally{if(l)throw u}}return r}function Td(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 Sd(e){e=to(e);var t=eo[e]||e.toUpperCase().charCodeAt(0);return t}function to(e){return e=e.toLowerCase(),e=Ad[e]||e,e}var ub=Ut.default=Ka,yi=Ut.isHotkey=Ka;Ut.isCodeHotkey=sb;Ut.isKeyHotkey=ob;Ut.parseHotkey=Fd;Ut.compareHotkey=Td;Ut.toKeyCode=Sd;Ut.toKeyName=to;function lb(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 Zn(e,t){if(e==null)return{};var n=lb(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 Fr(e){"@babel/helpers - typeof";return Fr=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},Fr(e)}function cb(e,t){if(Fr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function db(e){var t=cb(e,"string");return Fr(t)==="symbol"?t:String(t)}function xt(e,t,n){return t=db(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var no=C.createContext(null),on=()=>{var e=C.useContext(no);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},jd=parseInt(C.version.split(".")[0],10),fb=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Qu=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),ot=typeof navigator<"u"&&/Android/.test(navigator.userAgent),$n=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),mr=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),hb=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),Od=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),mb=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),pb=ot&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),gb=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),vb=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),bb=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),ca=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zt=(!mb||!pb)&&!hb&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",ro=new WeakMap,ao=new WeakMap,Pd=new WeakMap,da=new WeakMap,gs=new WeakMap,Tr=new WeakMap,bn=new WeakMap,ka=new WeakMap,Za=new WeakMap,vs=new WeakMap,en=new WeakMap,mn=new WeakMap,br=new WeakMap,bs=new WeakMap,io=new WeakMap,_t=new WeakMap,qt=new WeakMap,ct=new WeakMap,Gt=new WeakMap,Qt=new WeakMap,Nd=new WeakMap,Yn=Symbol("placeholder"),Rd=Symbol("mark-placeholder"),yb=globalThis.Text,so=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,Db=e=>nn(e)&&e.nodeType===8,Ct=e=>nn(e)&&e.nodeType===1,nn=e=>{var t=so(e);return!!t&&e instanceof t.Node},ys=e=>{var t=e&&e.anchorNode&&so(e.anchorNode);return!!t&&e instanceof t.Selection},Md=e=>nn(e)&&e.nodeType===3,Cb=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,xb=e=>{var[t,n]=e;if(Ct(t)&&t.childNodes.length){var r=n===t.childNodes.length,a=r?n-1:n;for([t,a]=Id(t,a,r?"backward":"forward"),r=a<n;Ct(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=Eb(t,i,r?"backward":"forward")}n=r&&t.textContent!=null?t.textContent.length:0}return[t,n]},wb=e=>{for(var t=e&&e.parentNode;t;){if(t.toString()==="[object ShadowRoot]")return!0;t=t.parentNode}return!1},Id=(e,t,n)=>{for(var{childNodes:r}=e,a=r[t],i=t,s=!1,o=!1;(Db(a)||Ct(a)&&a.childNodes.length===0||Ct(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]},Eb=(e,t,n)=>{var[r]=Id(e,t,n);return r},$d=e=>{var t="";if(Md(e)&&e.nodeValue)return e.nodeValue;if(Ct(e)){for(var n of Array.from(e.childNodes))t+=$d(n);var r=getComputedStyle(e).getPropertyValue("display");(r==="block"||r==="list"||e.tagName==="BR")&&(t+=`
103
- `)}return t},kb=/data-slate-fragment="(.+?)"/m,_b=e=>{var t=e.getData("text/html"),[,n]=t.match(kb)||[];return n},oo=(e,t,n)=>{var{target:r}=t;if(Ct(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:a}=Q.getWindow(e);if(a.contains(r))return Q.hasDOMNode(e,r,{editable:!0});var i=n.find(s=>{var{addedNodes:o,removedNodes:l}=s;for(var u of o)if(u===r||u.contains(r))return!0;for(var c of l)if(c===r||c.contains(r))return!0});return!i||i===t?!1:oo(e,i,n)},Bb=0;class Ab{constructor(){xt(this,"id",void 0),this.id="".concat(Bb++)}}var Q={androidPendingDiffs:e=>ct.get(e),androidScheduleFlush:e=>{var t;(t=io.get(e))===null||t===void 0||t()},blur:e=>{var t=Q.toDOMNode(e,e),n=Q.findDocumentOrShadowRoot(e);en.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=Q.findDocumentOrShadowRoot(e),r=n.getSelection();r&&r.rangeCount>0&&r.removeAllRanges(),t&&G.deselect(e)},findDocumentOrShadowRoot:e=>{var t=Q.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=Q.toSlateNode(e,t.target),s=Q.findPath(e,i);if(ce.isElement(i)&&b.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=b.point(e,s,{edge:l?"start":"end"}),c=l?b.before(e,u):b.after(e,u);if(c){var h=b.range(e,c);return h}}var p,{document:m}=Q.getWindow(e);if(m.caretRangeFromPoint)p=m.caretRangeFromPoint(n,r);else{var g=m.caretPositionFromPoint(n,r);g&&(p=m.createRange(),p.setStart(g.offsetNode,g.offset),p.setEnd(g.offsetNode,g.offset))}if(!p)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var f=Q.toSlateRange(e,p,{exactMatch:!1,suppressThrow:!1});return f},findKey:(e,t)=>{var n=ka.get(t);return n||(n=new Ab,ka.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var a=ao.get(r);if(a==null){if(b.isEditor(r))return n;break}var i=ro.get(r);if(i==null)break;n.unshift(i),r=a}throw new Error("Unable to find the path for Slate node: ".concat(Je.stringify(t)))},focus:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!en.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(()=>{Q.focus(t,{retries:n.retries-1})},10);return}var r=Q.toDOMNode(t,t),a=Q.findDocumentOrShadowRoot(t);if(a.activeElement!==r){if(t.selection&&a instanceof Document){var i=a.getSelection(),s=Q.toDOMRange(t,t.selection);i==null||i.removeAllRanges(),i==null||i.addRange(s)}t.selection||(G.select(t,b.start(t,[])),t.onChange()),en.set(t,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=Pd.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=Q.toDOMNode(t,t),s;try{s=Ct(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)=>nn(t)&&Q.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return b.hasPath(e,n.path)&&b.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>Q.hasEditableTarget(e,t)||Q.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>nn(t)&&Q.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!mn.get(e),isFocused:e=>!!en.get(e),isReadOnly:e=>!!vs.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(vs.get(e))return!1;var n=Q.hasTarget(e,t)&&Q.toSlateNode(e,t);return ce.isElement(n)&&b.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=Za.get(e),r=b.isEditor(t)?da.get(e):n==null?void 0:n.get(Q.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(Je.stringify(t)));return r},toDOMPoint:(e,t)=>{var[n]=b.node(e,t.path),r=Q.toDOMNode(e,n),a;b.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i="[data-slate-string], [data-slate-zero-width]",s=Array.from(r.querySelectorAll(i)),o=0,l=0;l<s.length;l++){var u=s[l],c=u.childNodes[0];if(!(c==null||c.textContent==null)){var{length:h}=c.textContent,p=u.getAttribute("data-slate-length"),m=p==null?h:parseInt(p,10),g=o+m,f=s[l+1];if(t.offset===g&&f!==null&&f!==void 0&&f.hasAttribute("data-slate-mark-placeholder")){var D,y=f.childNodes[0];a=[y instanceof yb?y:f,(D=f.textContent)!==null&&D!==void 0&&D.startsWith("\uFEFF")?1:0];break}if(t.offset<=g){var x=Math.min(h,Math.max(0,t.offset-o));a=[c,x];break}o=g}}if(!a)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(Je.stringify(t)));return a},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,a=V.isBackward(t),i=Q.toDOMPoint(e,n),s=V.isCollapsed(t)?i:Q.toDOMPoint(e,r),o=Q.getWindow(e),l=o.document.createRange(),[u,c]=a?s:i,[h,p]=a?i:s,m=Ct(u)?u:u.parentElement,g=!!m.getAttribute("data-slate-zero-width"),f=Ct(h)?h:h.parentElement,D=!!f.getAttribute("data-slate-zero-width");return l.setStart(u,g?1:c),l.setEnd(h,D?1:p),l},toSlateNode:(e,t)=>{var n=Ct(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Tr.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:xb(t),o=i.parentNode,l=null,u=0;if(o){var c,h,p=Q.toDOMNode(e,e),m=o.closest('[data-slate-void="true"]'),g=m&&p.contains(m)?m:null,f=o.closest("[data-slate-leaf]"),D=null;if(f){if(l=f.closest('[data-slate-node="text"]'),l){var y=Q.getWindow(e),x=y.document.createRange();x.setStart(l,0),x.setEnd(i,s);var A=x.cloneContents(),_=[...Array.prototype.slice.call(A.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(A.querySelectorAll("[contenteditable=false]"))];_.forEach(O=>{if(ot&&!r&&O.hasAttribute("data-slate-zero-width")&&O.textContent.length>0&&O.textContext!=="\uFEFF"){O.textContent.startsWith("\uFEFF")&&(O.textContent=O.textContent.slice(1));return}O.parentNode.removeChild(O)}),u=A.textContent.length,D=l}}else if(g){for(var E=g.querySelectorAll("[data-slate-leaf]"),F=0;F<E.length;F++){var T=E[F];if(Q.hasDOMNode(e,T)){f=T;break}}f?(l=f.closest('[data-slate-node="text"]'),D=f,u=D.textContent.length,D.querySelectorAll("[data-slate-zero-width]").forEach(O=>{u-=O.textContent.length})):u=1}D&&u===D.textContent.length&&ot&&D.getAttribute("data-slate-zero-width")==="z"&&(c=D.textContent)!==null&&c!==void 0&&c.startsWith("\uFEFF")&&(o.hasAttribute("data-slate-zero-width")||$n&&(h=D.textContent)!==null&&h!==void 0&&h.endsWith(`
102
+ */function Zo(e){return Object.prototype.toString.call(e)==="[object Object]"}function et(e){var t,n;return Zo(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(Zo(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var id=Symbol.for("immer-nothing"),Yo=Symbol.for("immer-draftable"),gt=Symbol.for("immer-state"),Um=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function dt(e,...t){if(process.env.NODE_ENV!=="production"){const n=Um[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 Kn=Object.getPrototypeOf;function yn(e){return!!e&&!!e[gt]}function Dn(e){var t;return e?sd(e)||Array.isArray(e)||!!e[Yo]||!!((t=e.constructor)!=null&&t[Yo])||Ua(e)||Va(e):!1}var Vm=Object.prototype.constructor.toString();function sd(e){if(!e||typeof e!="object")return!1;const t=Kn(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)===Vm}function Ca(e,t){Ha(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ha(e){const t=e[gt];return t?t.type_:Array.isArray(e)?1:Ua(e)?2:Va(e)?3:0}function ls(e,t){return Ha(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function od(e,t,n){const r=Ha(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Km(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ua(e){return e instanceof Map}function Va(e){return e instanceof Set}function cn(e){return e.copy_||e.base_}function cs(e,t){if(Ua(e))return new Map(e);if(Va(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&sd(e))return Kn(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[gt];let r=Reflect.ownKeys(n);for(let a=0;a<r.length;a++){const i=r[a],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Kn(e),n)}function Vs(e,t=!1){return Ka(e)||yn(e)||!Dn(e)||(Ha(e)>1&&(e.set=e.add=e.clear=e.delete=Zm),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Vs(r,!0))),e}function Zm(){dt(2)}function Ka(e){return Object.isFrozen(e)}var Ym={};function Cn(e){const t=Ym[e];return t||dt(0,e),t}var _r;function ud(){return _r}function Gm(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Go(e,t){t&&(Cn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ds(e){fs(e),e.drafts_.forEach(Qm),e.drafts_=null}function fs(e){e===_r&&(_r=e.parent_)}function Qo(e){return _r=Gm(_r,e)}function Qm(e){const t=e[gt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Jo(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[gt].modified_&&(ds(t),dt(4)),Dn(e)&&(e=xa(t,e),t.parent_||wa(t,e)),t.patches_&&Cn("Patches").generateReplacementPatches_(n[gt].base_,e,t.patches_,t.inversePatches_)):e=xa(t,n,[]),ds(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==id?e:void 0}function xa(e,t,n){if(Ka(t))return t;const r=t[gt];if(!r)return Ca(t,(a,i)=>Xo(e,r,t,a,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return wa(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),Ca(i,(o,l)=>Xo(e,r,a,o,l,n,s)),wa(e,a,!1),n&&e.patches_&&Cn("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Xo(e,t,n,r,a,i,s){if(process.env.NODE_ENV!=="production"&&a===n&&dt(5),yn(a)){const o=i&&t&&t.type_!==3&&!ls(t.assigned_,r)?i.concat(r):void 0,l=xa(e,a,o);if(od(n,r,l),yn(l))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if(Dn(a)&&!Ka(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;xa(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&wa(e,a)}}function wa(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Vs(t,n)}function Jm(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ud(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=Ks;n&&(a=[r],i=Br);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return r.draft_=o,r.revoke_=s,o}var Ks={get(e,t){if(t===gt)return e;const n=cn(e);if(!ls(n,t))return Xm(e,n,t);const r=n[t];return e.finalized_||!Dn(r)?r:r===di(e.base_,t)?(fi(e),e.copy_[t]=ms(r,e)):r},has(e,t){return t in cn(e)},ownKeys(e){return Reflect.ownKeys(cn(e))},set(e,t,n){const r=ld(cn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=di(cn(e),t),i=a==null?void 0:a[gt];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Km(n,a)&&(n!==void 0||ls(e.base_,t)))return!0;fi(e),hs(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 di(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,fi(e),hs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=cn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){dt(11)},getPrototypeOf(e){return Kn(e.base_)},setPrototypeOf(){dt(12)}},Br={};Ca(Ks,(e,t)=>{Br[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Br.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&dt(13),Br.set.call(this,e,t,void 0)};Br.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&dt(14),Ks.set.call(this,e[0],t,n,e[0])};function di(e,t){const n=e[gt];return(n?cn(n):e)[t]}function Xm(e,t,n){var a;const r=ld(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function ld(e,t){if(!(t in e))return;let n=Kn(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kn(n)}}function hs(e){e.modified_||(e.modified_=!0,e.parent_&&hs(e.parent_))}function fi(e){e.copy_||(e.copy_=cs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ep=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...u){return s.produce(l,c=>n.call(this,c,...u))}}typeof n!="function"&&dt(6),r!==void 0&&typeof r!="function"&&dt(7);let a;if(Dn(t)){const i=Qo(this),s=ms(t,void 0);let o=!0;try{a=n(s),o=!1}finally{o?ds(i):fs(i)}return Go(i,r),Jo(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===id&&(a=void 0),this.autoFreeze_&&Vs(a,!0),r){const i=[],s=[];Cn("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else dt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...o)=>this.produceWithPatches(s,l=>t(l,...o));let r,a;return[this.produce(t,n,(s,o)=>{r=s,a=o}),r,a]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Dn(e)||dt(8),yn(e)&&(e=tp(e));const t=Qo(this),n=ms(e,void 0);return n[gt].isManual_=!0,fs(t),n}finishDraft(e,t){const n=e&&e[gt];(!n||!n.isManual_)&&dt(9);const{scope_:r}=n;return Go(r,t),Jo(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=Cn("Patches").applyPatches_;return yn(e)?r(e,t):this.produce(e,a=>r(a,t))}};function ms(e,t){const n=Ua(e)?Cn("MapSet").proxyMap_(e,t):Va(e)?Cn("MapSet").proxySet_(e,t):Jm(e,t);return(t?t.scope_:ud()).drafts_.push(n),n}function tp(e){return yn(e)||dt(10,e),cd(e)}function cd(e){if(!Dn(e)||Ka(e))return e;const t=e[gt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=cs(e,!0);return Ca(n,(r,a)=>{od(n,r,cd(a))}),t&&(t.finalized_=!1),n}var vt=new ep,Zs=vt.produce;vt.produceWithPatches.bind(vt);vt.setAutoFreeze.bind(vt);vt.setUseStrictShallowCopy.bind(vt);vt.applyPatches.bind(vt);var eu=vt.createDraft.bind(vt),tu=vt.finishDraft.bind(vt),np={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=P.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},rp={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=Ee.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},ap={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=V.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},Ea=new WeakMap,ka=new WeakMap,gr=new WeakMap,dd=new WeakMap,nu=new WeakMap,ru=new WeakMap,au=new WeakMap,P={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=P.levels(e,t);return n?r=r.slice(1):r=r.slice(0,-1),r},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var a=e[r],i=t[r];if(a!==i)break;n.push(a)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),a=t.slice(0,n),i=e[n],s=t[n];return P.equals(r,a)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),a=t.slice(0,n);return P.equals(r,a)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),a=t.slice(0,n),i=e[n],s=t[n];return P.equals(r,a)&&i<s},equals(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return P.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&P.compare(e,t)===0},isBefore(e,t){return P.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&P.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&P.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&P.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&P.compare(e,t)===0},isPath(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="number")},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1),a=e[e.length-1],i=t[t.length-1];return a!==i&&P.equals(n,r)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=[],a=0;a<=e.length;a++)r.push(e.slice(0,a));return n&&r.reverse(),r},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!P.isAncestor(t,e)&&!P.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:a="forward"}=n;if(e.length===0)return r;switch(t.type){case"insert_node":{var{path:i}=t;(P.equals(i,r)||P.endsBefore(i,r)||P.isAncestor(i,r))&&(r[i.length-1]+=1);break}case"remove_node":{var{path:s}=t;if(P.equals(s,r)||P.isAncestor(s,r))return null;P.endsBefore(s,r)&&(r[s.length-1]-=1);break}case"merge_node":{var{path:o,position:l}=t;P.equals(o,r)||P.endsBefore(o,r)?r[o.length-1]-=1:P.isAncestor(o,r)&&(r[o.length-1]-=1,r[o.length]+=l);break}case"split_node":{var{path:u,position:c}=t;if(P.equals(u,r)){if(a==="forward")r[r.length-1]+=1;else if(a!=="backward")return null}else P.endsBefore(u,r)?r[u.length-1]+=1:P.isAncestor(u,r)&&e[u.length]>=c&&(r[u.length-1]+=1,r[u.length]-=c);break}case"move_node":{var{path:h,newPath:p}=t;if(P.equals(h,p))return r;if(P.isAncestor(h,r)||P.equals(h,r)){var m=p.slice();return P.endsBefore(h,p)&&h.length<p.length&&(m[h.length-1]-=1),m.concat(r.slice(h.length))}else P.isSibling(h,p)&&(P.isAncestor(p,r)||P.equals(p,r))?P.endsBefore(h,r)?r[h.length-1]-=1:r[h.length-1]+=1:P.endsBefore(p,r)||P.equals(p,r)||P.isAncestor(p,r)?(P.endsBefore(h,r)&&(r[h.length-1]-=1),r[p.length-1]+=1):P.endsBefore(h,r)&&(P.equals(p,r)&&(r[p.length-1]+=1),r[h.length-1]-=1);break}}return r}};function Ar(e){"@babel/helpers - typeof";return Ar=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},Ar(e)}function ip(e,t){if(Ar(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ar(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sp(e){var t=ip(e,"string");return Ar(t)==="symbol"?t:String(t)}function ut(e,t,n){return t=sp(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function or(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var op=(e,t,n)=>{switch(n.type){case"insert_node":{var{path:r,node:a}=n,i=oe.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 V.points(t))t[l]=Ee.transform(o,n);break}case"insert_text":{var{path:u,offset:c,text:h}=n;if(h.length===0)break;var p=oe.leaf(e,u),m=p.text.slice(0,c),g=p.text.slice(c);if(p.text=m+h+g,t)for(var[f,b]of V.points(t))t[b]=Ee.transform(f,n);break}case"merge_node":{var{path:y}=n,x=oe.get(e,y),A=P.previous(y),k=oe.get(e,A),w=oe.parent(e,y),F=y[y.length-1];if(de.isText(x)&&de.isText(k))k.text+=x.text;else if(!de.isText(x)&&!de.isText(k))k.children.push(...x.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(y,"] to nodes of different interfaces: ").concat(Je.stringify(x)," ").concat(Je.stringify(k)));if(w.children.splice(F,1),t)for(var[S,z]of V.points(t))t[z]=Ee.transform(S,n);break}case"move_node":{var{path:N,newPath:$}=n;if(P.isAncestor(N,$))throw new Error("Cannot move a path [".concat(N,"] to new path [").concat($,"] because the destination is inside itself."));var I=oe.get(e,N),E=oe.parent(e,N),B=N[N.length-1];E.children.splice(B,1);var T=P.transform(N,n),M=oe.get(e,P.parent(T)),R=T[T.length-1];if(M.children.splice(R,0,I),t)for(var[W,X]of V.points(t))t[X]=Ee.transform(W,n);break}case"remove_node":{var{path:G}=n,D=G[G.length-1],H=oe.parent(e,G);if(H.children.splice(D,1),t)for(var[te,_]of V.points(t)){var j=Ee.transform(te,n);if(t!=null&&j!=null)t[_]=j;else{var q=void 0,L=void 0;for(var[U,ne]of oe.texts(e))if(P.compare(ne,G)===-1)q=[U,ne];else{L=[U,ne];break}var re=!1;q&&L&&(P.equals(L[1],G)?re=!P.hasPrevious(L[1]):re=P.common(q[1],G).length<P.common(L[1],G).length),q&&!re?(te.path=q[1],te.offset=q[0].text.length):L?(te.path=L[1],te.offset=0):t=null}}break}case"remove_text":{var{path:ae,offset:fe,text:ee}=n;if(ee.length===0)break;var be=oe.leaf(e,ae),me=be.text.slice(0,fe),xe=be.text.slice(fe+ee.length);if(be.text=me+xe,t)for(var[Fe,Te]of V.points(t))t[Te]=Ee.transform(Fe,n);break}case"set_node":{var{path:Ke,properties:We,newProperties:He}=n;if(Ke.length===0)throw new Error("Cannot set properties on the root node!");var Qe=oe.get(e,Ke);for(var he in He){if(he==="children"||he==="text")throw new Error('Cannot set the "'.concat(he,'" property of nodes!'));var ke=He[he];ke==null?delete Qe[he]:Qe[he]=ke}for(var $e in We)He.hasOwnProperty($e)||delete Qe[$e];break}case"set_selection":{var{newProperties:K}=n;if(K==null)t=K;else{if(t==null){if(!V.isRange(K))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Je.stringify(K)," when there is no current selection."));t=or({},K)}for(var se in K){var pe=K[se];if(pe==null){if(se==="anchor"||se==="focus")throw new Error('Cannot remove the "'.concat(se,'" selection property'));delete t[se]}else t[se]=pe}}break}case"split_node":{var{path:ge,position:we,properties:Ye}=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 Ge=oe.get(e,ge),mt=oe.parent(e,ge),Mt=ge[ge.length-1],Et;if(de.isText(Ge)){var Xe=Ge.text.slice(0,we),At=Ge.text.slice(we);Ge.text=Xe,Et=or(or({},Ye),{},{text:At})}else{var pt=Ge.children.slice(0,we),ti=Ge.children.slice(we);Ge.children=pt,Et=or(or({},Ye),{},{children:ti})}if(mt.children.splice(Mt+1,0,Et),t)for(var[ar,$r]of V.points(t))t[$r]=Ee.transform(ar,n);break}}return t},up={transform(e,t){e.children=eu(e.children);var n=e.selection&&eu(e.selection);try{n=op(e,n,t)}finally{e.children=tu(e.children),n?e.selection=yn(n)?tu(n):n:e.selection=null}}},lp={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)}},cp={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)}},fd=(e,t)=>{for(var n in e){var r=e[n],a=t[n];if(et(r)&&et(a)){if(!fd(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 dp(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 Ht(e,t){if(e==null)return{};var n=dp(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 fp=["anchor","focus"];function su(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 hp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?su(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):su(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var V={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:a}=e;return V.isBackward(e)===n?[r,a]:[a,r]},end(e){var[,t]=V.edges(e);return t},equals(e,t){return Ee.equals(e.anchor,t.anchor)&&Ee.equals(e.focus,t.focus)},includes(e,t){if(V.isRange(t)){if(V.includes(e,t.anchor)||V.includes(e,t.focus))return!0;var[n,r]=V.edges(e),[a,i]=V.edges(t);return Ee.isBefore(n,a)&&Ee.isAfter(r,i)}var[s,o]=V.edges(e),l=!1,u=!1;return Ee.isPoint(t)?(l=Ee.compare(t,s)>=0,u=Ee.compare(t,o)<=0):(l=P.compare(t,s.path)>=0,u=P.compare(t,o.path)<=0),l&&u},intersection(e,t){var n=Ht(e,fp),[r,a]=V.edges(e),[i,s]=V.edges(t),o=Ee.isBefore(r,i)?i:r,l=Ee.isBefore(a,s)?a:s;return Ee.isBefore(l,o)?null:hp({anchor:o,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return Ee.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Ee.equals(t,n)},isExpanded(e){return!V.isCollapsed(e)},isForward(e){return!V.isBackward(e)},isRange(e){return et(e)&&Ee.isPoint(e.anchor)&&Ee.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=V.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zs(e,r=>{if(r===null)return null;var{affinity:a="inward"}=n,i,s;if(a==="inward"){var o=V.isCollapsed(r);V.isForward(r)?(i="forward",s=o?i:"backward"):(i="backward",s=o?i:"forward")}else a==="outward"?V.isForward(r)?(i="backward",s="forward"):(i="forward",s="backward"):(i=a,s=a);var l=Ee.transform(r.anchor,t,{affinity:i}),u=Ee.transform(r.focus,t,{affinity:s});if(!l||!u)return null;r.anchor=l,r.focus=u})}},ou=e=>et(e)&&oe.isNodeList(e.children)&&!v.isEditor(e),ce={isAncestor(e){return et(e)&&oe.isNodeList(e.children)},isElement:ou,isElementList(e){return Array.isArray(e)&&e.every(t=>ce.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 ou(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},mp=["children"],pp=["text"],uu=new WeakMap,oe={ancestor(e,t){var n=oe.get(e,t);if(de.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Je.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of P.ancestors(t,n)){var a=oe.ancestor(e,r),i=[a,r];yield i}}()},child(e,t){if(de.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Je.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Je.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=oe.ancestor(e,t),{children:i}=a,s=r?i.length-1:0;r?s>=0:s<i.length;){var o=oe.child(a,s),l=t.concat(s);yield[o,l],s=r?s-1:s+1}}()},common(e,t,n){var r=P.common(t,n),a=oe.get(e,r);return[a,r]},descendant(e,t){var n=oe.get(e,t);if(v.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Je.stringify(n)));return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of oe.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 oe.nodes(e,t))ce.isElement(n)&&(yield[n,r])}()},extractProps(e){if(ce.isAncestor(e)){var t=Ht(e,mp);return t}else{var t=Ht(e,pp);return t}},first(e,t){for(var n=t.slice(),r=oe.get(e,n);r&&!(de.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(de.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Je.stringify(e)));var n=Zs({children:e.children},r=>{var[a,i]=V.edges(t),s=oe.nodes(r,{reverse:!0,pass:p=>{var[,m]=p;return!V.includes(t,m)}});for(var[,o]of s){if(!V.includes(t,o)){var l=oe.parent(r,o),u=o[o.length-1];l.children.splice(u,1)}if(P.equals(o,i.path)){var c=oe.leaf(r,o);c.text=c.text.slice(0,i.offset)}if(P.equals(o,a.path)){var h=oe.leaf(r,o);h.text=h.text.slice(a.offset)}}v.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(de.isText(n)||!n.children[a])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Je.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(de.isText(n)||!n.children[a])return!1;n=n.children[a]}return!0},isNode(e){return de.isText(e)||ce.isElement(e)||v.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=uu.get(e);if(t!==void 0)return t;var n=e.every(r=>oe.isNode(r));return uu.set(e,n),n},last(e,t){for(var n=t.slice(),r=oe.get(e,n);r&&!(de.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=oe.get(e,t);if(!de.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Je.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of P.levels(t,n)){var a=oe.get(e,r);yield[a,r]}}()},matches(e,t){return ce.isElement(e)&&ce.isElementProps(t)&&ce.matches(e,t)||de.isText(e)&&de.isTextProps(t)&&de.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:a=[],to:i}=t,s=new Set,o=[],l=e;!(i&&(r?P.isBefore(o,i):P.isAfter(o,i)));){if(s.has(l)||(yield[l,o]),!s.has(l)&&!de.isText(l)&&l.children.length!==0&&(n==null||n([l,o])===!1)){s.add(l);var u=r?l.children.length-1:0;P.isAncestor(o,a)&&(u=a[o.length]),o=o.concat(u),l=oe.get(e,o);continue}if(o.length===0)break;if(!r){var c=P.next(o);if(oe.has(e,c)){o=c,l=oe.get(e,o);continue}}if(r&&o[o.length-1]!==0){var h=P.previous(o);o=h,l=oe.get(e,o);continue}o=P.parent(o),l=oe.get(e,o),s.add(l)}}()},parent(e,t){var n=P.parent(t),r=oe.get(e,n);if(de.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 de.isText(e)?e.text:e.children.map(oe.string).join("")},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of oe.nodes(e,t))de.isText(n)&&(yield[n,r])}()}};function lu(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 Le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Xt={isNodeOperation(e){return Xt.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!et(e))return!1;switch(e.type){case"insert_node":return P.isPath(e.path)&&oe.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&P.isPath(e.path);case"merge_node":return typeof e.position=="number"&&P.isPath(e.path)&&et(e.properties);case"move_node":return P.isPath(e.path)&&P.isPath(e.newPath);case"remove_node":return P.isPath(e.path)&&oe.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&P.isPath(e.path);case"set_node":return P.isPath(e.path)&&et(e.properties)&&et(e.newProperties);case"set_selection":return e.properties===null&&V.isRange(e.newProperties)||e.newProperties===null&&V.isRange(e.properties)||et(e.properties)&&et(e.newProperties);case"split_node":return P.isPath(e.path)&&typeof e.position=="number"&&et(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>Xt.isOperation(t))},isSelectionOperation(e){return Xt.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return Xt.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return Le(Le({},e),{},{type:"remove_node"});case"insert_text":return Le(Le({},e),{},{type:"remove_text"});case"merge_node":return Le(Le({},e),{},{type:"split_node",path:P.previous(e.path)});case"move_node":{var{newPath:t,path:n}=e;if(P.equals(t,n))return e;if(P.isSibling(n,t))return Le(Le({},e),{},{path:t,newPath:n});var r=P.transform(n,e),a=P.transform(P.next(n),e);return Le(Le({},e),{},{path:r,newPath:a})}case"remove_node":return Le(Le({},e),{},{type:"insert_node"});case"remove_text":return Le(Le({},e),{},{type:"insert_text"});case"set_node":{var{properties:i,newProperties:s}=e;return Le(Le({},e),{},{properties:s,newProperties:i})}case"set_selection":{var{properties:o,newProperties:l}=e;return o==null?Le(Le({},e),{},{properties:l,newProperties:null}):l==null?Le(Le({},e),{},{properties:null,newProperties:o}):Le(Le({},e),{},{properties:l,newProperties:o})}case"split_node":return Le(Le({},e),{},{type:"merge_node",path:P.next(e.path)})}}},cu=new WeakMap,gp=e=>{var t=cu.get(e);if(t!==void 0)return t;if(!et(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||et(e.marks))&&(e.selection===null||V.isRange(e.selection))&&oe.isNodeList(e.children)&&Xt.isOperationList(e.operations);return cu.set(e,n),n},v={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 gp(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)}},vp={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(P.isPath)}};function du(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 fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?du(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ee={compare(e,t){var n=P.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return Ee.compare(e,t)===1},isBefore(e,t){return Ee.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&P.equals(e.path,t.path)},isPoint(e){return et(e)&&typeof e.offset=="number"&&P.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zs(e,r=>{if(r===null)return null;var{affinity:a="forward"}=n,{path:i,offset:s}=r;switch(t.type){case"insert_node":case"move_node":{r.path=P.transform(i,t,n);break}case"insert_text":{P.equals(t.path,i)&&(t.offset<s||t.offset===s&&a==="forward")&&(r.offset+=t.text.length);break}case"merge_node":{P.equals(t.path,i)&&(r.offset+=t.position),r.path=P.transform(i,t,n);break}case"remove_text":{P.equals(t.path,i)&&t.offset<=s&&(r.offset-=Math.min(s-t.offset,t.text.length));break}case"remove_node":{if(P.equals(t.path,i)||P.isAncestor(t.path,i))return null;r.path=P.transform(i,t,n);break}case"split_node":{if(P.equals(t.path,i)){if(t.position===s&&a==null)return null;(t.position<s||t.position===s&&a==="forward")&&(r.offset-=t.position,r.path=P.transform(i,t,fu(fu({},n),{},{affinity:"forward"})))}else r.path=P.transform(i,t,n);break}}})}},hu=void 0,Je={setScrubber(e){hu=e},stringify(e){return JSON.stringify(e,hu)}},bp=["text"],yp=["anchor","focus"];function mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var de={equals(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:r=!1}=n;function a(i){var s=Ht(i,bp);return s}return fd(r?a(e):e,r?a(t):t)},isText(e){return et(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>de.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=[$t({},e)];for(var r of t){var a=Ht(r,yp),[i,s]=V.edges(r),o=[],l=0,u=i.offset,c=s.offset;for(var h of n){var{length:p}=h.text,m=l;if(l+=p,u<=m&&l<=c){Object.assign(h,a),o.push(h);continue}if(u!==c&&(u===l||c===m)||u>l||c<m||c===m&&m!==0){o.push(h);continue}var g=h,f=void 0,b=void 0;if(c<l){var y=c-m;b=$t($t({},g),{},{text:g.text.slice(y)}),g=$t($t({},g),{},{text:g.text.slice(0,y)})}if(u>m){var x=u-m;f=$t($t({},g),{},{text:g.text.slice(0,x)}),g=$t($t({},g),{},{text:g.text.slice(x)})}Object.assign(g,a),f&&o.push(f),o.push(g),b&&o.push(b)}n=o}return n}},Ys=e=>e.selection?e.selection:e.children.length>0?v.end(e,[]):[0],rr=(e,t)=>{var[n]=v.node(e,t);return r=>r===n},Gs=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,a=n?kp(t):t,i=Ce.None,s=Ce.None,o=0,l=null,u=null;for(var c of a){var h=c.codePointAt(0);if(!h)break;var p=Mp(c,h);if([i,s]=r?[s,p]:[p,i],Mn(i,Ce.ZWJ)&&Mn(s,Ce.ExtPict)&&(r?l=pu(t.substring(0,o)):l=pu(t.substring(0,t.length-o)),!l)||Mn(i,Ce.RI)&&Mn(s,Ce.RI)&&(u!==null?u=!u:r?u=!0:u=qp(t.substring(0,t.length-o)),!u)||i!==Ce.None&&s!==Ce.None&&$p(i,s))break;o+=c.length}return o||1},Dp=/\s/,Cp=/[\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]/,xp=/['\u2018\u2019]/,wp=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,a=!1;t.length>0;){var i=Gs(t,n),[s,o]=Qs(t,i,n);if(Ep(s,o,n))a=!0,r+=i;else if(!a)r+=i;else break;t=o}return r},Qs=(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)]},Ep=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(Dp.test(t))return!1;if(xp.test(t)){var a=Gs(n,r),[i,s]=Qs(n,a,r);if(e(i,s,r))return!0}return!Cp.test(t)},kp=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var a=t.charAt(n-r);if(Bp(a.charCodeAt(0))){var i=t.charAt(n-r-1);if(_p(i.charCodeAt(0))){yield i+a,r++;continue}}yield a}},_p=e=>e>=55296&&e<=56319,Bp=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 Ap=/^(?:[\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])$/,Fp=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Tp=/^(?:[\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])$/,Sp=/^[\u1100-\u115F\uA960-\uA97C]$/,jp=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Op=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Pp=/^[\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]$/,Np=/^[\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]$/,Rp=/^(?:[\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])$/,Mp=(e,t)=>{var n=Ce.Any;return e.search(Ap)!==-1&&(n|=Ce.Extend),t===8205&&(n|=Ce.ZWJ),t>=127462&&t<=127487&&(n|=Ce.RI),e.search(Fp)!==-1&&(n|=Ce.Prepend),e.search(Tp)!==-1&&(n|=Ce.SpacingMark),e.search(Sp)!==-1&&(n|=Ce.L),e.search(jp)!==-1&&(n|=Ce.V),e.search(Op)!==-1&&(n|=Ce.T),e.search(Pp)!==-1&&(n|=Ce.LV),e.search(Np)!==-1&&(n|=Ce.LVT),e.search(Rp)!==-1&&(n|=Ce.ExtPict),n};function Mn(e,t){return(e&t)!==0}var Ip=[[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 $p(e,t){return Ip.findIndex(n=>Mn(e,n[0])&&Mn(t,n[1]))===-1}var Lp=/(?:[\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$/,pu=e=>e.search(Lp)!==-1,zp=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,qp=e=>{var t=e.match(zp);if(t===null)return!1;var n=t[0].length/2;return n%2===1},Wp={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]:{};v.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:a=Ys(e)}=n;if(P.isPath(a)&&(a=v.range(e,a)),V.isRange(a))if(V.isCollapsed(a))a=a.anchor;else{var i=V.end(a);if(!r&&v.void(e,{at:i}))return;var s=V.start(a),o=v.pointRef(e,s),l=v.pointRef(e,i);Q.delete(e,{at:a,voids:r});var u=o.unref(),c=l.unref();a=u||c,Q.setSelection(e,{anchor:a,focus:a})}if(!(!r&&v.void(e,{at:a})||v.elementReadOnly(e,{at:a}))){var{path:h,offset:p}=a;t.length>0&&e.apply({type:"insert_text",path:h,offset:p,text:t})}})}};function gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Q=Hr(Hr(Hr(Hr({},up),lp),cp),Wp),la=new WeakMap,Hp=e=>la.get(e)||!1,Up=(e,t,n)=>{var r=la.get(e)||!1;la.set(e,!0);try{t(),n()}finally{la.set(e,r)}};function hd(e,t,n){var r=Ea.get(e)||[],a=ka.get(e)||new Set,i,s,o=h=>{if(h){var p=h.join(",");s.has(p)||(s.add(p),i.push(h))}};if(n){i=[],s=new Set;for(var l of r){var u=n(l);o(u)}}else i=r,s=a;for(var c of t)o(c);Ea.set(e,i),ka.set(e,s)}var Vp=(e,t)=>{for(var n of v.pathRefs(e))np.transform(n,t);for(var r of v.pointRefs(e))rp.transform(r,t);for(var a of v.rangeRefs(e))ap.transform(a,t);if(!Hp(e)){var i=P.operationCanTransformPath(t)?s=>P.transform(s,t):void 0;hd(e,e.getDirtyPaths(t),i)}Q.transform(e,t),e.operations.push(t),v.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),gr.get(e)||(gr.set(e,!0),Promise.resolve().then(()=>{gr.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},Kp=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:n}=t;return P.levels(n)}case"insert_node":{var{node:r,path:a}=t,i=P.levels(a),s=de.isText(r)?[]:Array.from(oe.nodes(r),$=>{var[,I]=$;return a.concat(I)});return[...i,...s]}case"merge_node":{var{path:o}=t,l=P.ancestors(o),u=P.previous(o);return[...l,u]}case"move_node":{var{path:c,newPath:h}=t;if(P.equals(c,h))return[];var p=[],m=[];for(var g of P.ancestors(c)){var f=P.transform(g,t);p.push(f)}for(var b of P.ancestors(h)){var y=P.transform(b,t);m.push(y)}var x=m[m.length-1],A=h[h.length-1],k=x.concat(A);return[...p,...m,k]}case"remove_node":{var{path:w}=t,F=P.ancestors(w);return[...F]}case"split_node":{var{path:S}=t,z=P.levels(S),N=P.next(S);return[...z,N]}default:return[]}},Zp=e=>{var{selection:t}=e;return t?oe.fragment(e,t):[]},Yp=(e,t)=>{var[n,r]=t;if(!de.isText(n)){if(ce.isElement(n)&&n.children.length===0){var a={text:""};Q.insertNodes(e,a,{at:r.concat(0),voids:!0});return}for(var i=v.isEditor(n)?!1:ce.isElement(n)&&(e.isInline(n)||n.children.length===0||de.isText(n.children[0])||e.isInline(n.children[0])),s=0,o=0;o<n.children.length;o++,s++){var l=oe.get(e,r);if(!de.isText(l)){var u=l.children[s],c=l.children[s-1],h=o===n.children.length-1,p=de.isText(u)||ce.isElement(u)&&e.isInline(u);if(p!==i)Q.removeNodes(e,{at:r.concat(s),voids:!0}),s--;else if(ce.isElement(u)){if(e.isInline(u)){if(c==null||!de.isText(c)){var m={text:""};Q.insertNodes(e,m,{at:r.concat(s),voids:!0}),s++}else if(h){var g={text:""};Q.insertNodes(e,g,{at:r.concat(s+1),voids:!0}),s++}}}else c!=null&&de.isText(c)&&(de.equals(u,c,{loose:!0})?(Q.mergeNodes(e,{at:r.concat(s),voids:!0}),s--):c.text===""?(Q.removeNodes(e,{at:r.concat(s-1),voids:!0}),s--):u.text===""&&(Q.removeNodes(e,{at:r.concat(s),voids:!0}),s--))}}}},Gp=(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},Qp=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=v.path(t,i),l=a==="lowest";for(var[u,c]of v.levels(t,{at:o,voids:r,match:s,reverse:l}))if(!de.isText(u)){if(V.isRange(i)){if(P.isAncestor(c,i.anchor.path)&&P.isAncestor(c,i.focus.path))return[u,c]}else if(!P.equals(o,c))return[u,c]}}};function 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 bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Jp=(e,t,n)=>{var{selection:r}=e;if(r){var a=(h,p)=>{if(!de.isText(h))return!1;var[m,g]=v.parent(e,p);return!e.isVoid(m)||e.markableVoid(m)},i=V.isExpanded(r),s=!1;if(!i){var[o,l]=v.node(e,r);if(o&&a(o,l)){var[u]=v.parent(e,l);s=u&&e.markableVoid(u)}}if(i||s)Q.setNodes(e,{[t]:n},{match:a,split:!0,voids:!0});else{var c=bu(bu({},v.marks(e)||{}),{},{[t]:n});e.marks=c,gr.get(e)||e.onChange()}}};function yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Xp=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=v.point(t,n,{edge:"end"}),i=v.end(t,[]),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of v.positions(t,Du(Du({},r),{},{at:s}))){if(l>o)break;l!==0&&(u=c),l++}return u};function Cu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var eg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=v.start(t,[]),i=v.point(t,n,{edge:"start"}),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of v.positions(t,xu(xu({},r),{},{at:s,reverse:!0}))){if(l>o)break;l!==0&&(u=c),l++}return u},tg=(e,t)=>{var{selection:n}=e;n&&V.isCollapsed(n)&&Q.delete(e,{unit:t,reverse:!0})},ng=(e,t)=>{var{selection:n}=e;n&&V.isCollapsed(n)&&Q.delete(e,{unit:t})},rg=function(t){var{direction:n="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t;r&&V.isExpanded(r)&&Q.delete(t,{reverse:n==="backward"})},ag=(e,t)=>[v.start(e,t),v.end(e,t)];function wu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function 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){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ig=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v.above(t,Eu(Eu({},n),{},{match:r=>ce.isElement(r)&&v.isElementReadOnly(t,r)}))},sg=(e,t)=>v.point(e,t,{edge:"end"}),og=(e,t)=>{var n=v.path(e,t,{edge:"start"});return v.node(e,n)},ug=(e,t)=>{var n=v.range(e,t);return oe.fragment(e,n)};function ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ku(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ku(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var lg=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v.above(t,_u(_u({},n),{},{match:r=>ce.isElement(r)&&v.isVoid(t,r)}))},cg=(e,t)=>t.children.some(n=>ce.isElement(n)&&v.isBlock(e,n)),dg=(e,t)=>t.children.some(n=>de.isText(n)||v.isInline(e,n)),fg=(e,t)=>oe.has(e,t),hg=(e,t)=>t.children.every(n=>de.isText(n)),mg=e=>{Q.splitNodes(e,{always:!0})},pg=(e,t,n)=>{Q.insertNodes(e,t,n)},gg=e=>{Q.splitNodes(e,{always:!0})};function Bu(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 vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var bg=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=vg({text:n},i);Q.insertNodes(t,s,{at:r.at,voids:r.voids})}else Q.insertText(t,n,r);t.marks=null}},yg=(e,t)=>!e.isInline(t),Dg=(e,t,n)=>v.isStart(e,t,n)||v.isEnd(e,t,n),Cg=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&de.isText(r)&&r.text===""&&!e.isVoid(t)},xg=(e,t,n)=>{var r=v.end(e,n);return Ee.equals(t,r)},wg=e=>{var t=dd.get(e);return t===void 0?!0:t},Eg=(e,t,n)=>{if(t.offset!==0)return!1;var r=v.start(e,n);return Ee.equals(t,r)},kg=(e,t)=>{var n=v.path(e,t,{edge:"end"});return v.node(e,n)},_g=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=v.path(t,n,r),i=oe.leaf(t,a);return[i,a]};function Bg(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=v.path(e,n);for(var[l,u]of oe.levels(e,o))if(i(l,u)&&(s.push([l,u]),!a&&ce.isElement(l)&&v.isVoid(e,l)))break;r&&s.reverse(),yield*s}}()}var Ag=["text"],Fg=["text"],Tg=function(t){var{marks:n,selection:r}=t;if(!r)return null;var{anchor:a,focus:i}=r;if(n)return n;if(V.isExpanded(r)){var s=v.isEnd(t,a,a.path);if(s){var o=v.after(t,a);o&&(a=o)}var[l]=v.nodes(t,{match:de.isText,at:{anchor:a,focus:i}});if(l){var[u]=l,c=Ht(u,Ag);return c}else return{}}var{path:h}=a,[p]=v.leaf(t,h);if(a.offset===0){var m=v.previous(t,{at:h,match:de.isText}),g=v.above(t,{match:k=>ce.isElement(k)&&v.isVoid(t,k)&&t.markableVoid(k)});if(!g){var f=v.above(t,{match:k=>ce.isElement(k)&&v.isBlock(t,k)});if(m&&f){var[b,y]=m,[,x]=f;P.isAncestor(x,y)&&(p=b)}}}var A=Ht(p,Fg);return A},Sg=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=v.after(t,s,{voids:a});if(o){var[,l]=v.last(t,[]),u=[o.path,l];if(P.isPath(s)&&s.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(P.isPath(s)){var[c]=v.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=v.nodes(t,{at:u,match:i,mode:r,voids:a});return h}}},jg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=v.path(t,n,r),i=oe.get(t,a);return[i,a]};function Og(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:a=!1,reverse:i=!1,voids:s=!1,ignoreNonSelectable:o=!1}=t,{match:l}=t;if(l||(l=()=>!0),!!n){var u,c;if(vp.isSpan(n))u=n[0],c=n[1];else{var h=v.path(e,n,{edge:"start"}),p=v.path(e,n,{edge:"end"});u=i?p:h,c=i?h:p}var m=oe.nodes(e,{reverse:i,from:u,to:c,pass:k=>{var[w]=k;return ce.isElement(w)?!!(!s&&(v.isVoid(e,w)||v.isElementReadOnly(e,w))||o&&!v.isSelectable(e,w)):!1}}),g=[],f;for(var[b,y]of m)if(!(o&&ce.isElement(b)&&!v.isSelectable(e,b))){var x=f&&P.compare(y,f[1])===0;if(!(r==="highest"&&x)){if(!l(b,y)){if(a&&!x&&de.isText(b))return;continue}if(r==="lowest"&&x){f=[b,y];continue}var A=r==="lowest"?f:[b,y];A&&(a?g.push(A):yield A),f=[b,y]}}r==="lowest"&&f&&(a?g.push(f):yield f),a&&(yield*g)}}()}var Pg=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:a}=n,i=c=>Ea.get(c)||[],s=c=>ka.get(c)||new Set,o=c=>{var h=i(c).pop(),p=h.join(",");return s(c).delete(p),h};if(v.isNormalizing(t)){if(r){var l=Array.from(oe.nodes(t),c=>{var[,h]=c;return h}),u=new Set(l.map(c=>c.join(",")));Ea.set(t,l),ka.set(t,u)}i(t).length!==0&&v.withoutNormalizing(t,()=>{for(var c of i(t))if(oe.has(t,c)){var h=v.node(t,c),[p,m]=h;ce.isElement(p)&&p.children.length===0&&t.normalizeNode(h,{operation:a})}for(var g=i(t),f=g.length,b=0;g.length!==0;){if(!t.shouldNormalize({dirtyPaths:g,iteration:b,initialDirtyPathsLength:f,operation:a}))return;var y=o(t);if(oe.has(t,y)){var x=v.node(t,y);t.normalizeNode(x,{operation:a})}b++,g=i(t)}})}},Ng=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=v.path(t,n,r),i=P.parent(a),s=v.node(t,i);return s},Rg=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=v.pathRefs(t);return l.delete(i),i.current=null,o}},s=v.pathRefs(t);return s.add(i),i},Mg=e=>{var t=nu.get(e);return t||(t=new Set,nu.set(e,t)),t},Ig=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:a,edge:i}=r;if(P.isPath(n)){if(i==="start"){var[,s]=oe.first(t,n);n=s}else if(i==="end"){var[,o]=oe.last(t,n);n=o}}return V.isRange(n)&&(i==="start"?n=V.start(n):i==="end"?n=V.end(n):n=P.common(n.anchor.path,n.focus.path)),Ee.isPoint(n)&&(n=n.path),a!=null&&(n=n.slice(0,a)),n},$g=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=v.pointRefs(t);return l.delete(i),i.current=null,o}},s=v.pointRefs(t);return s.add(i),i},Lg=e=>{var t=ru.get(e);return t||(t=new Set,ru.set(e,t)),t},zg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:a="start"}=r;if(P.isPath(n)){var i;if(a==="end"){var[,s]=oe.last(t,n);i=s}else{var[,o]=oe.first(t,n);i=o}var l=oe.get(t,i);if(!de.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(V.isRange(n)){var[u,c]=V.edges(n);return a==="start"?u:c}return n};function qg(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=v.range(e,n),[l,u]=V.edges(o),c=a?u:l,h=!1,p="",m=0,g=0,f=0;for(var[b,y]of v.nodes(e,{at:n,reverse:a,voids:i,ignoreNonSelectable:s})){if(ce.isElement(b)){if(!i&&(e.isVoid(b)||e.isElementReadOnly(b))){yield v.start(e,y);continue}if(e.isInline(b))continue;if(v.hasInlines(e,b)){var x=P.isAncestor(y,u.path)?u:v.end(e,y),A=P.isAncestor(y,l.path)?l:v.start(e,y);p=v.string(e,{anchor:A,focus:x},{voids:i}),h=!0}}if(de.isText(b)){var k=P.equals(y,c.path);for(k?(g=a?c.offset:b.text.length-c.offset,f=c.offset):(g=b.text.length,f=a?g:0),(k||h||r==="offset")&&(yield{path:y,offset:f},h=!1);;){if(m===0){if(p==="")break;m=w(p,r,a),p=Qs(p,m,a)[1]}if(f=a?f-m:f+m,g=g-m,g<0){m=-g;break}m=0,yield{path:y,offset:f}}}}function w(F,S,z){return S==="character"?Gs(F,z):S==="word"?wp(F,z):S==="line"||S==="block"?F.length:1}}()}var Wg=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=v.before(t,s,{voids:a});if(o){var[,l]=v.first(t,[]),u=[o.path,l];if(P.isPath(s)&&s.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(P.isPath(s)){var[c]=v.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=v.nodes(t,{reverse:!0,at:u,match:i,mode:r,voids:a});return h}}},Hg=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=v.rangeRefs(t);return l.delete(i),i.current=null,o}},s=v.rangeRefs(t);return s.add(i),i},Ug=e=>{var t=au.get(e);return t||(t=new Set,au.set(e,t)),t},Vg=(e,t,n)=>{if(V.isRange(t)&&!n)return t;var r=v.start(e,t),a=v.end(e,n||t);return{anchor:r,focus:a}};function Au(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 Kg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Au(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Au(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Zg=(e,t)=>{var{selection:n}=e;if(n){var r=(c,h)=>{if(!de.isText(c))return!1;var[p,m]=v.parent(e,h);return!e.isVoid(p)||e.markableVoid(p)},a=V.isExpanded(n),i=!1;if(!a){var[s,o]=v.node(e,n);if(s&&r(s,o)){var[l]=v.parent(e,o);i=l&&e.markableVoid(l)}}if(a||i)Q.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var u=Kg({},v.marks(e)||{});delete u[t],e.marks=u,gr.get(e)||e.onChange()}}},Yg=(e,t)=>{dd.set(e,t)},Gg=(e,t)=>v.point(e,t,{edge:"start"}),Qg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,i=v.range(t,n),[s,o]=V.edges(i),l="";for(var[u,c]of v.nodes(t,{at:i,match:de.isText,voids:a})){var h=u.text;P.equals(c,o.path)&&(h=h.slice(0,o.offset)),P.equals(c,s.path)&&(h=h.slice(s.offset)),l+=h}return l},Jg=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,[i,s]=V.edges(n);if(i.offset!==0||s.offset!==0||V.isCollapsed(n)||P.hasPrevious(s.path))return n;var o=v.above(t,{at:s,match:g=>ce.isElement(g)&&v.isBlock(t,g),voids:a}),l=o?o[1]:[],u=v.start(t,i),c={anchor:u,focus:s},h=!0;for(var[p,m]of v.nodes(t,{at:c,match:de.isText,reverse:!0,voids:a})){if(h){h=!1;continue}if(p.text!==""||P.isBefore(m,l)){s={path:m,offset:p.text.length};break}}return{anchor:i,focus:s}},Xg=(e,t)=>{var n=v.isNormalizing(e);v.setNormalizing(e,!1);try{t()}finally{v.setNormalizing(e,n)}v.normalize(e)},ev=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v.withoutNormalizing(t,()=>{var r,a,{reverse:i=!1,unit:s="character",distance:o=1,voids:l=!1}=n,{at:u=t.selection,hanging:c=!1}=n;if(u){var h=!1;if(V.isRange(u)&&V.isCollapsed(u)&&(h=!0,u=u.anchor),Ee.isPoint(u)){var p=v.void(t,{at:u,mode:"highest"});if(!l&&p){var[,m]=p;u=m}else{var g={unit:s,distance:o},f=i?v.before(t,u,g)||v.start(t,[]):v.after(t,u,g)||v.end(t,[]);u={anchor:u,focus:f},c=!0}}if(P.isPath(u)){Q.removeNodes(t,{at:u,voids:l});return}if(!V.isCollapsed(u)){if(!c){var[,b]=V.edges(u),y=v.end(t,[]);Ee.equals(b,y)||(u=v.unhangRange(t,u,{voids:l}))}var[x,A]=V.edges(u),k=v.above(t,{match:me=>ce.isElement(me)&&v.isBlock(t,me),at:x,voids:l}),w=v.above(t,{match:me=>ce.isElement(me)&&v.isBlock(t,me),at:A,voids:l}),F=k&&w&&!P.equals(k[1],w[1]),S=P.equals(x.path,A.path),z=l?null:(r=v.void(t,{at:x,mode:"highest"}))!==null&&r!==void 0?r:v.elementReadOnly(t,{at:x,mode:"highest"}),N=l?null:(a=v.void(t,{at:A,mode:"highest"}))!==null&&a!==void 0?a:v.elementReadOnly(t,{at:A,mode:"highest"});if(z){var $=v.before(t,x);$&&k&&P.isAncestor(k[1],$.path)&&(x=$)}if(N){var I=v.after(t,A);I&&w&&P.isAncestor(w[1],I.path)&&(A=I)}var E=[],B;for(var T of v.nodes(t,{at:u,voids:l})){var[M,R]=T;B&&P.compare(R,B)===0||(!l&&ce.isElement(M)&&(v.isVoid(t,M)||v.isElementReadOnly(t,M))||!P.isCommon(R,x.path)&&!P.isCommon(R,A.path))&&(E.push(T),B=R)}var W=Array.from(E,me=>{var[,xe]=me;return v.pathRef(t,xe)}),X=v.pointRef(t,x),G=v.pointRef(t,A),D="";if(!S&&!z){var H=X.current,[te]=v.leaf(t,H),{path:_}=H,{offset:j}=x,q=te.text.slice(j);q.length>0&&(t.apply({type:"remove_text",path:_,offset:j,text:q}),D=q)}if(W.reverse().map(me=>me.unref()).filter(me=>me!==null).forEach(me=>Q.removeNodes(t,{at:me,voids:l})),!N){var L=G.current,[U]=v.leaf(t,L),{path:ne}=L,re=S?x.offset:0,ae=U.text.slice(re,A.offset);ae.length>0&&(t.apply({type:"remove_text",path:ne,offset:re,text:ae}),D=ae)}!S&&F&&G.current&&X.current&&Q.mergeNodes(t,{at:G.current,hanging:!0,voids:l}),h&&i&&s==="character"&&D.length>1&&D.match(/[\u0E00-\u0E7F]+/)&&Q.insertText(t,D.slice(0,D.length-o));var fe=X.unref(),ee=G.unref(),be=i?fe||ee:ee||fe;n.at==null&&be&&Q.select(t,be)}}})},tv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};v.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1}=r,{at:s=Ys(t),batchDirty:o=!0}=r;if(n.length){if(V.isRange(s))if(a||(s=v.unhangRange(t,s,{voids:i})),V.isCollapsed(s))s=s.anchor;else{var[,l]=V.edges(s);if(!i&&v.void(t,{at:l}))return;var u=v.pointRef(t,l);Q.delete(t,{at:s}),s=u.unref()}else P.isPath(s)&&(s=v.start(t,s));if(!(!i&&v.void(t,{at:s}))){var c=v.above(t,{at:s,match:q=>ce.isElement(q)&&v.isInline(t,q),mode:"highest",voids:i});if(c){var[,h]=c;if(v.isEnd(t,s,h)){var p=v.after(t,h);s=p}else if(v.isStart(t,s,h)){var m=v.before(t,h);s=m}}var g=v.above(t,{match:q=>ce.isElement(q)&&v.isBlock(t,q),at:s,voids:i}),[,f]=g,b=v.isStart(t,s,f),y=v.isEnd(t,s,f),x=b&&y,A=!b||b&&y,k=!y,[,w]=oe.first({children:n},[]),[,F]=oe.last({children:n},[]),S=[],z=q=>{var[L,U]=q,ne=U.length===0;return ne?!1:x?!0:!(A&&P.isAncestor(U,w)&&ce.isElement(L)&&!t.isVoid(L)&&!t.isInline(L)||k&&P.isAncestor(U,F)&&ce.isElement(L)&&!t.isVoid(L)&&!t.isInline(L))};for(var N of oe.nodes({children:n},{pass:z}))z(N)&&S.push(N);var $=[],I=[],E=[],B=!0,T=!1;for(var[M]of S)ce.isElement(M)&&!t.isInline(M)?(B=!1,T=!0,I.push(M)):B?$.push(M):E.push(M);var[R]=v.nodes(t,{at:s,match:q=>de.isText(q)||v.isInline(t,q),mode:"highest",voids:i}),[,W]=R,X=v.isStart(t,s,W),G=v.isEnd(t,s,W),D=v.pathRef(t,y&&!E.length?P.next(f):f),H=v.pathRef(t,G?P.next(W):W);Q.splitNodes(t,{at:s,match:q=>T?ce.isElement(q)&&v.isBlock(t,q):de.isText(q)||v.isInline(t,q),mode:T?"lowest":"highest",always:T&&(!b||$.length>0)&&(!y||E.length>0),voids:i});var te=v.pathRef(t,!X||X&&G?P.next(W):W);if(Q.insertNodes(t,$,{at:te.current,match:q=>de.isText(q)||v.isInline(t,q),mode:"highest",voids:i,batchDirty:o}),x&&!$.length&&I.length&&!E.length&&Q.delete(t,{at:f,voids:i}),Q.insertNodes(t,I,{at:D.current,match:q=>ce.isElement(q)&&v.isBlock(t,q),mode:"lowest",voids:i,batchDirty:o}),Q.insertNodes(t,E,{at:H.current,match:q=>de.isText(q)||v.isInline(t,q),mode:"highest",voids:i,batchDirty:o}),!r.at){var _;if(E.length>0&&H.current?_=P.previous(H.current):I.length>0&&D.current?_=P.previous(D.current):te.current&&(_=P.previous(te.current)),_){var j=v.end(t,_);Q.select(t,j)}}te.unref(),D.unref(),H.unref()}}})},nv=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")Q.select(t,a.anchor);else if(r==="focus")Q.select(t,a.focus);else if(r==="start"){var[i]=V.edges(a);Q.select(t,i)}else if(r==="end"){var[,s]=V.edges(a);Q.select(t,s)}}else return},rv=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},av=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=V.isBackward(r)?"focus":"anchor"),o==="end"&&(o=V.isBackward(r)?"anchor":"focus");var{anchor:l,focus:u}=r,c={distance:a,unit:i,ignoreNonSelectable:!0},h={};if(o==null||o==="anchor"){var p=s?v.before(t,l,c):v.after(t,l,c);p&&(h.anchor=p)}if(o==null||o==="focus"){var m=s?v.before(t,u,c):v.after(t,u,c);m&&(h.focus=m)}Q.setSelection(t,h)}},iv=(e,t)=>{var{selection:n}=e;if(t=v.range(e,t),n){Q.setSelection(e,t);return}if(!V.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(Je.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})};function Fu(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 Tu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var sv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:a}=t,{edge:i="both"}=r;if(a){i==="start"&&(i=V.isBackward(a)?"focus":"anchor"),i==="end"&&(i=V.isBackward(a)?"anchor":"focus");var{anchor:s,focus:o}=a,l=i==="anchor"?s:o;Q.setSelection(t,{[i==="anchor"?"anchor":"focus"]:Tu(Tu({},l),n)})}},ov=(e,t)=>{var{selection:n}=e,r={},a={};if(n){for(var i in t)(i==="anchor"&&t.anchor!=null&&!Ee.equals(t.anchor,n.anchor)||i==="focus"&&t.focus!=null&&!Ee.equals(t.focus,n.focus)||i!=="anchor"&&i!=="focus"&&t[i]!==n[i])&&(r[i]=n[i],a[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:a})}},uv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};v.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1,mode:s="lowest",batchDirty:o=!0}=r,{at:l,match:u,select:c}=r;if(oe.isNode(n)&&(n=[n]),n.length!==0){var[h]=n;if(l||(l=Ys(t),c!==!1&&(c=!0)),c==null&&(c=!1),V.isRange(l))if(a||(l=v.unhangRange(t,l,{voids:i})),V.isCollapsed(l))l=l.anchor;else{var[,p]=V.edges(l),m=v.pointRef(t,p);Q.delete(t,{at:l}),l=m.unref()}if(Ee.isPoint(l)){u==null&&(de.isText(h)?u=$=>de.isText($):t.isInline(h)?u=$=>de.isText($)||v.isInline(t,$):u=$=>ce.isElement($)&&v.isBlock(t,$));var[g]=v.nodes(t,{at:l.path,match:u,mode:s,voids:i});if(g){var[,f]=g,b=v.pathRef(t,f),y=v.isEnd(t,l,f);Q.splitNodes(t,{at:l,match:u,mode:s,voids:i});var x=b.unref();l=y?P.next(x):x}else return}var A=P.parent(l),k=l[l.length-1];if(!(!i&&v.void(t,{at:A}))){if(o){var w=[],F=P.levels(A);Up(t,()=>{var $=function(){var B=A.concat(k);k++;var T={type:"insert_node",path:B,node:I};t.apply(T),l=P.next(l),w.push(T),de.isText?F.push(...Array.from(oe.nodes(I),M=>{var[,R]=M;return B.concat(R)})):F.push(B)};for(var I of n)$()},()=>{hd(t,F,$=>{var I=$;for(var E of w)if(P.operationCanTransformPath(E)&&(I=P.transform(I,E),!I))return null;return I})})}else for(var S of n){var z=A.concat(k);k++,t.apply({type:"insert_node",path:z,node:S}),l=P.next(l)}if(l=P.previous(l),c){var N=v.end(t,l);N&&Q.select(t,N)}}}})},lv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v.withoutNormalizing(t,()=>{var{at:r=t.selection,mode:a="lowest",voids:i=!1}=n,{match:s}=n;if(s==null&&(s=P.isPath(r)?rr(t,r):k=>ce.isElement(k)&&v.isBlock(t,k)),!!r){var o=v.nodes(t,{at:r,match:s,mode:a,voids:i}),l=Array.from(o,k=>{var[,w]=k;return v.pathRef(t,w)});for(var u of l){var c=u.unref();if(c.length<2)throw new Error("Cannot lift node at a path [".concat(c,"] because it has a depth of less than `2`."));var h=v.node(t,P.parent(c)),[p,m]=h,g=c[c.length-1],{length:f}=p.children;if(f===1){var b=P.next(m);Q.moveNodes(t,{at:c,to:b,voids:i}),Q.removeNodes(t,{at:m,voids:i})}else if(g===0)Q.moveNodes(t,{at:c,to:m,voids:i});else if(g===f-1){var y=P.next(m);Q.moveNodes(t,{at:c,to:y,voids:i})}else{var x=P.next(c),A=P.next(m);Q.splitNodes(t,{at:x,voids:i}),Q.moveNodes(t,{at:c,to:A,voids:i})}}}})},cv=["text"],dv=["children"],md=(e,t)=>{if(ce.isElement(t)){var n=t;return v.isVoid(e,t)?!0:n.children.length===1?md(e,n.children[0]):!1}else return!v.isEditor(t)},fv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v.withoutNormalizing(t,()=>{var{match:r,at:a=t.selection}=n,{hanging:i=!1,voids:s=!1,mode:o="lowest"}=n;if(a){if(r==null)if(P.isPath(a)){var[l]=v.parent(t,a);r=$=>l.children.includes($)}else r=$=>ce.isElement($)&&v.isBlock(t,$);if(!i&&V.isRange(a)&&(a=v.unhangRange(t,a,{voids:s})),V.isRange(a))if(V.isCollapsed(a))a=a.anchor;else{var[,u]=V.edges(a),c=v.pointRef(t,u);Q.delete(t,{at:a}),a=c.unref(),n.at==null&&Q.select(t,a)}var[h]=v.nodes(t,{at:a,match:r,voids:s,mode:o}),p=v.previous(t,{at:a,match:r,voids:s,mode:o});if(!(!h||!p)){var[m,g]=h,[f,b]=p;if(!(g.length===0||b.length===0)){var y=P.next(b),x=P.common(g,b),A=P.isSibling(g,b),k=Array.from(v.levels(t,{at:g}),$=>{var[I]=$;return I}).slice(x.length).slice(0,-1),w=v.above(t,{at:g,mode:"highest",match:$=>k.includes($)&&md(t,$)}),F=w&&v.pathRef(t,w[1]),S,z;if(de.isText(m)&&de.isText(f)){var N=Ht(m,cv);z=f.text.length,S=N}else if(ce.isElement(m)&&ce.isElement(f)){var N=Ht(m,dv);z=f.children.length,S=N}else throw new Error("Cannot merge the node at path [".concat(g,"] with the previous sibling because it is not the same kind: ").concat(Je.stringify(m)," ").concat(Je.stringify(f)));A||Q.moveNodes(t,{at:g,to:y,voids:s}),F&&Q.removeNodes(t,{at:F.current,voids:s}),ce.isElement(f)&&v.isEmpty(t,f)||de.isText(f)&&f.text===""&&b[b.length-1]!==0?Q.removeNodes(t,{at:b,voids:s}):t.apply({type:"merge_node",path:y,position:z,properties:S}),F&&F.unref()}}}})},hv=(e,t)=>{v.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:a="lowest",voids:i=!1}=t,{match:s}=t;if(r){s==null&&(s=P.isPath(r)?rr(e,r):m=>ce.isElement(m)&&v.isBlock(e,m));var o=v.pathRef(e,n),l=v.nodes(e,{at:r,match:s,mode:a,voids:i}),u=Array.from(l,m=>{var[,g]=m;return v.pathRef(e,g)});for(var c of u){var h=c.unref(),p=o.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:p}),o.current&&P.isSibling(p,h)&&P.isAfter(p,h)&&(o.current=P.next(o.current))}o.unref()}})},mv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v.withoutNormalizing(t,()=>{var{hanging:r=!1,voids:a=!1,mode:i="lowest"}=n,{at:s=t.selection,match:o}=n;if(s){o==null&&(o=P.isPath(s)?rr(t,s):m=>ce.isElement(m)&&v.isBlock(t,m)),!r&&V.isRange(s)&&(s=v.unhangRange(t,s,{voids:a}));var l=v.nodes(t,{at:s,match:o,mode:i,voids:a}),u=Array.from(l,m=>{var[,g]=m;return v.pathRef(t,g)});for(var c of u){var h=c.unref();if(h){var[p]=v.node(t,h);t.apply({type:"remove_node",path:h,node:p})}}}})},pv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};v.withoutNormalizing(t,()=>{var{match:a,at:i=t.selection,compare:s,merge:o}=r,{hanging:l=!1,mode:u="lowest",split:c=!1,voids:h=!1}=r;if(i){if(a==null&&(a=P.isPath(i)?rr(t,i):z=>ce.isElement(z)&&v.isBlock(t,z)),!l&&V.isRange(i)&&(i=v.unhangRange(t,i,{voids:h})),c&&V.isRange(i)){if(V.isCollapsed(i)&&v.leaf(t,i.anchor)[0].text.length>0)return;var p=v.rangeRef(t,i,{affinity:"inward"}),[m,g]=V.edges(i),f=u==="lowest"?"lowest":"highest",b=v.isEnd(t,g,g.path);Q.splitNodes(t,{at:g,match:a,mode:f,voids:h,always:!b});var y=v.isStart(t,m,m.path);Q.splitNodes(t,{at:m,match:a,mode:f,voids:h,always:!y}),i=p.unref(),r.at==null&&Q.select(t,i)}s||(s=(z,N)=>z!==N);for(var[x,A]of v.nodes(t,{at:i,match:a,mode:u,voids:h})){var k={},w={};if(A.length!==0){var F=!1;for(var S in n)S==="children"||S==="text"||s(n[S],x[S])&&(F=!0,x.hasOwnProperty(S)&&(k[S]=x[S]),o?n[S]!=null&&(w[S]=o(x[S],n[S])):n[S]!=null&&(w[S]=n[S]));F&&t.apply({type:"set_node",path:A,properties:k,newProperties:w})}}}})},gv=(e,t)=>{if(V.isCollapsed(t))return t.anchor;var[,n]=V.edges(t),r=v.pointRef(e,n);return Q.delete(e,{at:t}),r.unref()},vv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v.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=G=>ce.isElement(G)&&v.isBlock(t,G)),V.isRange(s)&&(s=gv(t,s)),P.isPath(s)){var u=s,c=v.point(t,u),[h]=v.parent(t,u);i=G=>G===h,o=c.path.length-u.length+1,s=c,l=!0}if(s){var p=v.pointRef(t,s,{affinity:"backward"}),m;try{var[g]=v.nodes(t,{at:s,match:i,mode:r,voids:a});if(!g)return;var f=v.void(t,{at:s,mode:"highest"}),b=0;if(!a&&f){var[y,x]=f;if(ce.isElement(y)&&t.isInline(y)){var A=v.after(t,x);if(!A){var k={text:""},w=P.next(x);Q.insertNodes(t,k,{at:w,voids:a}),A=v.point(t,w)}s=A,l=!0}var F=s.path.length-x.length;o=F+1,l=!0}m=v.pointRef(t,s);var S=s.path.length-o,[,z]=g,N=s.path.slice(0,S),$=o===0?s.offset:s.path[S]+b;for(var[I,E]of v.levels(t,{at:N,reverse:!0,voids:a})){var B=!1;if(E.length<z.length||E.length===0||!a&&ce.isElement(I)&&v.isVoid(t,I))break;var T=p.current,M=v.isEnd(t,T,E);if(l||!p||!v.isEdge(t,T,E)){B=!0;var R=oe.extractProps(I);t.apply({type:"split_node",path:E,position:$,properties:R})}$=E[E.length-1]+(B||M?1:0)}if(n.at==null){var W=m.current||v.end(t,[]);Q.select(t,W)}}finally{var X;p.unref(),(X=m)===null||X===void 0||X.unref()}}})},bv=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;Q.setNodes(t,a,r)},yv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v.withoutNormalizing(t,()=>{var{mode:r="lowest",split:a=!1,voids:i=!1}=n,{at:s=t.selection,match:o}=n;if(s){o==null&&(o=P.isPath(s)?rr(t,s):m=>ce.isElement(m)&&v.isBlock(t,m)),P.isPath(s)&&(s=v.range(t,s));var l=V.isRange(s)?v.rangeRef(t,s):null,u=v.nodes(t,{at:s,match:o,mode:r,voids:i}),c=Array.from(u,m=>{var[,g]=m;return v.pathRef(t,g)}).reverse(),h=function(){var g=p.unref(),[f]=v.node(t,g),b=v.range(t,g);a&&l&&(b=V.intersection(l.current,b)),Q.liftNodes(t,{at:b,match:y=>ce.isAncestor(f)&&f.children.includes(y),voids:i})};for(var p of c)h();l&&l.unref()}})};function Su(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Su(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Su(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Dv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};v.withoutNormalizing(t,()=>{var{mode:a="lowest",split:i=!1,voids:s=!1}=r,{match:o,at:l=t.selection}=r;if(l){if(o==null&&(P.isPath(l)?o=rr(t,l):t.isInline(n)?o=b=>ce.isElement(b)&&v.isInline(t,b)||de.isText(b):o=b=>ce.isElement(b)&&v.isBlock(t,b)),i&&V.isRange(l)){var[u,c]=V.edges(l),h=v.rangeRef(t,l,{affinity:"inward"});Q.splitNodes(t,{at:c,match:o,voids:s}),Q.splitNodes(t,{at:u,match:o,voids:s}),l=h.unref(),r.at==null&&Q.select(t,l)}var p=Array.from(v.nodes(t,{at:l,match:t.isInline(n)?b=>ce.isElement(b)&&v.isBlock(t,b):b=>v.isEditor(b),mode:"lowest",voids:s})),m=function(){var y=V.isRange(l)?V.intersection(l,v.range(t,f)):l;if(!y)return 0;var x=Array.from(v.nodes(t,{at:y,match:o,mode:a,voids:s}));if(x.length>0){var[A]=x,k=x[x.length-1],[,w]=A,[,F]=k;if(w.length===0&&F.length===0)return 0;var S=P.equals(w,F)?P.parent(w):P.common(w,F),z=v.range(t,w,F),N=v.node(t,S),[$]=N,I=S.length+1,E=P.next(F.slice(0,I)),B=ju(ju({},n),{},{children:[]});Q.insertNodes(t,B,{at:E,voids:s}),Q.moveNodes(t,{at:z,match:T=>ce.isAncestor($)&&$.children.includes(T),to:E.concat(0),voids:s})}},g;for(var[,f]of p)g=m()}})},Cv=()=>{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 Vp(e,...r)},addMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jp(e,...r)},deleteBackward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return tg(e,...r)},deleteForward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ng(e,...r)},deleteFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return rg(e,...r)},getFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zp(e,...r)},insertBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return mg(e,...r)},insertSoftBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return gg(e,...r)},insertFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return tv(e,...r)},insertNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return pg(e,...r)},insertText:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return bg(e,...r)},normalizeNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yp(e,...r)},removeMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zg(e,...r)},getDirtyPaths:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Kp(e,...r)},shouldNormalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gp(e,...r)},above:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qp(e,...r)},after:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xp(e,...r)},before:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return eg(e,...r)},collapse:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return nv(e,...r)},delete:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ev(e,...r)},deselect:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return rv(e,...r)},edges:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ag(e,...r)},elementReadOnly:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ig(e,...r)},end:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return sg(e,...r)},first:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return og(e,...r)},fragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ug(e,...r)},getMarks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Tg(e,...r)},hasBlocks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return cg(e,...r)},hasInlines:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return dg(e,...r)},hasPath:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return fg(e,...r)},hasTexts:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return hg(e,...r)},insertNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return uv(e,...r)},isBlock:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return yg(e,...r)},isEdge:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Dg(e,...r)},isEmpty:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Cg(e,...r)},isEnd:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return xg(e,...r)},isNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return wg(e,...r)},isStart:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Eg(e,...r)},last:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return kg(e,...r)},leaf:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return _g(e,...r)},levels:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Bg(e,...r)},liftNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return lv(e,...r)},mergeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return fv(e,...r)},move:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return av(e,...r)},moveNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return hv(e,...r)},next:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Sg(e,...r)},node:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return jg(e,...r)},nodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Og(e,...r)},normalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Pg(e,...r)},parent:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ng(e,...r)},path:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ig(e,...r)},pathRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Rg(e,...r)},pathRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Mg(e,...r)},point:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return zg(e,...r)},pointRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return $g(e,...r)},pointRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Lg(e,...r)},positions:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return qg(e,...r)},previous:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Wg(e,...r)},range:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Vg(e,...r)},rangeRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Hg(e,...r)},rangeRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ug(e,...r)},removeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return mv(e,...r)},select:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return iv(e,...r)},setNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return pv(e,...r)},setNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yg(e,...r)},setPoint:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return sv(e,...r)},setSelection:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ov(e,...r)},splitNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return vv(e,...r)},start:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gg(e,...r)},string:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qg(e,...r)},unhangRange:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jg(e,...r)},unsetNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return bv(e,...r)},unwrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return yv(e,...r)},void:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return lg(e,...r)},withoutNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xg(e,...r)},wrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Dv(e,...r)}};return e},xv={isHistory(e){return et(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||Xt.isOperationList(e.redos[0].operations))&&(e.undos.length===0||Xt.isOperationList(e.undos[0].operations))}},hi=new WeakMap,mi=new WeakMap,In={isHistoryEditor(e){return xv.isHistory(e.history)&&v.isEditor(e)},isMerging(e){return mi.get(e)},isSaving(e){return hi.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=In.isMerging(e);mi.set(e,!1),t(),mi.set(e,n)},withoutSaving(e,t){var n=In.isSaving(e);hi.set(e,!1),t(),hi.set(e,n)}},wv=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&&Q.setSelection(t,i.selectionBefore),In.withoutSaving(t,()=>{v.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];In.withoutSaving(t,()=>{v.withoutNormalizing(t,()=>{var s=i.operations.map(Xt.inverse).reverse();for(var o of s)t.apply(o);i.selectionBefore&&Q.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=In.isSaving(t),c=In.isMerging(t);if(u==null&&(u=kv(r)),u){if(c==null&&(o==null?c=!1:a.length!==0?c=!0:c=Ev(r,l)),o&&c)o.operations.push(r);else{var h={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",h)}for(;s.length>100;)s.shift();i.redos=[]}n(r)},t.writeHistory=(r,a)=>{t.history[r].push(a)},t},Ev=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&P.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&P.equals(e.path,t.path)),kv=(e,t)=>e.type!=="set_selection",_v=Fv,pd="֑-߿יִ-﷽ﹰ-ﻼ",gd="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Bv=new RegExp("^[^"+gd+"]*["+pd+"]"),Av=new RegExp("^[^"+pd+"]*["+gd+"]");function Fv(e){return e=String(e||""),Bv.test(e)?"rtl":Av.test(e)?"ltr":"neutral"}const vd=wn(_v);function Tv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Js=Tv,Sv=typeof Lr=="object"&&Lr&&Lr.Object===Object&&Lr,jv=Sv,Ov=jv,Pv=typeof self=="object"&&self&&self.Object===Object&&self,Nv=Ov||Pv||Function("return this")(),bd=Nv,Rv=bd,Mv=function(){return Rv.Date.now()},Iv=Mv,$v=/\s/;function Lv(e){for(var t=e.length;t--&&$v.test(e.charAt(t)););return t}var zv=Lv,qv=zv,Wv=/^\s+/;function Hv(e){return e&&e.slice(0,qv(e)+1).replace(Wv,"")}var Uv=Hv,Vv=bd,Kv=Vv.Symbol,yd=Kv,Ou=yd,Dd=Object.prototype,Zv=Dd.hasOwnProperty,Yv=Dd.toString,ur=Ou?Ou.toStringTag:void 0;function Gv(e){var t=Zv.call(e,ur),n=e[ur];try{e[ur]=void 0;var r=!0}catch{}var a=Yv.call(e);return r&&(t?e[ur]=n:delete e[ur]),a}var Qv=Gv,Jv=Object.prototype,Xv=Jv.toString;function e0(e){return Xv.call(e)}var t0=e0,Pu=yd,n0=Qv,r0=t0,a0="[object Null]",i0="[object Undefined]",Nu=Pu?Pu.toStringTag:void 0;function s0(e){return e==null?e===void 0?i0:a0:Nu&&Nu in Object(e)?n0(e):r0(e)}var o0=s0;function u0(e){return e!=null&&typeof e=="object"}var l0=u0,c0=o0,d0=l0,f0="[object Symbol]";function h0(e){return typeof e=="symbol"||d0(e)&&c0(e)==f0}var m0=h0,p0=Uv,Ru=Js,g0=m0,Mu=0/0,v0=/^[-+]0x[0-9a-f]+$/i,b0=/^0b[01]+$/i,y0=/^0o[0-7]+$/i,D0=parseInt;function C0(e){if(typeof e=="number")return e;if(g0(e))return Mu;if(Ru(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ru(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=p0(e);var n=b0.test(e);return n||y0.test(e)?D0(e.slice(2),n?2:8):v0.test(e)?Mu:+e}var x0=C0,w0=Js,pi=Iv,Iu=x0,E0="Expected a function",k0=Math.max,_0=Math.min;function B0(e,t,n){var r,a,i,s,o,l,u=0,c=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(E0);t=Iu(t)||0,w0(n)&&(c=!!n.leading,h="maxWait"in n,i=h?k0(Iu(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function m(F){var S=r,z=a;return r=a=void 0,u=F,s=e.apply(z,S),s}function g(F){return u=F,o=setTimeout(y,t),c?m(F):s}function f(F){var S=F-l,z=F-u,N=t-S;return h?_0(N,i-z):N}function b(F){var S=F-l,z=F-u;return l===void 0||S>=t||S<0||h&&z>=i}function y(){var F=pi();if(b(F))return x(F);o=setTimeout(y,f(F))}function x(F){return o=void 0,p&&r?m(F):(r=a=void 0,s)}function A(){o!==void 0&&clearTimeout(o),u=0,r=l=a=o=void 0}function k(){return o===void 0?s:x(pi())}function w(){var F=pi(),S=b(F);if(r=arguments,a=this,l=F,S){if(o===void 0)return g(l);if(h)return clearTimeout(o),o=setTimeout(y,t),m(l)}return o===void 0&&(o=setTimeout(y,t)),s}return w.cancel=A,w.flush=k,w}var Cd=B0;const A0=wn(Cd);var F0=Cd,T0=Js,S0="Expected a function";function j0(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(S0);return T0(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),F0(e,t,{leading:r,maxWait:t,trailing:a})}var O0=j0;const P0=wn(O0),$u=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Lu=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",gi=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Lu(n.overflowY,t)||Lu(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},Ur=(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,N0=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},zu=(e,t)=>{var n,r,a,i;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,h=typeof u=="function"?u:R=>R!==u;if(!$u(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,m=[];let g=e;for(;$u(g)&&h(g);){if(g=N0(g),g===p){m.push(g);break}g!=null&&g===document.body&&gi(g)&&!gi(document.documentElement)||g!=null&&gi(g,c)&&m.push(g)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,b=(i=(a=window.visualViewport)==null?void 0:a.height)!=null?i:innerHeight,{scrollX:y,scrollY:x}=window,{height:A,width:k,top:w,right:F,bottom:S,left:z}=e.getBoundingClientRect(),{top:N,right:$,bottom:I,left:E}=(R=>{const W=window.getComputedStyle(R);return{top:parseFloat(W.scrollMarginTop)||0,right:parseFloat(W.scrollMarginRight)||0,bottom:parseFloat(W.scrollMarginBottom)||0,left:parseFloat(W.scrollMarginLeft)||0}})(e);let B=o==="start"||o==="nearest"?w-N:o==="end"?S+I:w+A/2-N+I,T=l==="center"?z+k/2-E+$:l==="end"?F+$:z-E;const M=[];for(let R=0;R<m.length;R++){const W=m[R],{height:X,width:G,top:D,right:H,bottom:te,left:_}=W.getBoundingClientRect();if(s==="if-needed"&&w>=0&&z>=0&&S<=b&&F<=f&&w>=D&&S<=te&&z>=_&&F<=H)return M;const j=getComputedStyle(W),q=parseInt(j.borderLeftWidth,10),L=parseInt(j.borderTopWidth,10),U=parseInt(j.borderRightWidth,10),ne=parseInt(j.borderBottomWidth,10);let re=0,ae=0;const fe="offsetWidth"in W?W.offsetWidth-W.clientWidth-q-U:0,ee="offsetHeight"in W?W.offsetHeight-W.clientHeight-L-ne:0,be="offsetWidth"in W?W.offsetWidth===0?0:G/W.offsetWidth:0,me="offsetHeight"in W?W.offsetHeight===0?0:X/W.offsetHeight:0;if(p===W)re=o==="start"?B:o==="end"?B-b:o==="nearest"?Ur(x,x+b,b,L,ne,x+B,x+B+A,A):B-b/2,ae=l==="start"?T:l==="center"?T-f/2:l==="end"?T-f:Ur(y,y+f,f,q,U,y+T,y+T+k,k),re=Math.max(0,re+x),ae=Math.max(0,ae+y);else{re=o==="start"?B-D-L:o==="end"?B-te+ne+ee:o==="nearest"?Ur(D,te,X,L,ne+ee,B,B+A,A):B-(D+X/2)+ee/2,ae=l==="start"?T-_-q:l==="center"?T-(_+G/2)+fe/2:l==="end"?T-H+U+fe:Ur(_,H,G,q,U+fe,T,T+k,k);const{scrollLeft:xe,scrollTop:Fe}=W;re=me===0?0:Math.max(0,Math.min(Fe+re/me,W.scrollHeight-X/me+ee)),ae=be===0?0:Math.max(0,Math.min(xe+ae/be,W.scrollWidth-G/be+fe)),B+=Fe-re,T+=xe-ae}M.push({el:W,top:re,left:ae})}return M},R0=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function M0(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(zu(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:i,left:s}of zu(e,R0(t))){const o=i-n.top+n.bottom,l=s-n.left+n.right;a.scroll({top:o,left:l,behavior:r})}}var gn=[],I0=function(){return gn.some(function(e){return e.activeTargets.length>0})},$0=function(){return gn.some(function(e){return e.skippedTargets.length>0})},qu="ResizeObserver loop completed with undelivered notifications.",L0=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:qu}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=qu),window.dispatchEvent(e)},Fr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Fr||(Fr={}));var vn=function(e){return Object.freeze(e)},z0=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,vn(this)}return e}(),xd=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,vn(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}(),Xs=function(e){return e instanceof SVGElement&&"getBBox"in e},wd=function(e){if(Xs(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)},Wu=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)},q0=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},vr=typeof window<"u"?window:{},Vr=new WeakMap,Hu=/auto|scroll/,W0=/^tb|vertical/,H0=/msie|trident/i.test(vr.navigator&&vr.navigator.userAgent),Ft=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 z0((n?t:e)||0,(n?e:t)||0)},Uu=vn({devicePixelContentBoxSize:qn(),borderBoxSize:qn(),contentBoxSize:qn(),contentRect:new xd(0,0,0,0)}),Ed=function(e,t){if(t===void 0&&(t=!1),Vr.has(e)&&!t)return Vr.get(e);if(wd(e))return Vr.set(e,Uu),Uu;var n=getComputedStyle(e),r=Xs(e)&&e.ownerSVGElement&&e.getBBox(),a=!H0&&n.boxSizing==="border-box",i=W0.test(n.writingMode||""),s=!r&&Hu.test(n.overflowY||""),o=!r&&Hu.test(n.overflowX||""),l=r?0:Ft(n.paddingTop),u=r?0:Ft(n.paddingRight),c=r?0:Ft(n.paddingBottom),h=r?0:Ft(n.paddingLeft),p=r?0:Ft(n.borderTopWidth),m=r?0:Ft(n.borderRightWidth),g=r?0:Ft(n.borderBottomWidth),f=r?0:Ft(n.borderLeftWidth),b=h+u,y=l+c,x=f+m,A=p+g,k=o?e.offsetHeight-A-e.clientHeight:0,w=s?e.offsetWidth-x-e.clientWidth:0,F=a?b+x:0,S=a?y+A:0,z=r?r.width:Ft(n.width)-F-w,N=r?r.height:Ft(n.height)-S-k,$=z+b+w+x,I=N+y+k+A,E=vn({devicePixelContentBoxSize:qn(Math.round(z*devicePixelRatio),Math.round(N*devicePixelRatio),i),borderBoxSize:qn($,I,i),contentBoxSize:qn(z,N,i),contentRect:new xd(h,l,z,N)});return Vr.set(e,E),E},kd=function(e,t,n){var r=Ed(e,n),a=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case Fr.DEVICE_PIXEL_CONTENT_BOX:return s;case Fr.BORDER_BOX:return a;default:return i}},U0=function(){function e(t){var n=Ed(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=vn([n.borderBoxSize]),this.contentBoxSize=vn([n.contentBoxSize]),this.devicePixelContentBoxSize=vn([n.devicePixelContentBoxSize])}return e}(),_d=function(e){if(wd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},V0=function(){var e=1/0,t=[];gn.forEach(function(s){if(s.activeTargets.length!==0){var o=[];s.activeTargets.forEach(function(u){var c=new U0(u.target),h=_d(u.target);o.push(c),u.lastReportedSize=kd(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},Vu=function(e){gn.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(a){a.isActive()&&(_d(a.target)>e?n.activeTargets.push(a):n.skippedTargets.push(a))})})},K0=function(){var e=0;for(Vu(e);I0();)e=V0(),Vu(e);return $0()&&L0(),e>0},vi,Bd=[],Z0=function(){return Bd.splice(0).forEach(function(e){return e()})},Y0=function(e){if(!vi){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Z0()}).observe(n,r),vi=function(){n.textContent="".concat(t?t--:t++)}}Bd.push(e),vi()},G0=function(e){Y0(function(){requestAnimationFrame(e)})},ca=0,Q0=function(){return!!ca},J0=250,X0={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ku=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Zu=function(e){return e===void 0&&(e=0),Date.now()+e},bi=!1,eb=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=J0),!bi){bi=!0;var r=Zu(t);G0(function(){var a=!1;try{a=K0()}finally{if(bi=!1,t=r-Zu(),!Q0())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,X0)};document.body?n():vr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ku.forEach(function(n){return vr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ku.forEach(function(n){return vr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),ps=new eb,Yu=function(e){!ca&&e>0&&ps.start(),ca+=e,!ca&&ps.stop()},tb=function(e){return!Xs(e)&&!q0(e)&&getComputedStyle(e).display==="inline"},nb=function(){function e(t,n){this.target=t,this.observedBox=n||Fr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=kd(this.target,this.observedBox,!0);return tb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),rb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),Kr=new WeakMap,Gu=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Zr=function(){function e(){}return e.connect=function(t,n){var r=new rb(t,n);Kr.set(t,r)},e.observe=function(t,n,r){var a=Kr.get(t),i=a.observationTargets.length===0;Gu(a.observationTargets,n)<0&&(i&&gn.push(a),a.observationTargets.push(new nb(n,r&&r.box)),Yu(1),ps.schedule())},e.unobserve=function(t,n){var r=Kr.get(t),a=Gu(r.observationTargets,n),i=r.observationTargets.length===1;a>=0&&(i&&gn.splice(gn.indexOf(r),1),r.observationTargets.splice(a,1),Yu(-1))},e.disconnect=function(t){var n=this,r=Kr.get(t);r.observationTargets.slice().forEach(function(a){return n.unobserve(t,a.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),ab=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.");Zr.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(!Wu(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Zr.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(!Wu(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Zr.unobserve(this,t)},e.prototype.disconnect=function(){Zr.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});var ib=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),yi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ad={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:ib?"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 Yr=1;Yr<20;Yr++)eo["f"+Yr]=111+Yr;function Za(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(s){return Fd(s,t)}),a=function(o){return r.some(function(l){return Td(l,o)})},i=n==null?a:a(n);return i}function sb(e,t){return Za(e,t)}function ob(e,t){return Za(e,{byKey:!0},t)}function Fd(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var s in yi)r[yi[s]]=!1;var o=!0,l=!1,u=void 0;try{for(var c=a[Symbol.iterator](),h;!(o=(h=c.next()).done);o=!0){var p=h.value,m=p.endsWith("?")&&p.length>1;m&&(p=p.slice(0,-1));var g=to(p),f=yi[g];if(p.length>1&&!f&&!Ad[p]&&!eo[g])throw new TypeError('Unknown modifier: "'+p+'"');(i===1||!f)&&(n?r.key=g:r.which=Sd(p)),f&&(r[f]=m?null:!0)}}catch(b){l=!0,u=b}finally{try{!o&&c.return&&c.return()}finally{if(l)throw u}}return r}function Td(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 Sd(e){e=to(e);var t=eo[e]||e.toUpperCase().charCodeAt(0);return t}function to(e){return e=e.toLowerCase(),e=Ad[e]||e,e}var ub=Ut.default=Za,Di=Ut.isHotkey=Za;Ut.isCodeHotkey=sb;Ut.isKeyHotkey=ob;Ut.parseHotkey=Fd;Ut.compareHotkey=Td;Ut.toKeyCode=Sd;Ut.toKeyName=to;function lb(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 Zn(e,t){if(e==null)return{};var n=lb(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 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 cb(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)}function db(e){var t=cb(e,"string");return Tr(t)==="symbol"?t:String(t)}function xt(e,t,n){return t=db(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var no=C.createContext(null),on=()=>{var e=C.useContext(no);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},jd=parseInt(C.version.split(".")[0],10),fb=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Qu=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),ot=typeof navigator<"u"&&/Android/.test(navigator.userAgent),$n=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),mr=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),hb=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),Od=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),mb=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),pb=ot&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),gb=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),vb=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),bb=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),da=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zt=(!mb||!pb)&&!hb&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",ro=new WeakMap,ao=new WeakMap,Pd=new WeakMap,fa=new WeakMap,gs=new WeakMap,Sr=new WeakMap,bn=new WeakMap,_a=new WeakMap,Ya=new WeakMap,vs=new WeakMap,en=new WeakMap,mn=new WeakMap,br=new WeakMap,bs=new WeakMap,io=new WeakMap,_t=new WeakMap,qt=new WeakMap,ct=new WeakMap,Gt=new WeakMap,Qt=new WeakMap,Nd=new WeakMap,Yn=Symbol("placeholder"),Rd=Symbol("mark-placeholder"),yb=globalThis.Text,so=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,Db=e=>nn(e)&&e.nodeType===8,Ct=e=>nn(e)&&e.nodeType===1,nn=e=>{var t=so(e);return!!t&&e instanceof t.Node},ys=e=>{var t=e&&e.anchorNode&&so(e.anchorNode);return!!t&&e instanceof t.Selection},Md=e=>nn(e)&&e.nodeType===3,Cb=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,xb=e=>{var[t,n]=e;if(Ct(t)&&t.childNodes.length){var r=n===t.childNodes.length,a=r?n-1:n;for([t,a]=Id(t,a,r?"backward":"forward"),r=a<n;Ct(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=Eb(t,i,r?"backward":"forward")}n=r&&t.textContent!=null?t.textContent.length:0}return[t,n]},wb=e=>{for(var t=e&&e.parentNode;t;){if(t.toString()==="[object ShadowRoot]")return!0;t=t.parentNode}return!1},Id=(e,t,n)=>{for(var{childNodes:r}=e,a=r[t],i=t,s=!1,o=!1;(Db(a)||Ct(a)&&a.childNodes.length===0||Ct(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]},Eb=(e,t,n)=>{var[r]=Id(e,t,n);return r},$d=e=>{var t="";if(Md(e)&&e.nodeValue)return e.nodeValue;if(Ct(e)){for(var n of Array.from(e.childNodes))t+=$d(n);var r=getComputedStyle(e).getPropertyValue("display");(r==="block"||r==="list"||e.tagName==="BR")&&(t+=`
103
+ `)}return t},kb=/data-slate-fragment="(.+?)"/m,_b=e=>{var t=e.getData("text/html"),[,n]=t.match(kb)||[];return n},oo=(e,t,n)=>{var{target:r}=t;if(Ct(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:a}=J.getWindow(e);if(a.contains(r))return J.hasDOMNode(e,r,{editable:!0});var i=n.find(s=>{var{addedNodes:o,removedNodes:l}=s;for(var u of o)if(u===r||u.contains(r))return!0;for(var c of l)if(c===r||c.contains(r))return!0});return!i||i===t?!1:oo(e,i,n)},Bb=0;class Ab{constructor(){xt(this,"id",void 0),this.id="".concat(Bb++)}}var J={androidPendingDiffs:e=>ct.get(e),androidScheduleFlush:e=>{var t;(t=io.get(e))===null||t===void 0||t()},blur:e=>{var t=J.toDOMNode(e,e),n=J.findDocumentOrShadowRoot(e);en.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=J.findDocumentOrShadowRoot(e),r=n.getSelection();r&&r.rangeCount>0&&r.removeAllRanges(),t&&Q.deselect(e)},findDocumentOrShadowRoot:e=>{var t=J.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=J.toSlateNode(e,t.target),s=J.findPath(e,i);if(ce.isElement(i)&&v.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=v.point(e,s,{edge:l?"start":"end"}),c=l?v.before(e,u):v.after(e,u);if(c){var h=v.range(e,c);return h}}var p,{document:m}=J.getWindow(e);if(m.caretRangeFromPoint)p=m.caretRangeFromPoint(n,r);else{var g=m.caretPositionFromPoint(n,r);g&&(p=m.createRange(),p.setStart(g.offsetNode,g.offset),p.setEnd(g.offsetNode,g.offset))}if(!p)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var f=J.toSlateRange(e,p,{exactMatch:!1,suppressThrow:!1});return f},findKey:(e,t)=>{var n=_a.get(t);return n||(n=new Ab,_a.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var a=ao.get(r);if(a==null){if(v.isEditor(r))return n;break}var i=ro.get(r);if(i==null)break;n.unshift(i),r=a}throw new Error("Unable to find the path for Slate node: ".concat(Je.stringify(t)))},focus:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!en.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(()=>{J.focus(t,{retries:n.retries-1})},10);return}var r=J.toDOMNode(t,t),a=J.findDocumentOrShadowRoot(t);if(a.activeElement!==r){if(t.selection&&a instanceof Document){var i=a.getSelection(),s=J.toDOMRange(t,t.selection);i==null||i.removeAllRanges(),i==null||i.addRange(s)}t.selection||(Q.select(t,v.start(t,[])),t.onChange()),en.set(t,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=Pd.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=J.toDOMNode(t,t),s;try{s=Ct(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)=>nn(t)&&J.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return v.hasPath(e,n.path)&&v.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>J.hasEditableTarget(e,t)||J.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>nn(t)&&J.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!mn.get(e),isFocused:e=>!!en.get(e),isReadOnly:e=>!!vs.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(vs.get(e))return!1;var n=J.hasTarget(e,t)&&J.toSlateNode(e,t);return ce.isElement(n)&&v.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=Ya.get(e),r=v.isEditor(t)?fa.get(e):n==null?void 0:n.get(J.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(Je.stringify(t)));return r},toDOMPoint:(e,t)=>{var[n]=v.node(e,t.path),r=J.toDOMNode(e,n),a;v.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i="[data-slate-string], [data-slate-zero-width]",s=Array.from(r.querySelectorAll(i)),o=0,l=0;l<s.length;l++){var u=s[l],c=u.childNodes[0];if(!(c==null||c.textContent==null)){var{length:h}=c.textContent,p=u.getAttribute("data-slate-length"),m=p==null?h:parseInt(p,10),g=o+m,f=s[l+1];if(t.offset===g&&f!==null&&f!==void 0&&f.hasAttribute("data-slate-mark-placeholder")){var b,y=f.childNodes[0];a=[y instanceof yb?y:f,(b=f.textContent)!==null&&b!==void 0&&b.startsWith("\uFEFF")?1:0];break}if(t.offset<=g){var x=Math.min(h,Math.max(0,t.offset-o));a=[c,x];break}o=g}}if(!a)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(Je.stringify(t)));return a},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,a=V.isBackward(t),i=J.toDOMPoint(e,n),s=V.isCollapsed(t)?i:J.toDOMPoint(e,r),o=J.getWindow(e),l=o.document.createRange(),[u,c]=a?s:i,[h,p]=a?i:s,m=Ct(u)?u:u.parentElement,g=!!m.getAttribute("data-slate-zero-width"),f=Ct(h)?h:h.parentElement,b=!!f.getAttribute("data-slate-zero-width");return l.setStart(u,g?1:c),l.setEnd(h,b?1:p),l},toSlateNode:(e,t)=>{var n=Ct(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Sr.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:xb(t),o=i.parentNode,l=null,u=0;if(o){var c,h,p=J.toDOMNode(e,e),m=o.closest('[data-slate-void="true"]'),g=m&&p.contains(m)?m:null,f=o.closest("[data-slate-leaf]"),b=null;if(f){if(l=f.closest('[data-slate-node="text"]'),l){var y=J.getWindow(e),x=y.document.createRange();x.setStart(l,0),x.setEnd(i,s);var A=x.cloneContents(),k=[...Array.prototype.slice.call(A.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(A.querySelectorAll("[contenteditable=false]"))];k.forEach(T=>{if(ot&&!r&&T.hasAttribute("data-slate-zero-width")&&T.textContent.length>0&&T.textContext!=="\uFEFF"){T.textContent.startsWith("\uFEFF")&&(T.textContent=T.textContent.slice(1));return}T.parentNode.removeChild(T)}),u=A.textContent.length,b=l}}else if(g){for(var w=g.querySelectorAll("[data-slate-leaf]"),F=0;F<w.length;F++){var S=w[F];if(J.hasDOMNode(e,S)){f=S;break}}f?(l=f.closest('[data-slate-node="text"]'),b=f,u=b.textContent.length,b.querySelectorAll("[data-slate-zero-width]").forEach(T=>{u-=T.textContent.length})):u=1}b&&u===b.textContent.length&&ot&&b.getAttribute("data-slate-zero-width")==="z"&&(c=b.textContent)!==null&&c!==void 0&&c.startsWith("\uFEFF")&&(o.hasAttribute("data-slate-zero-width")||$n&&(h=b.textContent)!==null&&h!==void 0&&h.endsWith(`
104
104
 
105
- `))&&u--}if(ot&&!l&&!r){var I=o.hasAttribute("data-slate-node")?o:o.closest("[data-slate-node]");if(I&&Q.hasDOMNode(e,I,{editable:!0})){var R=Q.toSlateNode(e,I),{path:M,offset:$}=b.start(e,Q.findPath(e,R));return I.querySelector("[data-slate-leaf]")||($=s),{path:M,offset:$}}}if(!l){if(a)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var w=Q.toSlateNode(e,l),k=Q.findPath(e,w);return{path:k,offset:u}},toSlateRange:(e,t,n)=>{var r,{exactMatch:a,suppressThrow:i}=n,s=ys(t)?t.anchorNode:t.startContainer,o,l,u,c,h;if(s)if(ys(t)){if($n&&t.rangeCount>1){u=t.focusNode;var p=t.getRangeAt(0),m=t.getRangeAt(t.rangeCount-1);if(u instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement&&m.startContainer instanceof HTMLTableRowElement){let F=function(T){return T.childElementCount>0?F(T.children[0]):T};var g=p.startContainer,f=m.startContainer,D=F(g.children[p.startOffset]),y=F(f.children[m.startOffset]);c=0,y.childNodes.length>0?o=y.childNodes[0]:o=y,D.childNodes.length>0?u=D.childNodes[0]:u=D,y instanceof HTMLElement?l=y.innerHTML.length:l=0}else p.startContainer===u?(o=m.endContainer,l=m.endOffset,c=p.startOffset):(o=p.startContainer,l=p.endOffset,c=m.startOffset)}else o=t.anchorNode,l=t.anchorOffset,u=t.focusNode,c=t.focusOffset;Od&&wb(o)||$n?h=t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:h=t.isCollapsed}else o=t.startContainer,l=t.startOffset,u=t.endContainer,c=t.endOffset,h=t.collapsed;if(o==null||u==null||l==null||c==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));if($n&&(r=u.textContent)!==null&&r!==void 0&&r.endsWith(`
105
+ `))&&u--}if(ot&&!l&&!r){var z=o.hasAttribute("data-slate-node")?o:o.closest("[data-slate-node]");if(z&&J.hasDOMNode(e,z,{editable:!0})){var N=J.toSlateNode(e,z),{path:$,offset:I}=v.start(e,J.findPath(e,N));return z.querySelector("[data-slate-leaf]")||(I=s),{path:$,offset:I}}}if(!l){if(a)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var E=J.toSlateNode(e,l),B=J.findPath(e,E);return{path:B,offset:u}},toSlateRange:(e,t,n)=>{var r,{exactMatch:a,suppressThrow:i}=n,s=ys(t)?t.anchorNode:t.startContainer,o,l,u,c,h;if(s)if(ys(t)){if($n&&t.rangeCount>1){u=t.focusNode;var p=t.getRangeAt(0),m=t.getRangeAt(t.rangeCount-1);if(u instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement&&m.startContainer instanceof HTMLTableRowElement){let F=function(S){return S.childElementCount>0?F(S.children[0]):S};var g=p.startContainer,f=m.startContainer,b=F(g.children[p.startOffset]),y=F(f.children[m.startOffset]);c=0,y.childNodes.length>0?o=y.childNodes[0]:o=y,b.childNodes.length>0?u=b.childNodes[0]:u=b,y instanceof HTMLElement?l=y.innerHTML.length:l=0}else p.startContainer===u?(o=m.endContainer,l=m.endOffset,c=p.startOffset):(o=p.startContainer,l=p.endOffset,c=m.startOffset)}else o=t.anchorNode,l=t.anchorOffset,u=t.focusNode,c=t.focusOffset;Od&&wb(o)||$n?h=t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:h=t.isCollapsed}else o=t.startContainer,l=t.startOffset,u=t.endContainer,c=t.endOffset,h=t.collapsed;if(o==null||u==null||l==null||c==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));if($n&&(r=u.textContent)!==null&&r!==void 0&&r.endsWith(`
106
106
 
107
- `)&&c===u.textContent.length&&c--,"getAttribute"in u&&u.getAttribute("contenteditable")==="false"&&u.getAttribute("data-slate-void")!=="true"){var x;u=o,c=((x=o.textContent)===null||x===void 0?void 0:x.length)||0}var A=Q.toSlatePoint(e,[o,l],{exactMatch:a,suppressThrow:i});if(!A)return null;var _=h?A:Q.toSlatePoint(e,[u,c],{exactMatch:a,suppressThrow:i});if(!_)return null;var E={anchor:A,focus:_};return V.isExpanded(E)&&V.isForward(E)&&Ct(u)&&b.void(e,{at:E.focus,mode:"highest"})&&(E=b.unhangRange(e,E,{voids:!0})),E}};function Fb(e,t){var{path:n,diff:r}=t;if(!b.hasPath(e,n))return!1;var a=oe.get(e,n);if(!de.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(!b.hasPath(e,i))return!1;var s=oe.get(e,i);return de.isText(s)&&s.text.startsWith(r.text)}function Ld(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 Tb(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 Sb(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 zd(e,t){var{start:n,end:r,text:a}=t,i=e.slice(n,r),s=Tb(i,a),o=Math.min(i.length-s,a.length-s),l=Sb(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 jb(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=Ld(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 zd(e,{start:r,end:l,text:o})}function Ob(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function Ds(e,t){var{path:n,offset:r}=t;if(!b.hasPath(e,n))return null;var a=oe.get(e,n);if(!de.isText(a))return null;var i=b.above(e,{match:o=>ce.isElement(o)&&b.isBlock(e,o),at:n});if(!i)return null;for(;r>a.text.length;){var s=b.next(e,{at:n,match:de.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 Ju(e,t){var n=Ds(e,t.anchor);if(!n)return null;if(V.isCollapsed(t))return{anchor:n,focus:n};var r=Ds(e,t.focus);return r?{anchor:n,focus:r}:null}function Cs(e,t,n){var r=ct.get(e),a=r==null?void 0:r.find(c=>{var{path:h}=c;return N.equals(h,t.path)});if(!a||t.offset<=a.diff.start)return Ee.transform(t,n,{affinity:"backward"});var{diff:i}=a;if(t.offset<=i.start+i.text.length){var s={path:t.path,offset:i.start},o=Ee.transform(s,n,{affinity:"backward"});return o?{path:o.path,offset:o.offset+t.offset-i.start}:null}var l={path:t.path,offset:t.offset-i.text.length+i.end-i.start},u=Ee.transform(l,n,{affinity:"backward"});return u?n.type==="split_node"&&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 Xu(e,t,n){var r=Cs(e,t.anchor,n);if(!r)return null;if(V.isCollapsed(t))return{anchor:r,focus:r};var a=Cs(e,t.focus,n);return a?{anchor:r,focus:a}:null}function Pb(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 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 Yr(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){xt(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 Nb=25,Rb=200,Mb=function(){},Ib=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function $b(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,a=!1,i=null,s=null,o=null,l=0,u=!1,c=()=>{var w=Qt.get(t);if(Qt.delete(t),w){var{selection:k}=t,O=Ju(t,w);O&&(!k||!V.equals(O,k))&&G.select(t,O)}},h=()=>{var w=Gt.get(t);if(Gt.delete(t),!!w){if(w.at){var k=Ee.isPoint(w.at)?Ds(t,w.at):Ju(t,w.at);if(!k)return;var O=b.range(t,k);(!t.selection||!V.equals(t.selection,O))&&G.select(t,k)}w.run()}},p=()=>{if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!_()&&!A()){c();return}a||(a=!0,setTimeout(()=>a=!1)),A()&&(a="action");var w=t.selection&&b.rangeRef(t,t.selection,{affinity:"forward"});qt.set(t,t.marks),Mb("flush",Gt.get(t),ct.get(t));for(var k=_(),O;O=(j=ct.get(t))===null||j===void 0?void 0:j[0];){var j,z,H=_t.get(t);H!==void 0&&(_t.delete(t),t.marks=H),H&&u===!1&&(u=null);var te=Ob(O);(!t.selection||!V.equals(t.selection,te))&&G.select(t,te),O.diff.text?b.insertText(t,O.diff.text):b.deleteFragment(t),ct.set(t,(z=ct.get(t))===null||z===void 0?void 0:z.filter(W=>{var{id:ee}=W;return ee!==O.id})),Fb(t,O)||(k=!1,Gt.delete(t),qt.delete(t),a="action",Qt.delete(t),n.cancel(),r.cancel(),w==null||w.unref())}var J=w==null?void 0:w.unref();if(J&&!Qt.get(t)&&(!t.selection||!V.equals(J,t.selection))&&G.select(t,J),A()){h();return}k&&n(),n.flush(),r.flush(),c();var v=qt.get(t);qt.delete(t),v!==void 0&&(t.marks=v,t.onChange())},m=w=>{i&&clearTimeout(i),i=setTimeout(()=>{mn.set(t,!1),p()},Nb)},g=w=>{mn.set(t,!0),i&&(clearTimeout(i),i=null)},f=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,O=gs.get(t);if(O){if(_()||k){O.style.display="none";return}O.style.removeProperty("display")}},D=(w,k)=>{var O,j=(O=ct.get(t))!==null&&O!==void 0?O:[];ct.set(t,j);var z=oe.leaf(t,w),H=j.findIndex(v=>N.equals(v.path,w));if(H<0){var te=zd(z.text,k);te&&j.push({path:w,diff:k,id:l++}),f();return}var J=jb(z.text,j[H].diff,k);if(!J){j.splice(H,1),f();return}j[H]=Yr(Yr({},j[H]),{},{diff:J})},y=function(k){var{at:O}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};u=!1,Qt.delete(t),n.cancel(),r.cancel(),A()&&p(),Gt.set(t,{at:O,run:k}),o=setTimeout(p)},x=w=>{var k;s&&(clearTimeout(s),s=null);var{inputType:O}=w,j=null,z=w.dataTransfer||w.data||void 0;u!==!1&&O!=="insertText"&&O!=="insertCompositionText"&&(u=!1);var[H]=w.getTargetRanges();H&&(j=Q.toSlateRange(t,H,{exactMatch:!1,suppressThrow:!0}));var te=Q.getWindow(t),J=te.getSelection();if(!j&&J&&(H=J,j=Q.toSlateRange(t,J,{exactMatch:!1,suppressThrow:!0})),j=(k=j)!==null&&k!==void 0?k:t.selection,!!j){var v=!0;if(O.startsWith("delete")){if(V.isExpanded(j)){var[W,ee]=V.edges(j),B=oe.leaf(t,W.path);if(B.text.length===W.offset&&ee.offset===0){var S=b.next(t,{at:W.path,match:de.isText});S&&N.equals(S[1],ee.path)&&(j={anchor:ee,focus:ee})}}var q=O.endsWith("Backward")?"backward":"forward",[L,U]=V.edges(j),[ne,re]=b.leaf(t,L.path),ae={text:"",start:L.offset,end:U.offset},fe=ct.get(t),X=fe==null?void 0:fe.find(ge=>N.equals(ge.path,re)),be=X?[X.diff,ae]:[ae],he=Ld(ne.text,...be);if(he.length===0&&(v=!1),V.isExpanded(j)){if(v&&N.equals(j.anchor.path,j.focus.path)){var xe={path:j.anchor.path,offset:L.offset},Ae=b.range(t,xe,xe);return T(Ae),D(j.anchor.path,{text:"",end:U.offset,start:L.offset})}return y(()=>b.deleteFragment(t,{direction:q}),{at:j})}}switch(O){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return y(()=>b.deleteFragment(t),{at:j});case"deleteContent":case"deleteContentForward":{var{anchor:Fe}=j;if(v&&V.isCollapsed(j)){var Ke=oe.leaf(t,Fe.path);if(Fe.offset<Ke.text.length)return D(Fe.path,{text:"",start:Fe.offset,end:Fe.offset+1})}return y(()=>b.deleteForward(t),{at:j})}case"deleteContentBackward":{var We,{anchor:He}=j,Qe=ys(H)?H.isCollapsed:!!((We=H)!==null&&We!==void 0&&We.collapsed);return v&&Qe&&V.isCollapsed(j)&&He.offset>0?D(He.path,{text:"",start:He.offset-1,end:He.offset}):y(()=>b.deleteBackward(t),{at:j})}case"deleteEntireSoftLine":return y(()=>{b.deleteBackward(t,{unit:"line"}),b.deleteForward(t,{unit:"line"})},{at:j});case"deleteHardLineBackward":return y(()=>b.deleteBackward(t,{unit:"block"}),{at:j});case"deleteSoftLineBackward":return y(()=>b.deleteBackward(t,{unit:"line"}),{at:j});case"deleteHardLineForward":return y(()=>b.deleteForward(t,{unit:"block"}),{at:j});case"deleteSoftLineForward":return y(()=>b.deleteForward(t,{unit:"line"}),{at:j});case"deleteWordBackward":return y(()=>b.deleteBackward(t,{unit:"word"}),{at:j});case"deleteWordForward":return y(()=>b.deleteForward(t,{unit:"word"}),{at:j});case"insertLineBreak":return y(()=>b.insertSoftBreak(t),{at:j});case"insertParagraph":return y(()=>b.insertBreak(t),{at:j});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(Ib(z))return y(()=>Q.insertData(t,z),{at:j});var me=z??"";if(_t.get(t)&&(me=me.replace("\uFEFF","")),O==="insertText"&&/.*\n.*\n$/.test(me)&&(me=me.slice(0,-1)),me.includes(`
108
- `))return y(()=>{var ge=me.split(`
109
- `);ge.forEach((we,Ye)=>{we&&b.insertText(t,we),Ye!==ge.length-1&&b.insertSoftBreak(t)})},{at:j});if(N.equals(j.anchor.path,j.focus.path)){var[Te,$e]=V.edges(j),K={start:Te.offset,end:$e.offset,text:me};if(me&&u&&O==="insertCompositionText"){var se=u.start+u.text.search(/\S|$/),pe=K.start+K.text.search(/\S|$/);pe===se+1&&K.end===u.start+u.text.length?(K.start-=1,u=null,M()):u=!1}else O==="insertText"?u===null?u=K:u&&V.isCollapsed(j)&&u.end+u.text.length===Te.offset?u=Yr(Yr({},u),{},{text:u.text+me}):u=!1:u=!1;if(v){D(Te.path,K);return}}return y(()=>b.insertText(t,me),{at:j})}}}},A=()=>!!Gt.get(t),_=()=>{var w;return!!((w=ct.get(t))!==null&&w!==void 0&&w.length)},E=()=>A()||_(),F=()=>a,T=w=>{Qt.set(t,w),s&&(clearTimeout(s),s=null);var{selection:k}=t;if(w){var O=!k||!N.equals(k.anchor.path,w.anchor.path),j=!k||!N.equals(k.anchor.path.slice(0,-1),w.anchor.path.slice(0,-1));(O&&u||j)&&(u=!1),(O||_())&&(s=setTimeout(p,Rb))}},I=()=>{(A()||!_())&&p()},R=w=>{_()||(f(!0),setTimeout(f))},M=()=>{A()||(o=setTimeout(p))},$=w=>{if(!(_()||A())&&w.some(O=>oo(t,O,w))){var k;(k=Nd.get(t))===null||k===void 0||k()}};return{flush:p,scheduleFlush:M,hasPendingDiffs:_,hasPendingAction:A,hasPendingChanges:E,isFlushing:F,handleUserSelect:T,handleCompositionEnd:m,handleCompositionStart:g,handleDOMBeforeInput:x,handleKeyDown:R,handleDomMutations:$,handleInput:I}}function Lb(){var e=C.useRef(!1);return C.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),e.current}var Sr=ca?C.useLayoutEffect:C.useEffect;function zb(e,t,n){var[r]=C.useState(()=>new MutationObserver(t));Sr(()=>{r.takeRecords()}),C.useEffect(()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return r.observe(e.current,n),()=>r.disconnect()},[r,e,n])}var qb=["node"];function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Wb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tl(Object(n),!0).forEach(function(r){xt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Hb={subtree:!0,childList:!0,characterData:!0},Ub=ot?e=>{var{node:t}=e,n=Zn(e,qb);if(!ot)return null;var r=on(),a=Lb(),[i]=C.useState(()=>$b(Wb({editor:r},n)));return zb(t,i.handleDomMutations,Hb),io.set(r,i.scheduleFlush),a&&i.flush(),i}:()=>null,Vb=["anchor","focus"],Kb=["anchor","focus"],Zb=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>t.hasOwnProperty(n)&&e[n]===t[n]),qd=(e,t)=>{var n=Zn(e,Vb),r=Zn(t,Kb);return e[Yn]===t[Yn]&&Zb(n,r)},Yb=(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(!V.equals(r,a)||!qd(r,a))return!1}return!0},Gb=(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||!qd(r,a))return!1}return!0};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 Qb(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){xt(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 Jb=e=>{var{isLast:t,leaf:n,parent:r,text:a}=e,i=on(),s=Q.findPath(i,a),o=N.parent(s),l=!!n[Rd];return i.isVoid(r)?C.createElement(Di,{length:oe.string(r).length}):n.text===""&&r.children[r.children.length-1]===a&&!i.isInline(r)&&b.string(i,o)===""?C.createElement(Di,{isLineBreak:!0,isMarkPlaceholder:l}):n.text===""?C.createElement(Di,{isMarkPlaceholder:l}):t&&n.text.slice(-1)===`
107
+ `)&&c===u.textContent.length&&c--,"getAttribute"in u&&u.getAttribute("contenteditable")==="false"&&u.getAttribute("data-slate-void")!=="true"){var x;u=o,c=((x=o.textContent)===null||x===void 0?void 0:x.length)||0}var A=J.toSlatePoint(e,[o,l],{exactMatch:a,suppressThrow:i});if(!A)return null;var k=h?A:J.toSlatePoint(e,[u,c],{exactMatch:a,suppressThrow:i});if(!k)return null;var w={anchor:A,focus:k};return V.isExpanded(w)&&V.isForward(w)&&Ct(u)&&v.void(e,{at:w.focus,mode:"highest"})&&(w=v.unhangRange(e,w,{voids:!0})),w}};function Fb(e,t){var{path:n,diff:r}=t;if(!v.hasPath(e,n))return!1;var a=oe.get(e,n);if(!de.isText(a))return!1;if(r.start!==a.text.length||r.text.length===0)return a.text.slice(r.start,r.start+r.text.length)===r.text;var i=P.next(n);if(!v.hasPath(e,i))return!1;var s=oe.get(e,i);return de.isText(s)&&s.text.startsWith(r.text)}function Ld(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 Tb(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 Sb(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 zd(e,t){var{start:n,end:r,text:a}=t,i=e.slice(n,r),s=Tb(i,a),o=Math.min(i.length-s,a.length-s),l=Sb(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 jb(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=Ld(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 zd(e,{start:r,end:l,text:o})}function Ob(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function Ds(e,t){var{path:n,offset:r}=t;if(!v.hasPath(e,n))return null;var a=oe.get(e,n);if(!de.isText(a))return null;var i=v.above(e,{match:o=>ce.isElement(o)&&v.isBlock(e,o),at:n});if(!i)return null;for(;r>a.text.length;){var s=v.next(e,{at:n,match:de.isText});if(!s||!P.isDescendant(s[1],i[1]))return null;r-=a.text.length,a=s[0],n=s[1]}return{path:n,offset:r}}function Ju(e,t){var n=Ds(e,t.anchor);if(!n)return null;if(V.isCollapsed(t))return{anchor:n,focus:n};var r=Ds(e,t.focus);return r?{anchor:n,focus:r}:null}function Cs(e,t,n){var r=ct.get(e),a=r==null?void 0:r.find(c=>{var{path:h}=c;return P.equals(h,t.path)});if(!a||t.offset<=a.diff.start)return Ee.transform(t,n,{affinity:"backward"});var{diff:i}=a;if(t.offset<=i.start+i.text.length){var s={path:t.path,offset:i.start},o=Ee.transform(s,n,{affinity:"backward"});return o?{path:o.path,offset:o.offset+t.offset-i.start}:null}var l={path:t.path,offset:t.offset-i.text.length+i.end-i.start},u=Ee.transform(l,n,{affinity:"backward"});return u?n.type==="split_node"&&P.equals(n.path,t.path)&&l.offset<n.position&&i.start<n.position?u:{path:u.path,offset:u.offset+i.text.length-i.end+i.start}:null}function Xu(e,t,n){var r=Cs(e,t.anchor,n);if(!r)return null;if(V.isCollapsed(t))return{anchor:r,focus:r};var a=Cs(e,t.focus,n);return a?{anchor:r,focus:a}:null}function Pb(e,t){var{path:n,diff:r,id:a}=e;switch(t.type){case"insert_text":return!P.equals(t.path,n)||t.offset>=r.end?e:t.offset<=r.start?{diff:{start:t.text.length+r.start,end:t.text.length+r.end,text:r.text},id:a,path:n}:{diff:{start:r.start,end:r.end+t.text.length,text:r.text},id:a,path:n};case"remove_text":return!P.equals(t.path,n)||t.offset>=r.end?e:t.offset+t.text.length<=r.start?{diff:{start:r.start-t.text.length,end:r.end-t.text.length,text:r.text},id:a,path:n}:{diff:{start:r.start,end:r.end-t.text.length,text:r.text},id:a,path:n};case"split_node":return!P.equals(t.path,n)||t.position>=r.end?{diff:r,id:a,path:P.transform(n,t,{affinity:"backward"})}:t.position>r.start?{diff:{start:r.start,end:Math.min(t.position,r.end),text:r.text},id:a,path:n}:{diff:{start:r.start-t.position,end:r.end-t.position,text:r.text},id:a,path:P.transform(n,t,{affinity:"forward"})};case"merge_node":return P.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:a,path:P.transform(n,t)}:{diff:r,id:a,path:P.transform(n,t)}}var i=P.transform(n,t);return i?{diff:r,path:i,id:a}:null}function 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 Gr(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){xt(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 Nb=25,Rb=200,Mb=function(){},Ib=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function $b(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,a=!1,i=null,s=null,o=null,l=0,u=!1,c=()=>{var E=Qt.get(t);if(Qt.delete(t),E){var{selection:B}=t,T=Ju(t,E);T&&(!B||!V.equals(T,B))&&Q.select(t,T)}},h=()=>{var E=Gt.get(t);if(Gt.delete(t),!!E){if(E.at){var B=Ee.isPoint(E.at)?Ds(t,E.at):Ju(t,E.at);if(!B)return;var T=v.range(t,B);(!t.selection||!V.equals(t.selection,T))&&Q.select(t,B)}E.run()}},p=()=>{if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!k()&&!A()){c();return}a||(a=!0,setTimeout(()=>a=!1)),A()&&(a="action");var E=t.selection&&v.rangeRef(t,t.selection,{affinity:"forward"});qt.set(t,t.marks),Mb("flush",Gt.get(t),ct.get(t));for(var B=k(),T;T=(M=ct.get(t))===null||M===void 0?void 0:M[0];){var M,R,W=_t.get(t);W!==void 0&&(_t.delete(t),t.marks=W),W&&u===!1&&(u=null);var X=Ob(T);(!t.selection||!V.equals(t.selection,X))&&Q.select(t,X),T.diff.text?v.insertText(t,T.diff.text):v.deleteFragment(t),ct.set(t,(R=ct.get(t))===null||R===void 0?void 0:R.filter(H=>{var{id:te}=H;return te!==T.id})),Fb(t,T)||(B=!1,Gt.delete(t),qt.delete(t),a="action",Qt.delete(t),n.cancel(),r.cancel(),E==null||E.unref())}var G=E==null?void 0:E.unref();if(G&&!Qt.get(t)&&(!t.selection||!V.equals(G,t.selection))&&Q.select(t,G),A()){h();return}B&&n(),n.flush(),r.flush(),c();var D=qt.get(t);qt.delete(t),D!==void 0&&(t.marks=D,t.onChange())},m=E=>{i&&clearTimeout(i),i=setTimeout(()=>{mn.set(t,!1),p()},Nb)},g=E=>{mn.set(t,!0),i&&(clearTimeout(i),i=null)},f=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,T=gs.get(t);if(T){if(k()||B){T.style.display="none";return}T.style.removeProperty("display")}},b=(E,B)=>{var T,M=(T=ct.get(t))!==null&&T!==void 0?T:[];ct.set(t,M);var R=oe.leaf(t,E),W=M.findIndex(D=>P.equals(D.path,E));if(W<0){var X=zd(R.text,B);X&&M.push({path:E,diff:B,id:l++}),f();return}var G=jb(R.text,M[W].diff,B);if(!G){M.splice(W,1),f();return}M[W]=Gr(Gr({},M[W]),{},{diff:G})},y=function(B){var{at:T}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};u=!1,Qt.delete(t),n.cancel(),r.cancel(),A()&&p(),Gt.set(t,{at:T,run:B}),o=setTimeout(p)},x=E=>{var B;s&&(clearTimeout(s),s=null);var{inputType:T}=E,M=null,R=E.dataTransfer||E.data||void 0;u!==!1&&T!=="insertText"&&T!=="insertCompositionText"&&(u=!1);var[W]=E.getTargetRanges();W&&(M=J.toSlateRange(t,W,{exactMatch:!1,suppressThrow:!0}));var X=J.getWindow(t),G=X.getSelection();if(!M&&G&&(W=G,M=J.toSlateRange(t,G,{exactMatch:!1,suppressThrow:!0})),M=(B=M)!==null&&B!==void 0?B:t.selection,!!M){var D=!0;if(T.startsWith("delete")){if(V.isExpanded(M)){var[H,te]=V.edges(M),_=oe.leaf(t,H.path);if(_.text.length===H.offset&&te.offset===0){var j=v.next(t,{at:H.path,match:de.isText});j&&P.equals(j[1],te.path)&&(M={anchor:te,focus:te})}}var q=T.endsWith("Backward")?"backward":"forward",[L,U]=V.edges(M),[ne,re]=v.leaf(t,L.path),ae={text:"",start:L.offset,end:U.offset},fe=ct.get(t),ee=fe==null?void 0:fe.find(ge=>P.equals(ge.path,re)),be=ee?[ee.diff,ae]:[ae],me=Ld(ne.text,...be);if(me.length===0&&(D=!1),V.isExpanded(M)){if(D&&P.equals(M.anchor.path,M.focus.path)){var xe={path:M.anchor.path,offset:L.offset},Fe=v.range(t,xe,xe);return S(Fe),b(M.anchor.path,{text:"",end:U.offset,start:L.offset})}return y(()=>v.deleteFragment(t,{direction:q}),{at:M})}}switch(T){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return y(()=>v.deleteFragment(t),{at:M});case"deleteContent":case"deleteContentForward":{var{anchor:Te}=M;if(D&&V.isCollapsed(M)){var Ke=oe.leaf(t,Te.path);if(Te.offset<Ke.text.length)return b(Te.path,{text:"",start:Te.offset,end:Te.offset+1})}return y(()=>v.deleteForward(t),{at:M})}case"deleteContentBackward":{var We,{anchor:He}=M,Qe=ys(W)?W.isCollapsed:!!((We=W)!==null&&We!==void 0&&We.collapsed);return D&&Qe&&V.isCollapsed(M)&&He.offset>0?b(He.path,{text:"",start:He.offset-1,end:He.offset}):y(()=>v.deleteBackward(t),{at:M})}case"deleteEntireSoftLine":return y(()=>{v.deleteBackward(t,{unit:"line"}),v.deleteForward(t,{unit:"line"})},{at:M});case"deleteHardLineBackward":return y(()=>v.deleteBackward(t,{unit:"block"}),{at:M});case"deleteSoftLineBackward":return y(()=>v.deleteBackward(t,{unit:"line"}),{at:M});case"deleteHardLineForward":return y(()=>v.deleteForward(t,{unit:"block"}),{at:M});case"deleteSoftLineForward":return y(()=>v.deleteForward(t,{unit:"line"}),{at:M});case"deleteWordBackward":return y(()=>v.deleteBackward(t,{unit:"word"}),{at:M});case"deleteWordForward":return y(()=>v.deleteForward(t,{unit:"word"}),{at:M});case"insertLineBreak":return y(()=>v.insertSoftBreak(t),{at:M});case"insertParagraph":return y(()=>v.insertBreak(t),{at:M});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(Ib(R))return y(()=>J.insertData(t,R),{at:M});var he=R??"";if(_t.get(t)&&(he=he.replace("\uFEFF","")),T==="insertText"&&/.*\n.*\n$/.test(he)&&(he=he.slice(0,-1)),he.includes(`
108
+ `))return y(()=>{var ge=he.split(`
109
+ `);ge.forEach((we,Ye)=>{we&&v.insertText(t,we),Ye!==ge.length-1&&v.insertSoftBreak(t)})},{at:M});if(P.equals(M.anchor.path,M.focus.path)){var[ke,$e]=V.edges(M),K={start:ke.offset,end:$e.offset,text:he};if(he&&u&&T==="insertCompositionText"){var se=u.start+u.text.search(/\S|$/),pe=K.start+K.text.search(/\S|$/);pe===se+1&&K.end===u.start+u.text.length?(K.start-=1,u=null,$()):u=!1}else T==="insertText"?u===null?u=K:u&&V.isCollapsed(M)&&u.end+u.text.length===ke.offset?u=Gr(Gr({},u),{},{text:u.text+he}):u=!1:u=!1;if(D){b(ke.path,K);return}}return y(()=>v.insertText(t,he),{at:M})}}}},A=()=>!!Gt.get(t),k=()=>{var E;return!!((E=ct.get(t))!==null&&E!==void 0&&E.length)},w=()=>A()||k(),F=()=>a,S=E=>{Qt.set(t,E),s&&(clearTimeout(s),s=null);var{selection:B}=t;if(E){var T=!B||!P.equals(B.anchor.path,E.anchor.path),M=!B||!P.equals(B.anchor.path.slice(0,-1),E.anchor.path.slice(0,-1));(T&&u||M)&&(u=!1),(T||k())&&(s=setTimeout(p,Rb))}},z=()=>{(A()||!k())&&p()},N=E=>{k()||(f(!0),setTimeout(f))},$=()=>{A()||(o=setTimeout(p))},I=E=>{if(!(k()||A())&&E.some(T=>oo(t,T,E))){var B;(B=Nd.get(t))===null||B===void 0||B()}};return{flush:p,scheduleFlush:$,hasPendingDiffs:k,hasPendingAction:A,hasPendingChanges:w,isFlushing:F,handleUserSelect:S,handleCompositionEnd:m,handleCompositionStart:g,handleDOMBeforeInput:x,handleKeyDown:N,handleDomMutations:I,handleInput:z}}function Lb(){var e=C.useRef(!1);return C.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),e.current}var jr=da?C.useLayoutEffect:C.useEffect;function zb(e,t,n){var[r]=C.useState(()=>new MutationObserver(t));jr(()=>{r.takeRecords()}),C.useEffect(()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return r.observe(e.current,n),()=>r.disconnect()},[r,e,n])}var qb=["node"];function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Wb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tl(Object(n),!0).forEach(function(r){xt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Hb={subtree:!0,childList:!0,characterData:!0},Ub=ot?e=>{var{node:t}=e,n=Zn(e,qb);if(!ot)return null;var r=on(),a=Lb(),[i]=C.useState(()=>$b(Wb({editor:r},n)));return zb(t,i.handleDomMutations,Hb),io.set(r,i.scheduleFlush),a&&i.flush(),i}:()=>null,Vb=["anchor","focus"],Kb=["anchor","focus"],Zb=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>t.hasOwnProperty(n)&&e[n]===t[n]),qd=(e,t)=>{var n=Zn(e,Vb),r=Zn(t,Kb);return e[Yn]===t[Yn]&&Zb(n,r)},Yb=(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(!V.equals(r,a)||!qd(r,a))return!1}return!0},Gb=(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||!qd(r,a))return!1}return!0};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 Qb(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){xt(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 Jb=e=>{var{isLast:t,leaf:n,parent:r,text:a}=e,i=on(),s=J.findPath(i,a),o=P.parent(s),l=!!n[Rd];return i.isVoid(r)?C.createElement(Ci,{length:oe.string(r).length}):n.text===""&&r.children[r.children.length-1]===a&&!i.isInline(r)&&v.string(i,o)===""?C.createElement(Ci,{isLineBreak:!0,isMarkPlaceholder:l}):n.text===""?C.createElement(Ci,{isMarkPlaceholder:l}):t&&n.text.slice(-1)===`
110
110
  `?C.createElement(rl,{isTrailing:!0,text:n.text}):C.createElement(rl,{text:n.text})},rl=e=>{var{text:t,isTrailing:n=!1}=e,r=C.useRef(null),a=()=>"".concat(t??"").concat(n?`
111
- `:""),[i]=C.useState(a);return Sr(()=>{var s=a();r.current&&r.current.textContent!==s&&(r.current.textContent=s)}),C.createElement(Xb,{ref:r},i)},Xb=C.memo(C.forwardRef((e,t)=>C.createElement("span",{"data-slate-string":!0,ref:t},e.children))),Di=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=e,a={"data-slate-zero-width":n?"n":"z","data-slate-length":t};return r&&(a["data-slate-mark-placeholder"]=!0),C.createElement("span",Qb({},a),!ot||!n?"\uFEFF":null,n?C.createElement("br",null):null)};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 Wd(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){xt(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 ey=ot?300:0;function ty(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function il(e){e.current&&(clearTimeout(e.current),e.current=null)}var ny=e=>{var{leaf:t,isLast:n,text:r,parent:a,renderPlaceholder:i,renderLeaf:s=x=>C.createElement(ay,Wd({},x))}=e,o=on(),l=C.useRef(null),u=C.useRef(null),[c,h]=C.useState(!1),p=C.useRef(null),m=C.useCallback(x=>{if(ty(l,x==null),x==null){var A;gs.delete(o),(A=t.onPlaceholderResize)===null||A===void 0||A.call(t,null)}else{if(gs.set(o,x),!l.current){var _=window.ResizeObserver||ab;l.current=new _(()=>{var E;(E=t.onPlaceholderResize)===null||E===void 0||E.call(t,x)})}l.current.observe(x),u.current=x}},[u,t,o]),g=C.createElement(Jb,{isLast:n,leaf:t,parent:a,text:r}),f=!!t[Yn];if(C.useEffect(()=>(f?p.current||(p.current=setTimeout(()=>{h(!0),p.current=null},ey)):(il(p),h(!1)),()=>il(p)),[f,h]),f&&c){var D={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:mr?"inherit":void 0},contentEditable:!1,ref:m}};g=C.createElement(C.Fragment,null,i(D),g)}var y={"data-slate-leaf":!0};return s({attributes:y,children:g,leaf:t,text:r})},ry=C.memo(ny,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&de.equals(t.leaf,e.leaf)&&t.leaf[Yn]===e.leaf[Yn]),ay=e=>{var{attributes:t,children:n}=e;return C.createElement("span",Wd({},t),n)},iy=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:a,renderLeaf:i,text:s}=e,o=on(),l=C.useRef(null),u=de.decorations(s,t),c=Q.findKey(o,s),h=[],p=0;p<u.length;p++){var m=u[p];h.push(C.createElement(ry,{isLast:n&&p===u.length-1,key:"".concat(c.id,"-").concat(p),renderPlaceholder:a,leaf:m,text:s,parent:r,renderLeaf:i}))}var g=C.useCallback(f=>{var D=Za.get(o);f?(D==null||D.set(c,f),bn.set(s,f),Tr.set(f,s)):(D==null||D.delete(c),bn.delete(s),l.current&&Tr.delete(l.current)),l.current=f},[l,o,c,s]);return C.createElement("span",{"data-slate-node":"text",ref:g},h)},Hd=C.memo(iy,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&Gb(t.decorations,e.decorations));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 xs(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){xt(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 sy=e=>{var{decorations:t,element:n,renderElement:r=x=>C.createElement(uy,xs({},x)),renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=on(),l=dy(),u=o.isInline(n),c=Q.findKey(o,n),h=C.useCallback(x=>{var A=Za.get(o);x?(A==null||A.set(c,x),bn.set(n,x),Tr.set(x,n)):(A==null||A.delete(c),bn.delete(n))},[o,c,n]),p=Vd({decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}),m={"data-slate-node":"element",ref:h};if(u&&(m["data-slate-inline"]=!0),!u&&b.hasInlines(o,n)){var g=oe.string(n),f=vd(g);f==="rtl"&&(m.dir=f)}if(b.isVoid(o,n)){m["data-slate-void"]=!0,!l&&u&&(m.contentEditable=!1);var D=u?"span":"div",[[y]]=oe.texts(n);p=C.createElement(D,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},C.createElement(Hd,{renderPlaceholder:a,decorations:[],isLast:!1,parent:n,text:y})),ro.set(y,0),ao.set(y,n)}return r({attributes:m,children:p,element:n})},oy=C.memo(sy,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&Yb(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&V.equals(e.selection,t.selection))),uy=e=>{var{attributes:t,children:n,element:r}=e,a=on(),i=a.isInline(r)?"span":"div";return C.createElement(i,xs(xs({},t),{},{style:{position:"relative"}}),n)},Ud=C.createContext(()=>[]),ly=()=>C.useContext(Ud),cy=C.createContext(!1),Vd=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=ly(),l=on(),u=Q.findPath(l,n),c=[],h=ce.isElement(n)&&!l.isInline(n)&&b.hasInlines(l,n),p=0;p<n.children.length;p++){var m=u.concat(p),g=n.children[p],f=Q.findKey(l,g),D=b.range(l,m),y=s&&V.intersection(D,s),x=o([g,m]);for(var A of t){var _=V.intersection(A,D);_&&x.push(_)}ce.isElement(g)?c.push(C.createElement(cy.Provider,{key:"provider-".concat(f.id),value:!!y},C.createElement(oy,{decorations:x,element:g,key:f.id,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:y}))):c.push(C.createElement(Hd,{decorations:x,key:f.id,isLast:h&&p===n.children.length-1,parent:n,renderPlaceholder:a,renderLeaf:i,text:g})),ro.set(g,p),ao.set(g,n)}return c},Kd=C.createContext(!1),dy=()=>C.useContext(Kd),Zd=C.createContext(null),Bn=()=>{var e=C.useContext(Zd);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function fy(){var e=on(),t=C.useRef(!1),n=C.useRef(0),r=C.useCallback(()=>{if(!t.current){t.current=!0;var a=Q.getWindow(e);a.cancelAnimationFrame(n.current),n.current=a.requestAnimationFrame(()=>{t.current=!1})}},[e]);return C.useEffect(()=>()=>cancelAnimationFrame(n.current),[]),{receivedUserInput:t,onUserInput:r}}var hy=3,my={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"},py={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"},gy={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},ze=e=>{var t=my[e],n=py[e],r=gy[e],a=t&&yi(t),i=n&&yi(n),s=r&&yi(r);return o=>!!(a&&a(o)||Qu&&i&&i(o)||!Qu&&s&&s(o))},qe={isBold:ze("bold"),isCompose:ze("compose"),isMoveBackward:ze("moveBackward"),isMoveForward:ze("moveForward"),isDeleteBackward:ze("deleteBackward"),isDeleteForward:ze("deleteForward"),isDeleteLineBackward:ze("deleteLineBackward"),isDeleteLineForward:ze("deleteLineForward"),isDeleteWordBackward:ze("deleteWordBackward"),isDeleteWordForward:ze("deleteWordForward"),isExtendBackward:ze("extendBackward"),isExtendForward:ze("extendForward"),isExtendLineBackward:ze("extendLineBackward"),isExtendLineForward:ze("extendLineForward"),isItalic:ze("italic"),isMoveLineBackward:ze("moveLineBackward"),isMoveLineForward:ze("moveLineForward"),isMoveWordBackward:ze("moveWordBackward"),isMoveWordForward:ze("moveWordForward"),isRedo:ze("redo"),isSoftBreak:ze("insertSoftBreak"),isSplitBlock:ze("splitBlock"),isTransposeCharacter:ze("transposeCharacter"),isUndo:ze("undo")},vy=(e,t)=>{var n=[],r=()=>{n=[]},a=s=>{if(t.current){var o=s.filter(l=>oo(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}},by={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Yd extends C.Component{constructor(){super(...arguments),xt(this,"context",null),xt(this,"manager",null),xt(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,by)}componentDidMount(){var{receivedUserInput:t}=this.props,n=this.context;this.manager=vy(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}}xt(Yd,"contextType",no);var yy=ot?Yd:e=>{var{children:t}=e;return C.createElement(C.Fragment,null,t)},Dy=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],Cy=["text"];function ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ol(Object(n),!0).forEach(function(r){xt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ol(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var xy=e=>C.createElement(C.Fragment,null,Vd(e)),wy=e=>{var t=C.useCallback(S=>C.createElement(Ey,Tt({},S)),[]),{autoFocus:n,decorate:r=ky,onDOMBeforeInput:a,placeholder:i,readOnly:s=!1,renderElement:o,renderLeaf:l,renderPlaceholder:u=t,scrollSelectionIntoView:c=_y,style:h={},as:p="div",disableDefaultStyles:m=!1}=e,g=Zn(e,Dy),f=Bn(),[D,y]=C.useState(!1),x=C.useRef(null),A=C.useRef([]),[_,E]=C.useState(),{onUserInput:F,receivedUserInput:T}=fy(),[,I]=C.useReducer(S=>S+1,0);Nd.set(f,I),vs.set(f,s);var R=C.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);C.useEffect(()=>{x.current&&n&&x.current.focus()},[n]);var M=C.useRef(),$=C.useMemo(()=>P0(()=>{var S=M.current;if((ot||!Q.isComposing(f))&&(!R.isUpdatingSelection||S!=null&&S.isFlushing())&&!R.isDraggingInternally){var q=Q.findDocumentOrShadowRoot(f),{activeElement:L}=q,U=Q.toDOMNode(f,f),ne=q.getSelection();if(L===U?(R.latestElement=L,en.set(f,!0)):en.delete(f),!ne)return G.deselect(f);var{anchorNode:re,focusNode:ae}=ne,fe=Q.hasEditableTarget(f,re)||Q.isTargetInsideNonReadonlyVoid(f,re),X=Q.hasEditableTarget(f,ae)||Q.isTargetInsideNonReadonlyVoid(f,ae);if(fe&&X){var be=Q.toSlateRange(f,ne,{exactMatch:!1,suppressThrow:!0});be&&(!Q.isComposing(f)&&!(S!=null&&S.hasPendingChanges())&&!(S!=null&&S.isFlushing())?G.select(f,be):S==null||S.handleUserSelect(be))}s&&(!fe||!X)&&G.deselect(f)}},100),[f,s,R]),w=C.useMemo(()=>A0($,0),[$]);M.current=Ub({node:x,onDOMSelectionChange:$,scheduleOnDOMSelectionChange:w}),Sr(()=>{var S,q,L;x.current&&(L=so(x.current))?(Pd.set(f,L),da.set(f,x.current),bn.set(f,x.current),Tr.set(x.current,f)):bn.delete(f);var{selection:U}=f,ne=Q.findDocumentOrShadowRoot(f),re=ne.getSelection();if(!(!re||!Q.isFocused(f)||(S=M.current)!==null&&S!==void 0&&S.hasPendingAction())){var ae=he=>{var xe=re.type!=="None";if(!(!U&&!xe)){var Ae=re.focusNode,Fe;if($n&&re.rangeCount>1){var Ke=re.getRangeAt(0),We=re.getRangeAt(re.rangeCount-1);Ke.startContainer===Ae?Fe=We.endContainer:Fe=Ke.startContainer}else Fe=re.anchorNode;var He=da.get(f),Qe=!1;if(He.contains(Fe)&&He.contains(Ae)&&(Qe=!0),xe&&Qe&&U&&!he){var me=Q.toSlateRange(f,re,{exactMatch:!0,suppressThrow:!0});if(me&&V.equals(me,U)){var Te;if(!R.hasMarkPlaceholder||(Te=Fe)!==null&&Te!==void 0&&(Te=Te.parentElement)!==null&&Te!==void 0&&Te.hasAttribute("data-slate-mark-placeholder"))return}}if(U&&!Q.hasRange(f,U)){f.selection=Q.toSlateRange(f,re,{exactMatch:!1,suppressThrow:!0});return}R.isUpdatingSelection=!0;var $e=U&&Q.toDOMRange(f,U);return $e?(Q.isComposing(f)&&!ot?re.collapseToEnd():V.isBackward(U)?re.setBaseAndExtent($e.endContainer,$e.endOffset,$e.startContainer,$e.startOffset):re.setBaseAndExtent($e.startContainer,$e.startOffset,$e.endContainer,$e.endOffset),c(f,$e)):re.removeAllRanges(),$e}};re.rangeCount<=1&&ae();var fe=((q=M.current)===null||q===void 0?void 0:q.isFlushing())==="action";if(!ot||!fe){setTimeout(()=>{R.isUpdatingSelection=!1});return}var X=null,be=requestAnimationFrame(()=>{if(fe){var he=xe=>{try{var Ae=Q.toDOMNode(f,f);Ae.focus(),ae(xe)}catch{}};he(),X=setTimeout(()=>{he(!0),R.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(be),X&&clearTimeout(X)}}});var k=C.useCallback(S=>{if(F(),!s&&Q.hasEditableTarget(f,S.target)&&!By(S,a)){var q;if(M.current)return M.current.handleDOMBeforeInput(S);w.flush(),$.flush();var{selection:L}=f,{inputType:U}=S,ne=S.dataTransfer||S.data||void 0,re=U==="insertCompositionText"||U==="deleteCompositionText";if(re&&Q.isComposing(f))return;var ae=!1;if(U==="insertText"&&L&&V.isCollapsed(L)&&S.data&&S.data.length===1&&/[a-z ]/i.test(S.data)&&L.anchor.offset!==0){var fe,X;ae=!0,f.marks&&(ae=!1);var{anchor:be}=L,[he,xe]=Q.toDOMPoint(f,be),Ae=(fe=he.parentElement)===null||fe===void 0?void 0:fe.closest("a"),Fe=Q.getWindow(f);if(ae&&Ae&&Q.hasDOMNode(f,Ae)){var Ke,We=Fe==null?void 0:Fe.document.createTreeWalker(Ae,NodeFilter.SHOW_TEXT).lastChild();We===he&&((Ke=We.textContent)===null||Ke===void 0?void 0:Ke.length)===xe&&(ae=!1)}if(ae&&he.parentElement&&(Fe==null||(X=Fe.getComputedStyle(he.parentElement))===null||X===void 0?void 0:X.whiteSpace)==="pre"){var He=b.above(f,{at:be.path,match:se=>ce.isElement(se)&&b.isBlock(f,se)});He&&oe.string(He[0]).includes(" ")&&(ae=!1)}}if(!U.startsWith("delete")||U.startsWith("deleteBy")){var[Qe]=S.getTargetRanges();if(Qe){var me=Q.toSlateRange(f,Qe,{exactMatch:!1,suppressThrow:!1});if(!L||!V.equals(L,me)){ae=!1;var Te=!re&&f.selection&&b.rangeRef(f,f.selection);G.select(f,me),Te&&br.set(f,Te)}}}if(re)return;if(ae||S.preventDefault(),L&&V.isExpanded(L)&&U.startsWith("delete")){var $e=U.endsWith("Backward")?"backward":"forward";b.deleteFragment(f,{direction:$e});return}switch(U){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{b.deleteFragment(f);break}case"deleteContent":case"deleteContentForward":{b.deleteForward(f);break}case"deleteContentBackward":{b.deleteBackward(f);break}case"deleteEntireSoftLine":{b.deleteBackward(f,{unit:"line"}),b.deleteForward(f,{unit:"line"});break}case"deleteHardLineBackward":{b.deleteBackward(f,{unit:"block"});break}case"deleteSoftLineBackward":{b.deleteBackward(f,{unit:"line"});break}case"deleteHardLineForward":{b.deleteForward(f,{unit:"block"});break}case"deleteSoftLineForward":{b.deleteForward(f,{unit:"line"});break}case"deleteWordBackward":{b.deleteBackward(f,{unit:"word"});break}case"deleteWordForward":{b.deleteForward(f,{unit:"word"});break}case"insertLineBreak":b.insertSoftBreak(f);break;case"insertParagraph":{b.insertBreak(f);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{U==="insertFromComposition"&&Q.isComposing(f)&&(y(!1),mn.set(f,!1)),(ne==null?void 0:ne.constructor.name)==="DataTransfer"?Q.insertData(f,ne):typeof ne=="string"&&(ae?A.current.push(()=>b.insertText(f,ne)):b.insertText(f,ne));break}}var K=(q=br.get(f))===null||q===void 0?void 0:q.unref();br.delete(f),K&&(!f.selection||!V.equals(f.selection,K))&&G.select(f,K)}},[f,$,F,a,s,w]),O=C.useCallback(S=>{S==null?($.cancel(),w.cancel(),da.delete(f),bn.delete(f),x.current&&Zt&&x.current.removeEventListener("beforeinput",k)):Zt&&S.addEventListener("beforeinput",k),x.current=S},[$,w,f,k]);Sr(()=>{var S=Q.getWindow(f);return S.document.addEventListener("selectionchange",w),()=>{S.document.removeEventListener("selectionchange",w)}},[w]);var j=r([f,[]]),z=i&&f.children.length===1&&Array.from(oe.texts(f)).length===1&&oe.string(f)===""&&!D,H=C.useCallback(S=>{if(S&&z){var q;E((q=S.getBoundingClientRect())===null||q===void 0?void 0:q.height)}else E(void 0)},[z]);if(z){var te=b.start(f,[]);j.push({[Yn]:!0,placeholder:i,onPlaceholderResize:H,anchor:te,focus:te})}var{marks:J}=f;if(R.hasMarkPlaceholder=!1,f.selection&&V.isCollapsed(f.selection)&&J){var{anchor:v}=f.selection,W=oe.leaf(f,v.path),ee=Zn(W,Cy);if(!de.equals(W,J,{loose:!0})){R.hasMarkPlaceholder=!0;var B=Object.fromEntries(Object.keys(ee).map(S=>[S,null]));j.push(Tt(Tt(Tt({[Rd]:!0},B),J),{},{anchor:v,focus:v}))}}return C.useEffect(()=>{setTimeout(()=>{var{selection:S}=f;if(S){var{anchor:q}=S,L=oe.leaf(f,q.path);if(J&&!de.equals(L,J,{loose:!0})){_t.set(f,J);return}}_t.delete(f)})}),C.createElement(Kd.Provider,{value:s},C.createElement(Ud.Provider,{value:r},C.createElement(yy,{node:x,receivedUserInput:T},C.createElement(p,Tt(Tt({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},g),{},{spellCheck:Zt||!ca?g.spellCheck:!1,autoCorrect:Zt||!ca?g.autoCorrect:"false",autoCapitalize:Zt||!ca?g.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:O,style:Tt(Tt({},m?{}:Tt({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},_?{minHeight:_}:{})),h),onBeforeInput:C.useCallback(S=>{if(!Zt&&!s&&!at(S,g.onBeforeInput)&&Q.hasSelectableTarget(f,S.target)&&(S.preventDefault(),!Q.isComposing(f))){var q=S.data;b.insertText(f,q)}},[g.onBeforeInput,f,s]),onInput:C.useCallback(S=>{if(!at(S,g.onInput)){if(M.current){M.current.handleInput();return}for(var q of A.current)q();A.current=[]}},[g.onInput]),onBlur:C.useCallback(S=>{if(!(s||R.isUpdatingSelection||!Q.hasSelectableTarget(f,S.target)||at(S,g.onBlur))){var q=Q.findDocumentOrShadowRoot(f);if(R.latestElement!==q.activeElement){var{relatedTarget:L}=S,U=Q.toDOMNode(f,f);if(L!==U&&!(Ct(L)&&L.hasAttribute("data-slate-spacer"))){if(L!=null&&nn(L)&&Q.hasDOMNode(f,L)){var ne=Q.toSlateNode(f,L);if(ce.isElement(ne)&&!f.isVoid(ne))return}if(mr){var re=q.getSelection();re==null||re.removeAllRanges()}en.delete(f)}}}},[s,R.isUpdatingSelection,R.latestElement,f,g.onBlur]),onClick:C.useCallback(S=>{if(Q.hasTarget(f,S.target)&&!at(S,g.onClick)&&nn(S.target)){var q=Q.toSlateNode(f,S.target),L=Q.findPath(f,q);if(!b.hasPath(f,L)||oe.get(f,L)!==q)return;if(S.detail===hy&&L.length>=1){var U=L;if(!(ce.isElement(q)&&b.isBlock(f,q))){var ne,re=b.above(f,{match:Ae=>ce.isElement(Ae)&&b.isBlock(f,Ae),at:L});U=(ne=re==null?void 0:re[1])!==null&&ne!==void 0?ne:L.slice(0,1)}var ae=b.range(f,U);G.select(f,ae);return}if(s)return;var fe=b.start(f,L),X=b.end(f,L),be=b.void(f,{at:fe}),he=b.void(f,{at:X});if(be&&he&&N.equals(be[1],he[1])){var xe=b.range(f,fe);G.select(f,xe)}}},[f,g.onClick,s]),onCompositionEnd:C.useCallback(S=>{if(Q.hasSelectableTarget(f,S.target)){var q;if(Q.isComposing(f)&&Promise.resolve().then(()=>{y(!1),mn.set(f,!1)}),(q=M.current)===null||q===void 0||q.handleCompositionEnd(S),at(S,g.onCompositionEnd)||ot)return;if(!mr&&!gb&&!fb&&!bb&&!vb&&S.data){var L=_t.get(f);_t.delete(f),L!==void 0&&(qt.set(f,f.marks),f.marks=L),b.insertText(f,S.data);var U=qt.get(f);qt.delete(f),U!==void 0&&(f.marks=U)}}},[g.onCompositionEnd,f]),onCompositionUpdate:C.useCallback(S=>{Q.hasSelectableTarget(f,S.target)&&!at(S,g.onCompositionUpdate)&&(Q.isComposing(f)||(y(!0),mn.set(f,!0)))},[g.onCompositionUpdate,f]),onCompositionStart:C.useCallback(S=>{if(Q.hasSelectableTarget(f,S.target)){var q;if((q=M.current)===null||q===void 0||q.handleCompositionStart(S),at(S,g.onCompositionStart)||ot)return;y(!0);var{selection:L}=f;if(L&&V.isExpanded(L)){b.deleteFragment(f);return}}},[g.onCompositionStart,f]),onCopy:C.useCallback(S=>{Q.hasSelectableTarget(f,S.target)&&!at(S,g.onCopy)&&!ul(S)&&(S.preventDefault(),Q.setFragmentData(f,S.clipboardData,"copy"))},[g.onCopy,f]),onCut:C.useCallback(S=>{if(!s&&Q.hasSelectableTarget(f,S.target)&&!at(S,g.onCut)&&!ul(S)){S.preventDefault(),Q.setFragmentData(f,S.clipboardData,"cut");var{selection:q}=f;if(q)if(V.isExpanded(q))b.deleteFragment(f);else{var L=oe.parent(f,q.anchor.path);b.isVoid(f,L)&&G.delete(f)}}},[s,f,g.onCut]),onDragOver:C.useCallback(S=>{if(Q.hasTarget(f,S.target)&&!at(S,g.onDragOver)){var q=Q.toSlateNode(f,S.target);ce.isElement(q)&&b.isVoid(f,q)&&S.preventDefault()}},[g.onDragOver,f]),onDragStart:C.useCallback(S=>{if(!s&&Q.hasTarget(f,S.target)&&!at(S,g.onDragStart)){var q=Q.toSlateNode(f,S.target),L=Q.findPath(f,q),U=ce.isElement(q)&&b.isVoid(f,q)||b.void(f,{at:L,voids:!0});if(U){var ne=b.range(f,L);G.select(f,ne)}R.isDraggingInternally=!0,Q.setFragmentData(f,S.dataTransfer,"drag")}},[s,f,g.onDragStart,R]),onDrop:C.useCallback(S=>{if(!s&&Q.hasTarget(f,S.target)&&!at(S,g.onDrop)){S.preventDefault();var q=f.selection,L=Q.findEventRange(f,S),U=S.dataTransfer;G.select(f,L),R.isDraggingInternally&&q&&!V.equals(q,L)&&!b.void(f,{at:L,voids:!0})&&G.delete(f,{at:q}),Q.insertData(f,U),Q.isFocused(f)||Q.focus(f)}R.isDraggingInternally=!1},[s,f,g.onDrop,R]),onDragEnd:C.useCallback(S=>{!s&&R.isDraggingInternally&&g.onDragEnd&&Q.hasTarget(f,S.target)&&g.onDragEnd(S),R.isDraggingInternally=!1},[s,R,g,f]),onFocus:C.useCallback(S=>{if(!s&&!R.isUpdatingSelection&&Q.hasEditableTarget(f,S.target)&&!at(S,g.onFocus)){var q=Q.toDOMNode(f,f),L=Q.findDocumentOrShadowRoot(f);if(R.latestElement=L.activeElement,$n&&S.target!==q){q.focus();return}en.set(f,!0)}},[s,R,f,g.onFocus]),onKeyDown:C.useCallback(S=>{if(!s&&Q.hasEditableTarget(f,S.target)){var q;(q=M.current)===null||q===void 0||q.handleKeyDown(S);var{nativeEvent:L}=S;if(Q.isComposing(f)&&L.isComposing===!1&&(mn.set(f,!1),y(!1)),at(S,g.onKeyDown)||Q.isComposing(f))return;var{selection:U}=f,ne=f.children[U!==null?U.focus.path[0]:0],re=vd(oe.string(ne))==="rtl";if(qe.isRedo(L)){S.preventDefault();var ae=f;typeof ae.redo=="function"&&ae.redo();return}if(qe.isUndo(L)){S.preventDefault();var fe=f;typeof fe.undo=="function"&&fe.undo();return}if(qe.isMoveLineBackward(L)){S.preventDefault(),G.move(f,{unit:"line",reverse:!0});return}if(qe.isMoveLineForward(L)){S.preventDefault(),G.move(f,{unit:"line"});return}if(qe.isExtendLineBackward(L)){S.preventDefault(),G.move(f,{unit:"line",edge:"focus",reverse:!0});return}if(qe.isExtendLineForward(L)){S.preventDefault(),G.move(f,{unit:"line",edge:"focus"});return}if(qe.isMoveBackward(L)){S.preventDefault(),U&&V.isCollapsed(U)?G.move(f,{reverse:!re}):G.collapse(f,{edge:re?"end":"start"});return}if(qe.isMoveForward(L)){S.preventDefault(),U&&V.isCollapsed(U)?G.move(f,{reverse:re}):G.collapse(f,{edge:re?"start":"end"});return}if(qe.isMoveWordBackward(L)){S.preventDefault(),U&&V.isExpanded(U)&&G.collapse(f,{edge:"focus"}),G.move(f,{unit:"word",reverse:!re});return}if(qe.isMoveWordForward(L)){S.preventDefault(),U&&V.isExpanded(U)&&G.collapse(f,{edge:"focus"}),G.move(f,{unit:"word",reverse:re});return}if(Zt){if((Od||mr)&&U&&(qe.isDeleteBackward(L)||qe.isDeleteForward(L))&&V.isCollapsed(U)){var X=oe.parent(f,U.anchor.path);if(ce.isElement(X)&&b.isVoid(f,X)&&(b.isInline(f,X)||b.isBlock(f,X))){S.preventDefault(),b.deleteBackward(f,{unit:"block"});return}}}else{if(qe.isBold(L)||qe.isItalic(L)||qe.isTransposeCharacter(L)){S.preventDefault();return}if(qe.isSoftBreak(L)){S.preventDefault(),b.insertSoftBreak(f);return}if(qe.isSplitBlock(L)){S.preventDefault(),b.insertBreak(f);return}if(qe.isDeleteBackward(L)){S.preventDefault(),U&&V.isExpanded(U)?b.deleteFragment(f,{direction:"backward"}):b.deleteBackward(f);return}if(qe.isDeleteForward(L)){S.preventDefault(),U&&V.isExpanded(U)?b.deleteFragment(f,{direction:"forward"}):b.deleteForward(f);return}if(qe.isDeleteLineBackward(L)){S.preventDefault(),U&&V.isExpanded(U)?b.deleteFragment(f,{direction:"backward"}):b.deleteBackward(f,{unit:"line"});return}if(qe.isDeleteLineForward(L)){S.preventDefault(),U&&V.isExpanded(U)?b.deleteFragment(f,{direction:"forward"}):b.deleteForward(f,{unit:"line"});return}if(qe.isDeleteWordBackward(L)){S.preventDefault(),U&&V.isExpanded(U)?b.deleteFragment(f,{direction:"backward"}):b.deleteBackward(f,{unit:"word"});return}if(qe.isDeleteWordForward(L)){S.preventDefault(),U&&V.isExpanded(U)?b.deleteFragment(f,{direction:"forward"}):b.deleteForward(f,{unit:"word"});return}}}},[s,f,g.onKeyDown]),onPaste:C.useCallback(S=>{!s&&Q.hasEditableTarget(f,S.target)&&!at(S,g.onPaste)&&(!Zt||Cb(S.nativeEvent)||mr)&&(S.preventDefault(),Q.insertData(f,S.clipboardData))},[s,f,g.onPaste])}),C.createElement(xy,{decorations:j,node:f,renderElement:o,renderPlaceholder:u,renderLeaf:l,selection:f.selection})))))},Ey=e=>{var{attributes:t,children:n}=e;return C.createElement("span",Tt({},t),n,ot&&C.createElement("br",null))},ky=()=>[],_y=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&V.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),M0(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},at=(e,t)=>{if(!t)return!1;var n=t(e);return n??(e.isDefaultPrevented()||e.isPropagationStopped())},ul=e=>nn(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),By=(e,t)=>{if(!t)return!1;var n=t(e);return n??e.defaultPrevented},Ay=C.createContext(!1),Fy=C.createContext({});function Ty(e){var t=C.useRef([]).current,n=C.useRef({editor:e}).current,r=C.useCallback(i=>{n.editor=i,t.forEach(s=>s(i))},[t,n]),a=C.useMemo(()=>({getSlate:()=>n.editor,addEventListener:i=>(t.push(i),()=>{t.splice(t.indexOf(i),1)})}),[t,n]);return{selectorContext:a,onChange:r}}var Sy=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],jy=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:a,onValueChange:i,initialValue:s}=e,o=Zn(e,Sy),[l,u]=C.useState(()=>{if(!oe.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(Je.stringify(s)));if(!b.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(Je.stringify(t)));return t.children=s,Object.assign(t,o),{v:0,editor:t}}),{selectorContext:c,onChange:h}=Ty(t),p=C.useCallback(f=>{var D;switch(r&&r(t.children),f==null||(D=f.operation)===null||D===void 0?void 0:D.type){case"set_selection":a==null||a(t.selection);break;default:i==null||i(t.children)}u(y=>({v:y.v+1,editor:t})),h(t)},[t,h,r,a,i]);C.useEffect(()=>(bs.set(t,p),()=>{bs.set(t,()=>{})}),[t,p]);var[m,g]=C.useState(Q.isFocused(t));return C.useEffect(()=>{g(Q.isFocused(t))},[t]),Sr(()=>{var f=()=>g(Q.isFocused(t));return jd>=17?(document.addEventListener("focusin",f),document.addEventListener("focusout",f),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",f)}):(document.addEventListener("focus",f,!0),document.addEventListener("blur",f,!0),()=>{document.removeEventListener("focus",f,!0),document.removeEventListener("blur",f,!0)})},[]),C.createElement(Fy.Provider,{value:c},C.createElement(Zd.Provider,{value:l},C.createElement(no.Provider,{value:l.editor},C.createElement(Ay.Provider,{value:m},n))))},ll=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},cl=(e,t,n)=>{var r=Q.toDOMRange(e,t).getBoundingClientRect(),a=Q.toDOMRange(e,n).getBoundingClientRect();return ll(r,a)&&ll(a,r)},Oy=(e,t)=>{var n=b.range(e,V.end(t)),r=Array.from(b.positions(e,{at:t})),a=0,i=r.length,s=Math.floor(i/2);if(cl(e,b.range(e,r[a]),n))return b.range(e,r[a],n);if(r.length<2)return b.range(e,r[r.length-1],n);for(;s!==r.length&&s!==a;)cl(e,b.range(e,r[s]),n)?i=s:a=s,s=Math.floor((a+i)/2);return b.range(e,r[i],n)};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 fl(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){xt(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 Py=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 Za.set(r,new WeakMap),r.addMark=(u,c)=>{var h,p;(h=io.get(r))===null||h===void 0||h(),!_t.get(r)&&(p=ct.get(r))!==null&&p!==void 0&&p.length&&_t.set(r,null),qt.delete(r),o(u,c)},r.removeMark=u=>{var c;!_t.get(r)&&(c=ct.get(r))!==null&&c!==void 0&&c.length&&_t.set(r,null),qt.delete(r),l(u)},r.deleteBackward=u=>{if(u!=="line")return s(u);if(r.selection&&V.isCollapsed(r.selection)){var c=b.above(r,{match:g=>ce.isElement(g)&&b.isBlock(r,g),at:r.selection});if(c){var[,h]=c,p=b.range(r,h,r.selection.anchor),m=Oy(r,p);V.isCollapsed(m)||G.delete(r,{at:m})}}},r.apply=u=>{var c=[],h=[],p=ct.get(r);if(p!=null&&p.length){var m=p.map(O=>Pb(O,u)).filter(Boolean);ct.set(r,m)}var g=Qt.get(r);g&&Qt.set(r,Xu(r,g,u));var f=Gt.get(r);if(f!=null&&f.at){var D=Ee.isPoint(f==null?void 0:f.at)?Cs(r,f.at,u):Xu(r,f.at,u);Gt.set(r,D?fl(fl({},f),{},{at:D}):null)}switch(u.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{c.push(...jn(r,u.path));break}case"set_selection":{var y;(y=br.get(r))===null||y===void 0||y.unref(),br.delete(r);break}case"insert_node":case"remove_node":{c.push(...jn(r,N.parent(u.path)));break}case"merge_node":{var x=N.previous(u.path);c.push(...jn(r,x));break}case"move_node":{var A=N.common(N.parent(u.path),N.parent(u.newPath));c.push(...jn(r,A));var _;N.isBefore(u.path,u.newPath)?(c.push(...jn(r,N.parent(u.path))),_=u.newPath):(c.push(...jn(r,N.parent(u.newPath))),_=u.path);var E=oe.get(t,N.parent(_)),F=Q.findKey(r,E),T=b.pathRef(r,N.parent(_));h.push([T,F]);break}}a(u);for(var[I,R]of c){var[M]=b.node(r,I);ka.set(M,R)}for(var[$,w]of h)if($.current){var[k]=b.node(r,$.current);ka.set(k,w)}},r.setFragmentData=u=>{var{selection:c}=r;if(c){var[h,p]=V.edges(c),m=b.void(r,{at:h.path}),g=b.void(r,{at:p.path});if(!(V.isCollapsed(c)&&!m)){var f=Q.toDOMRange(r,c),D=f.cloneContents(),y=D.childNodes[0];if(D.childNodes.forEach(M=>{M.textContent&&M.textContent.trim()!==""&&(y=M)}),g){var[x]=g,A=f.cloneRange(),_=Q.toDOMNode(r,x);A.setEndAfter(_),D=A.cloneContents()}if(m&&(y=D.querySelector("[data-slate-spacer]")),Array.from(D.querySelectorAll("[data-slate-zero-width]")).forEach(M=>{var $=M.getAttribute("data-slate-zero-width")==="n";M.textContent=$?`
112
- `:""}),Md(y)){var E=y.ownerDocument.createElement("span");E.style.whiteSpace="pre",E.appendChild(y),D.appendChild(E),y=E}var F=r.getFragment(),T=JSON.stringify(F),I=window.btoa(encodeURIComponent(T));y.setAttribute("data-slate-fragment",I),u.setData("application/".concat(n),I);var R=D.ownerDocument.createElement("div");return R.appendChild(D),R.setAttribute("hidden","true"),D.ownerDocument.body.appendChild(R),u.setData("text/html",R.innerHTML),u.setData("text/plain",$d(R)),D.ownerDocument.body.removeChild(R),u}}},r.insertData=u=>{r.insertFragmentData(u)||r.insertTextData(u)},r.insertFragmentData=u=>{var c=u.getData("application/".concat(n))||_b(u);if(c){var h=decodeURIComponent(window.atob(c)),p=JSON.parse(h);return r.insertFragment(p),!0}return!1},r.insertTextData=u=>{var c=u.getData("text/plain");if(c){var h=c.split(/\r\n|\r|\n/),p=!1;for(var m of h)p&&G.splitNodes(r,{always:!0}),r.insertText(m),p=!0;return!0}return!1},r.onChange=u=>{var c=jd<18?gc.unstable_batchedUpdates:h=>h();c(()=>{var h=bs.get(r);h&&h(u),i(u)})},r},jn=(e,t)=>{var n=[];for(var[r,a]of b.levels(e,{at:t})){var i=Q.findKey(e,r);n.push([a,i])}return n};const Ny={id:"",tabbableOption:"",setFocus:()=>{},openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null},lastAnchor:null,dispatch:()=>{},reportError:e=>{console.error(e)}},Vt=C.createContext(Ny);var Z=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e))(Z||{}),Ot=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(Ot||{});const Ry=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case Z.blockquote:return d.jsx("blockquote",{className:"subtle",...e,children:t});case Z.link:return d.jsx("a",{...e,children:t});case Z.li:return d.jsx("li",{...e,children:t});case Z.mention:const a=r;return d.jsxs("a",{...e,className:"mention",children:["@",(a==null?void 0:a.name)||"",t]});case Z.ol:return d.jsx("ol",{...e,children:t});case Z.ul:return d.jsx("ul",{...e,children:t});case Z.span:return d.jsx("span",{...e,children:t});case Z.paragraph:return d.jsx("p",{...e,children:t});default:return d.jsx("span",{...e,children:t})}},My=({attributes:e,children:t,leaf:n})=>{const r=n;return r[Z.bold]&&(t=d.jsx("strong",{children:t})),r[Z.italic]&&(t=d.jsx("em",{children:t})),r[Z.strikethrough]&&(t=d.jsx("s",{children:t})),d.jsx("span",{...e,children:t})},ws="MENTION: ",Gd={anchor:{offset:0,path:[0,0]},focus:{offset:0,path:[0,0]}},hl={"mention-popover":35,default:-52},Ci=16,Qd=(e,t,n)=>{const r=C.useRef(null),{showLinkEditor:a,mentionPopover:i}=C.useContext(Vt),s=t==="link-editor"?a:i.show,o=[s];return e&&t==="link-editor"&&o.push(e.selection),C.useEffect(()=>{var m,g;if(!(r!=null&&r.current)||!s)return;const l=r==null?void 0:r.current;if(!l)return;let u,c=0;if(t==="mention-popover"){const{position:f}=i,D=A=>{if(!b.hasPath(e,A.path))return!1;const _=oe.get(e,A.path);return b.isEditor(_)||ce.isElement(_)?A.offset<=_.children.length:de.isText(_)?A.offset<=_.text.length:!1};if(f&&(!D(f==null?void 0:f.anchor)||!D(f==null?void 0:f.focus)))return;u=Q.toDOMRange(e,f||Gd).getBoundingClientRect();const x=(m=document.getElementById(n))==null?void 0:m.getBoundingClientRect();l.style.setProperty("--width",`${((x==null?void 0:x.width)||0)/Ci}rem`),c=(x==null?void 0:x.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=hl[t]||hl.default,p=((u==null?void 0:u.top)||0)+window.scrollY+h;c===0&&(c=Math.max(((u==null?void 0:u.left)||0)-(l.offsetWidth-((u==null?void 0:u.width)||0)),0)),l.style.top=`${p/Ci}rem`,l.style.left=`${c/Ci}rem`},o),r},Iy=e=>{const[t,n]=C.useState(null);return C.useEffect(()=>{const{selection:r}=e;if(!r){n(null);return}const[a]=b.nodes(e,{at:r,match:i=>i.type===Z.link});if(a){const i=a[0],s=Rc(i.link),o=i.children[0],l=(o==null?void 0:o.text)||"";n({...s,text:l})}else n(null)},[e,e.selection]),t};var st=(e=>(e.paragraph="paragraph",e.heading="heading",e.list="list",e.listItem="listItem",e.link="link",e.mention="mention",e.image="image",e.blockquote="blockquote",e.code="code",e.html="html",e.emphasis="emphasis",e.strong="strong",e.delete="delete",e.inlineCode="inlineCode",e.thematicBreak="thematicBreak",e.text="text",e))(st||{});const Ln={[Z.paragraph]:Z.paragraph,[Z.blockquote]:Z.blockquote,[Z.codeblock]:Z.codeblock,[Z.link]:Z.link,[Z.ul]:Z.ul,[Z.ol]:Z.ol,[Z.li]:Z.li,[Z.mention]:Z.mention,[Z.heading]:{1:"heading_one",2:"heading_two",3:"heading_three",4:"heading_four",5:"heading_five",6:"heading_six"},[Ot.emphasis]:Z.italic,[Ot.strong]:Z.bold,[Ot.delete]:Z.strikethrough,[Ot.code]:Z.code,[Z.hr]:Z.hr,[Z.image]:Z.image};function ml(e){if(e)throw e}var fa=Object.prototype.hasOwnProperty,Jd=Object.prototype.toString,pl=Object.defineProperty,gl=Object.getOwnPropertyDescriptor,vl=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Jd.call(t)==="[object Array]"},bl=function(t){if(!t||Jd.call(t)!=="[object Object]")return!1;var n=fa.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&fa.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||fa.call(t,a)},yl=function(t,n){pl&&n.name==="__proto__"?pl(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Dl=function(t,n){if(n==="__proto__")if(fa.call(t,n)){if(gl)return gl(t,n).value}else return;return t[n]},$y=function e(){var t,n,r,a,i,s,o=arguments[0],l=1,u=arguments.length,c=!1;for(typeof o=="boolean"&&(c=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Dl(o,n),a=Dl(t,n),o!==a&&(c&&a&&(bl(a)||(i=vl(a)))?(i?(i=!1,s=r&&vl(r)?r:[]):s=r&&bl(r)?r:{},yl(o,{name:n,newValue:e(c,s,a)})):typeof a<"u"&&yl(o,{name:n,newValue:a}));return o};const xi=wn($y);function Es(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 Ly(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...u){const c=e[++i];let h=-1;if(l){s(l);return}for(;++h<a.length;)(u[h]===null||u[h]===void 0)&&(u[h]=a[h]);a=u,c?zy(c,o)(...u):s(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function zy(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(a);try{l=e.apply(this,s)}catch(u){const c=u;if(o&&n)throw c;return a(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){n||(n=!0,t(s,...o))}function i(s){a(null,s)}}function yr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cl(e.position):"start"in e||"end"in e?Cl(e):"line"in e||"column"in e?ks(e):""}function ks(e){return xl(e&&e.line)+":"+xl(e&&e.column)}function Cl(e){return ks(e&&e.start)+"-"+ks(e&&e.end)}function xl(e){return e&&typeof e=="number"?e:1}class ht extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=yr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ht.prototype.file="";ht.prototype.name="";ht.prototype.reason="";ht.prototype.message="";ht.prototype.stack="";ht.prototype.column=void 0;ht.prototype.line=void 0;ht.prototype.ancestors=void 0;ht.prototype.cause=void 0;ht.prototype.fatal=void 0;ht.prototype.place=void 0;ht.prototype.ruleId=void 0;ht.prototype.source=void 0;const St={basename:qy,dirname:Wy,extname:Hy,join:Uy,sep:"/"};function qy(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pr(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 Wy(e){if(Pr(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 Hy(e){Pr(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 Uy(...e){let t=-1,n;for(;++t<e.length;)Pr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Vy(n)}function Vy(e){Pr(e);const t=e.codePointAt(0)===47;let n=Ky(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ky(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 Pr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Zy={cwd:Yy};function Yy(){return"/"}function _s(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Gy(e){if(typeof e=="string")e=new URL(e);else if(!_s(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 Qy(e)}function Qy(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 wi=["history","path","basename","stem","extname","dirname"];class Jy{constructor(t){let n;t?_s(t)?n={path:t}:typeof t=="string"||Xy(t)?n={value:t}:n=t:n={},this.cwd=Zy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<wi.length;){const i=wi[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)wi.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?St.basename(this.path):void 0}set basename(t){ki(t,"basename"),Ei(t,"basename"),this.path=St.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?St.dirname(this.path):void 0}set dirname(t){wl(this.basename,"dirname"),this.path=St.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?St.extname(this.path):void 0}set extname(t){if(Ei(t,"extname"),wl(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=St.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_s(t)&&(t=Gy(t)),ki(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?St.basename(this.path,this.extname):void 0}set stem(t){ki(t,"stem"),Ei(t,"stem"),this.path=St.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new ht(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ei(e,t){if(e&&e.includes(St.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+St.sep+"`")}function ki(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Xy(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const e1=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},t1={}.hasOwnProperty;class uo extends e1{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=Ly()}copy(){const t=new uo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(xi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ai("data",this.frozen),this.namespace[t]=n,this):t1.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ai("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=Gr(t),r=this.parser||this.Parser;return _i("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),_i("process",this.parser||this.Parser),Bi("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=Gr(t),l=r.parse(o);r.run(l,o,function(c,h,p){if(c||!h||!p)return u(c);const m=h,g=r.stringify(m,p);a1(g)?p.value=g:p.result=g,u(c,p)});function u(c,h){c||!h?s(c):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),_i("processSync",this.parser||this.Parser),Bi("processSync",this.compiler||this.Compiler),this.process(t,a),kl("processSync","process",n),r;function a(i,s){n=!0,ml(i),r=s}}run(t,n,r){El(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=Gr(n);a.run(t,l,u);function u(c,h,p){const m=h||t;c?o(c):s?s(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),kl("runSync","run",r),a;function i(s,o){ml(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=Gr(n),a=this.compiler||this.Compiler;return Bi("stringify",a),El(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Ai("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(a.settings=xi(!0,a.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...c]);else if(c.length>0){let[m,...g]=c;const f=r[p][1];Es(f)&&Es(m)&&(m=xi(!0,f,m)),r[p]=[u,m,...g]}}}}const n1=new uo().freeze();function _i(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ai(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 El(e){if(!Es(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function kl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gr(e){return r1(e)?e:new Jy(e)}function r1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function a1(e){return typeof e=="string"||i1(e)}function i1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s1={};function o1(e,t){const n=t||s1,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Xd(e,r,a)}function Xd(e,t,n){if(u1(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 _l(e.children,t,n)}return Array.isArray(e)?_l(e,t,n):""}function _l(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Xd(e[a],t,n);return r.join("")}function u1(e){return!!(e&&typeof e=="object")}const Bl=document.createElement("i");function lo(e){const t="&"+e+";";Bl.innerHTML=t;const n=Bl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Rt(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 Dt(e,t){return e.length>0?(Rt(e,e.length,0,t),e):t}const Al={}.hasOwnProperty;function l1(e){const t={};let n=-1;for(;++n<e.length;)c1(t,e[n]);return t}function c1(e,t){let n;for(n in t){const a=(Al.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Al.call(a,s)||(a[s]=[]);const o=i[s];d1(a[s],Array.isArray(o)?o:o?[o]:[])}}}function d1(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Rt(e,0,0,r)}function ef(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 Wn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jt=un(/[A-Za-z]/),Bt=un(/[\dA-Za-z]/),f1=un(/[#-'*+\--9=?A-Z^-~]/);function Bs(e){return e!==null&&(e<32||e===127)}const As=un(/\d/),h1=un(/[\dA-Fa-f]/),m1=un(/[!-/:-@[-`{-~]/);function ye(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const p1=un(/\p{P}|\p{S}/u),g1=un(/\s/);function un(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ie(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return je(l)?(e.enter(n),o(l)):t(l)}function o(l){return je(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const v1={tokenize:b1};function b1(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"),Ie(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 y1={tokenize:D1},Fl={tokenize:C1};function D1(e){const t=this,n=[];let r=0,a,i,s;return o;function o(A){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,u)(A)}return u(A)}function l(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const _=t.events.length;let E=_,F;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){F=t.events[E][1].end;break}y(r);let T=_;for(;T<t.events.length;)t.events[T][1].end=Object.assign({},F),T++;return Rt(t.events,E+1,0,t.events.slice(_)),t.events.length=T,u(A)}return o(A)}function u(A){if(r===n.length){if(!a)return p(A);if(a.currentConstruct&&a.currentConstruct.concrete)return g(A);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fl,c,h)(A)}function c(A){return a&&x(),y(r),p(A)}function h(A){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(A)}function p(A){return t.containerState={},e.attempt(Fl,m,g)(A)}function m(A){return r++,n.push([t.currentConstruct,t.containerState]),p(A)}function g(A){if(A===null){a&&x(),y(0),e.consume(A);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),f(A)}function f(A){if(A===null){D(e.exit("chunkFlow"),!0),y(0),e.consume(A);return}return ye(A)?(e.consume(A),D(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(A),f)}function D(A,_){const E=t.sliceStream(A);if(_&&E.push(null),A.previous=i,i&&(i.next=A),i=A,a.defineSkip(A.start),a.write(E),t.parser.lazy[A.start.line]){let F=a.events.length;for(;F--;)if(a.events[F][1].start.offset<s&&(!a.events[F][1].end||a.events[F][1].end.offset>s))return;const T=t.events.length;let I=T,R,M;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(R){M=t.events[I][1].end;break}R=!0}for(y(r),F=T;F<t.events.length;)t.events[F][1].end=Object.assign({},M),F++;Rt(t.events,I+1,0,t.events.slice(T)),t.events.length=F}}function y(A){let _=n.length;for(;_-- >A;){const E=n[_];t.containerState=E[1],E[0].exit.call(t,e)}n.length=A}function x(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function C1(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Tl(e){if(e===null||ft(e)||g1(e))return 1;if(p1(e))return 2}function co(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 Fs={name:"attention",tokenize:w1,resolveAll:x1};function x1(e,t){let n=-1,r,a,i,s,o,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);Sl(h,-l),Sl(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},o.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Dt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Dt(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=Dt(u,co(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Dt(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Dt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Rt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function w1(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Tl(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const u=e.exit("attentionSequence"),c=Tl(l),h=!c||c===2&&a||n.includes(l),p=!a||a===2&&c||n.includes(r);return u._open=!!(i===42?h:h&&(a||!p)),u._close=!!(i===42?p:p&&(c||!h)),t(l)}}function Sl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const E1={name:"autolink",tokenize:k1};function k1(e,t,n){let r=0;return a;function a(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return jt(m)?(e.consume(m),s):u(m)}function s(m){return m===43||m===45||m===46||Bt(m)?(r=1,o(m)):u(m)}function o(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||Bt(m))&&r++<32?(e.consume(m),o):(r=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Bs(m)?n(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),c):f1(m)?(e.consume(m),u):n(m)}function c(m){return Bt(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||Bt(m))&&r++<63){const g=m===45?p:h;return e.consume(m),g}return n(m)}}const Ya={tokenize:_1,partial:!0};function _1(e,t,n){return r;function r(i){return je(i)?Ie(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ye(i)?t(i):n(i)}}const tf={name:"blockQuote",tokenize:B1,continuation:{tokenize:A1},exit:F1};function B1(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 je(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function A1(e,t,n){const r=this;return a;function a(s){return je(s)?Ie(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(tf,t,n)(s)}}function F1(e){e.exit("blockQuote")}const nf={name:"characterEscape",tokenize:T1};function T1(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 m1(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const rf={name:"characterReference",tokenize:S1};function S1(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=Bt,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=h1,c):(e.enter("characterReferenceValue"),i=7,s=As,c(h))}function c(h){if(h===59&&a){const p=e.exit("characterReferenceValue");return s===Bt&&!lo(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),c):n(h)}}const jl={tokenize:O1,partial:!0},Ol={name:"codeFenced",tokenize:j1,concrete:!0};function j1(e,t,n){const r=this,a={tokenize:E,partial:!0};let i=0,s=0,o;return l;function l(F){return u(F)}function u(F){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=F,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(F)}function c(F){return F===o?(s++,e.consume(F),c):s<3?n(F):(e.exit("codeFencedFenceSequence"),je(F)?Ie(e,h,"whitespace")(F):h(F))}function h(F){return F===null||ye(F)?(e.exit("codeFencedFence"),r.interrupt?t(F):e.check(jl,f,_)(F)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(F))}function p(F){return F===null||ye(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(F)):je(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ie(e,m,"whitespace")(F)):F===96&&F===o?n(F):(e.consume(F),p)}function m(F){return F===null||ye(F)?h(F):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(F))}function g(F){return F===null||ye(F)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(F)):F===96&&F===o?n(F):(e.consume(F),g)}function f(F){return e.attempt(a,_,D)(F)}function D(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),y}function y(F){return i>0&&je(F)?Ie(e,x,"linePrefix",i+1)(F):x(F)}function x(F){return F===null||ye(F)?e.check(jl,f,_)(F):(e.enter("codeFlowValue"),A(F))}function A(F){return F===null||ye(F)?(e.exit("codeFlowValue"),x(F)):(e.consume(F),A)}function _(F){return e.exit("codeFenced"),t(F)}function E(F,T,I){let R=0;return M;function M(j){return F.enter("lineEnding"),F.consume(j),F.exit("lineEnding"),$}function $(j){return F.enter("codeFencedFence"),je(j)?Ie(F,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):w(j)}function w(j){return j===o?(F.enter("codeFencedFenceSequence"),k(j)):I(j)}function k(j){return j===o?(R++,F.consume(j),k):R>=s?(F.exit("codeFencedFenceSequence"),je(j)?Ie(F,O,"whitespace")(j):O(j)):I(j)}function O(j){return j===null||ye(j)?(F.exit("codeFencedFence"),T(j)):I(j)}}}function O1(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 Fi={name:"codeIndented",tokenize:N1},P1={tokenize:R1,partial:!0};function N1(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),Ie(e,i,"linePrefix",4+1)(u)}function i(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ye(u)?e.attempt(P1,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 R1(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):Ie(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 M1={name:"codeText",tokenize:L1,resolve:I1,previous:$1};function I1(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 $1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function L1(e,t,n){let r=0,a,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),a=0,c(h)):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 c(h){return h===96?(e.consume(h),a++,c):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}function af(e){const t={};let n=-1,r,a,i,s,o,l,u;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[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,z1(e,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(s=e[i],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(a&&(e[a][1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},e[a][1].start),o=e.slice(a,n),o.unshift(r),Rt(e,a,n-a+1,o))}}return!u}function z1(e,t){const n=e[t][1],r=e[t][2];let a=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),o=s.events,l=[],u={};let c,h,p=-1,m=n,g=0,f=0;const D=[f];for(;m;){for(;e[++a][1]!==m;);i.push(a),m._tokenizer||(c=r.sliceStream(m),m.next||c.push(null),h&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(f=p+1,D.push(f),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):D.pop(),p=D.length;p--;){const y=o.slice(D[p],D[p+1]),x=i.pop();l.unshift([x,x+y.length-1]),Rt(e,x,2,y)}for(p=-1;++p<l.length;)u[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return u}const q1={tokenize:U1,resolve:H1},W1={tokenize:V1,partial:!0};function H1(e){return af(e),e}function U1(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(W1,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 V1(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ie(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 sf(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(y){return y===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(y),e.exit(i),p):y===null||y===32||y===41||Bs(y)?n(y):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function p(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),p(y)):y===null||y===60||ye(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function f(y){return!c&&(y===null||y===41||ft(y))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(y)):c<u&&y===40?(e.consume(y),c++,f):y===41?(e.consume(y),c--,f):y===null||y===32||y===40||Bs(y)?n(y):(e.consume(y),y===92?D:f)}function D(y){return y===40||y===41||y===92?(e.consume(y),f):f(y)}}function of(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(m){return e.enter(r),e.enter(a),e.consume(m),e.exit(a),e.enter(i),c}function c(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(i),e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):ye(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||ye(m)||o++>999?(e.exit("chunkString"),c(m)):(e.consume(m),l||(l=!je(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,h):h(m)}}function uf(e,t,n,r,a,i){let s;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(a),e.consume(p),e.exit(a),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===s?(e.exit(i),l(s)):p===null?n(p):ye(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ie(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||ye(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?h:c)}function h(p){return p===s||p===92?(e.consume(p),c):c(p)}}function Dr(e,t){let n;return r;function r(a){return ye(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):je(a)?Ie(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const K1={name:"definition",tokenize:Y1},Z1={tokenize:G1,partial:!0};function Y1(e,t,n){const r=this;let a;return i;function i(m){return e.enter("definition"),s(m)}function s(m){return of.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return a=Wn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return ft(m)?Dr(e,u)(m):u(m)}function u(m){return sf(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(Z1,h,h)(m)}function h(m){return je(m)?Ie(e,p,"whitespace")(m):p(m)}function p(m){return m===null||ye(m)?(e.exit("definition"),r.parser.defined.push(a),t(m)):n(m)}}function G1(e,t,n){return r;function r(o){return ft(o)?Dr(e,a)(o):n(o)}function a(o){return uf(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return je(o)?Ie(e,s,"whitespace")(o):s(o)}function s(o){return o===null||ye(o)?t(o):n(o)}}const Q1={name:"hardBreakEscape",tokenize:J1};function J1(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 X1={name:"headingAtx",tokenize:tD,resolve:eD};function eD(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"},Rt(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function tD(e,t,n){let r=0;return a;function a(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||ft(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ye(c)?(e.exit("atxHeading"),t(c)):je(c)?Ie(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||ft(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const nD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Pl=["pre","script","style","textarea"],rD={name:"htmlFlow",tokenize:oD,resolveTo:sD,concrete:!0},aD={tokenize:lD,partial:!0},iD={tokenize:uD,partial:!0};function sD(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 oD(e,t,n){const r=this;let a,i,s,o,l;return u;function u(B){return c(B)}function c(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),h}function h(B){return B===33?(e.consume(B),p):B===47?(e.consume(B),i=!0,f):B===63?(e.consume(B),a=3,r.interrupt?t:v):jt(B)?(e.consume(B),s=String.fromCharCode(B),D):n(B)}function p(B){return B===45?(e.consume(B),a=2,m):B===91?(e.consume(B),a=5,o=0,g):jt(B)?(e.consume(B),a=4,r.interrupt?t:v):n(B)}function m(B){return B===45?(e.consume(B),r.interrupt?t:v):n(B)}function g(B){const S="CDATA[";return B===S.charCodeAt(o++)?(e.consume(B),o===S.length?r.interrupt?t:w:g):n(B)}function f(B){return jt(B)?(e.consume(B),s=String.fromCharCode(B),D):n(B)}function D(B){if(B===null||B===47||B===62||ft(B)){const S=B===47,q=s.toLowerCase();return!S&&!i&&Pl.includes(q)?(a=1,r.interrupt?t(B):w(B)):nD.includes(s.toLowerCase())?(a=6,S?(e.consume(B),y):r.interrupt?t(B):w(B)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):i?x(B):A(B))}return B===45||Bt(B)?(e.consume(B),s+=String.fromCharCode(B),D):n(B)}function y(B){return B===62?(e.consume(B),r.interrupt?t:w):n(B)}function x(B){return je(B)?(e.consume(B),x):M(B)}function A(B){return B===47?(e.consume(B),M):B===58||B===95||jt(B)?(e.consume(B),_):je(B)?(e.consume(B),A):M(B)}function _(B){return B===45||B===46||B===58||B===95||Bt(B)?(e.consume(B),_):E(B)}function E(B){return B===61?(e.consume(B),F):je(B)?(e.consume(B),E):A(B)}function F(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),l=B,T):je(B)?(e.consume(B),F):I(B)}function T(B){return B===l?(e.consume(B),l=null,R):B===null||ye(B)?n(B):(e.consume(B),T)}function I(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||ft(B)?E(B):(e.consume(B),I)}function R(B){return B===47||B===62||je(B)?A(B):n(B)}function M(B){return B===62?(e.consume(B),$):n(B)}function $(B){return B===null||ye(B)?w(B):je(B)?(e.consume(B),$):n(B)}function w(B){return B===45&&a===2?(e.consume(B),z):B===60&&a===1?(e.consume(B),H):B===62&&a===4?(e.consume(B),W):B===63&&a===3?(e.consume(B),v):B===93&&a===5?(e.consume(B),J):ye(B)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(aD,ee,k)(B)):B===null||ye(B)?(e.exit("htmlFlowData"),k(B)):(e.consume(B),w)}function k(B){return e.check(iD,O,ee)(B)}function O(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),j}function j(B){return B===null||ye(B)?k(B):(e.enter("htmlFlowData"),w(B))}function z(B){return B===45?(e.consume(B),v):w(B)}function H(B){return B===47?(e.consume(B),s="",te):w(B)}function te(B){if(B===62){const S=s.toLowerCase();return Pl.includes(S)?(e.consume(B),W):w(B)}return jt(B)&&s.length<8?(e.consume(B),s+=String.fromCharCode(B),te):w(B)}function J(B){return B===93?(e.consume(B),v):w(B)}function v(B){return B===62?(e.consume(B),W):B===45&&a===2?(e.consume(B),v):w(B)}function W(B){return B===null||ye(B)?(e.exit("htmlFlowData"),ee(B)):(e.consume(B),W)}function ee(B){return e.exit("htmlFlow"),t(B)}}function uD(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 lD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ya,t,n)}}const cD={name:"htmlText",tokenize:dD};function dD(e,t,n){const r=this;let a,i,s;return o;function o(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),l}function l(v){return v===33?(e.consume(v),u):v===47?(e.consume(v),E):v===63?(e.consume(v),A):jt(v)?(e.consume(v),I):n(v)}function u(v){return v===45?(e.consume(v),c):v===91?(e.consume(v),i=0,g):jt(v)?(e.consume(v),x):n(v)}function c(v){return v===45?(e.consume(v),m):n(v)}function h(v){return v===null?n(v):v===45?(e.consume(v),p):ye(v)?(s=h,H(v)):(e.consume(v),h)}function p(v){return v===45?(e.consume(v),m):h(v)}function m(v){return v===62?z(v):v===45?p(v):h(v)}function g(v){const W="CDATA[";return v===W.charCodeAt(i++)?(e.consume(v),i===W.length?f:g):n(v)}function f(v){return v===null?n(v):v===93?(e.consume(v),D):ye(v)?(s=f,H(v)):(e.consume(v),f)}function D(v){return v===93?(e.consume(v),y):f(v)}function y(v){return v===62?z(v):v===93?(e.consume(v),y):f(v)}function x(v){return v===null||v===62?z(v):ye(v)?(s=x,H(v)):(e.consume(v),x)}function A(v){return v===null?n(v):v===63?(e.consume(v),_):ye(v)?(s=A,H(v)):(e.consume(v),A)}function _(v){return v===62?z(v):A(v)}function E(v){return jt(v)?(e.consume(v),F):n(v)}function F(v){return v===45||Bt(v)?(e.consume(v),F):T(v)}function T(v){return ye(v)?(s=T,H(v)):je(v)?(e.consume(v),T):z(v)}function I(v){return v===45||Bt(v)?(e.consume(v),I):v===47||v===62||ft(v)?R(v):n(v)}function R(v){return v===47?(e.consume(v),z):v===58||v===95||jt(v)?(e.consume(v),M):ye(v)?(s=R,H(v)):je(v)?(e.consume(v),R):z(v)}function M(v){return v===45||v===46||v===58||v===95||Bt(v)?(e.consume(v),M):$(v)}function $(v){return v===61?(e.consume(v),w):ye(v)?(s=$,H(v)):je(v)?(e.consume(v),$):R(v)}function w(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),a=v,k):ye(v)?(s=w,H(v)):je(v)?(e.consume(v),w):(e.consume(v),O)}function k(v){return v===a?(e.consume(v),a=void 0,j):v===null?n(v):ye(v)?(s=k,H(v)):(e.consume(v),k)}function O(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||ft(v)?R(v):(e.consume(v),O)}function j(v){return v===47||v===62||ft(v)?R(v):n(v)}function z(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function H(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),te}function te(v){return je(v)?Ie(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):J(v)}function J(v){return e.enter("htmlTextData"),s(v)}}const fo={name:"labelEnd",tokenize:vD,resolveTo:gD,resolveAll:pD},fD={tokenize:bD},hD={tokenize:yD},mD={tokenize:DD};function pD(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 gD(e,t){let n=e.length,r=0,a,i,s,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},c={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return o=[["enter",l,t],["enter",u,t]],o=Dt(o,e.slice(i+1,i+r+3)),o=Dt(o,[["enter",c,t]]),o=Dt(o,co(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=Dt(o,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),o=Dt(o,e.slice(s+1)),o=Dt(o,[["exit",l,t]]),Rt(e,i,e.length,o),e}function vD(e,t,n){const r=this;let a=r.events.length,i,s;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(p){return i?i._inactive?h(p):(s=r.parser.defined.includes(Wn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(fD,c,s?c:h)(p):p===91?e.attempt(hD,c,s?u:h)(p):s?c(p):h(p)}function u(p){return e.attempt(mD,c,h)(p)}function c(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function bD(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return ft(h)?Dr(e,i)(h):i(h)}function i(h){return h===41?c(h):sf(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ft(h)?Dr(e,l)(h):c(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?uf(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return ft(h)?Dr(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function yD(e,t,n){const r=this;return a;function a(o){return of.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Wn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function DD(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 CD={name:"labelStartImage",tokenize:xD,resolveAll:fo.resolveAll};function xD(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 wD={name:"labelStartLink",tokenize:ED,resolveAll:fo.resolveAll};function ED(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 Ti={name:"lineEnding",tokenize:kD};function kD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ie(e,t,"linePrefix")}}const ha={name:"thematicBreak",tokenize:_D};function _D(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"),je(u)?Ie(e,o,"whitespace")(u):o(u))}}const lt={name:"list",tokenize:FD,continuation:{tokenize:TD},exit:jD},BD={tokenize:OD,partial:!0},AD={tokenize:SD,partial:!0};function FD(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:As(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ha,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return As(m)&&++s<10?(e.consume(m),l):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Ya,r.interrupt?n:c,e.attempt(BD,p,h))}function c(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function h(m){return je(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function TD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ya,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!je(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(AD,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(lt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function SD(e,t,n){const r=this;return Ie(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 jD(e){e.exit(this.containerState.type)}function OD(e,t,n){const r=this;return Ie(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!je(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Nl={name:"setextUnderline",tokenize:ND,resolveTo:PD};function PD(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 ND(e,t,n){const r=this;let a;return i;function i(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===a?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),je(u)?Ie(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ye(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const RD={tokenize:MD};function MD(e){const t=this,n=e.attempt(Ya,r,e.attempt(this.parser.constructs.flowInitial,a,Ie(e,e.attempt(this.parser.constructs.flow,a,e.attempt(q1,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 ID={resolveAll:cf()},$D=lf("string"),LD=lf("text");function lf(e){return{tokenize:t,resolveAll:cf(e==="text"?zD:void 0)};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(c){return u(c)?i(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),i(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=a[c];let p=-1;if(h)for(;++p<h.length;){const m=h[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function cf(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 zD(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 qD(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:x,enter:A,exit:_,attempt:T(E),check:T(F),interrupt:T(F,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:p,now:g,defineSkip:f,write:h};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h($){return s=Dt(s,$),D(),s[s.length-1]!==null?[]:(I(t,0),u.events=co(i,u.events,u),u.events)}function p($,w){return HD(m($),w)}function m($){return WD(s,$)}function g(){const{line:$,column:w,offset:k,_index:O,_bufferIndex:j}=r;return{line:$,column:w,offset:k,_index:O,_bufferIndex:j}}function f($){a[$.line]=$.column,M()}function D(){let $;for(;r._index<s.length;){const w=s[r._index];if(typeof w=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<w.length;)y(w.charCodeAt(r._bufferIndex));else y(w)}}function y($){c=c($)}function x($){ye($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,M()):$!==-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=$}function A($,w){const k=w||{};return k.type=$,k.start=g(),u.events.push(["enter",k,u]),o.push(k),k}function _($){const w=o.pop();return w.end=g(),u.events.push(["exit",w,u]),w}function E($,w){I($,w.from)}function F($,w){w.restore()}function T($,w){return k;function k(O,j,z){let H,te,J,v;return Array.isArray(O)?ee(O):"tokenize"in O?ee([O]):W(O);function W(L){return U;function U(ne){const re=ne!==null&&L[ne],ae=ne!==null&&L.null,fe=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return ee(fe)(ne)}}function ee(L){return H=L,te=0,L.length===0?z:B(L[te])}function B(L){return U;function U(ne){return v=R(),J=L,L.partial||(u.currentConstruct=L),L.name&&u.parser.constructs.disable.null.includes(L.name)?q():L.tokenize.call(w?Object.assign(Object.create(u),w):u,l,S,q)(ne)}}function S(L){return $(J,v),j}function q(L){return v.restore(),++te<H.length?B(H[te]):z}}}function I($,w){$.resolveAll&&!i.includes($)&&i.push($),$.resolve&&Rt(u.events,w,u.events.length-w,$.resolve(u.events.slice(w),u)),$.resolveTo&&(u.events=$.resolveTo(u.events,u))}function R(){const $=g(),w=u.previous,k=u.currentConstruct,O=u.events.length,j=Array.from(o);return{restore:z,from:O};function z(){r=$,u.previous=w,u.currentConstruct=k,u.events.length=O,o=j,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function WD(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 HD(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=`
111
+ `:""),[i]=C.useState(a);return jr(()=>{var s=a();r.current&&r.current.textContent!==s&&(r.current.textContent=s)}),C.createElement(Xb,{ref:r},i)},Xb=C.memo(C.forwardRef((e,t)=>C.createElement("span",{"data-slate-string":!0,ref:t},e.children))),Ci=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=e,a={"data-slate-zero-width":n?"n":"z","data-slate-length":t};return r&&(a["data-slate-mark-placeholder"]=!0),C.createElement("span",Qb({},a),!ot||!n?"\uFEFF":null,n?C.createElement("br",null):null)};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 Wd(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){xt(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 ey=ot?300:0;function ty(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function il(e){e.current&&(clearTimeout(e.current),e.current=null)}var ny=e=>{var{leaf:t,isLast:n,text:r,parent:a,renderPlaceholder:i,renderLeaf:s=x=>C.createElement(ay,Wd({},x))}=e,o=on(),l=C.useRef(null),u=C.useRef(null),[c,h]=C.useState(!1),p=C.useRef(null),m=C.useCallback(x=>{if(ty(l,x==null),x==null){var A;gs.delete(o),(A=t.onPlaceholderResize)===null||A===void 0||A.call(t,null)}else{if(gs.set(o,x),!l.current){var k=window.ResizeObserver||ab;l.current=new k(()=>{var w;(w=t.onPlaceholderResize)===null||w===void 0||w.call(t,x)})}l.current.observe(x),u.current=x}},[u,t,o]),g=C.createElement(Jb,{isLast:n,leaf:t,parent:a,text:r}),f=!!t[Yn];if(C.useEffect(()=>(f?p.current||(p.current=setTimeout(()=>{h(!0),p.current=null},ey)):(il(p),h(!1)),()=>il(p)),[f,h]),f&&c){var b={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:mr?"inherit":void 0},contentEditable:!1,ref:m}};g=C.createElement(C.Fragment,null,i(b),g)}var y={"data-slate-leaf":!0};return s({attributes:y,children:g,leaf:t,text:r})},ry=C.memo(ny,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&de.equals(t.leaf,e.leaf)&&t.leaf[Yn]===e.leaf[Yn]),ay=e=>{var{attributes:t,children:n}=e;return C.createElement("span",Wd({},t),n)},iy=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:a,renderLeaf:i,text:s}=e,o=on(),l=C.useRef(null),u=de.decorations(s,t),c=J.findKey(o,s),h=[],p=0;p<u.length;p++){var m=u[p];h.push(C.createElement(ry,{isLast:n&&p===u.length-1,key:"".concat(c.id,"-").concat(p),renderPlaceholder:a,leaf:m,text:s,parent:r,renderLeaf:i}))}var g=C.useCallback(f=>{var b=Ya.get(o);f?(b==null||b.set(c,f),bn.set(s,f),Sr.set(f,s)):(b==null||b.delete(c),bn.delete(s),l.current&&Sr.delete(l.current)),l.current=f},[l,o,c,s]);return C.createElement("span",{"data-slate-node":"text",ref:g},h)},Hd=C.memo(iy,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&Gb(t.decorations,e.decorations));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 xs(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){xt(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 sy=e=>{var{decorations:t,element:n,renderElement:r=x=>C.createElement(uy,xs({},x)),renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=on(),l=dy(),u=o.isInline(n),c=J.findKey(o,n),h=C.useCallback(x=>{var A=Ya.get(o);x?(A==null||A.set(c,x),bn.set(n,x),Sr.set(x,n)):(A==null||A.delete(c),bn.delete(n))},[o,c,n]),p=Vd({decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}),m={"data-slate-node":"element",ref:h};if(u&&(m["data-slate-inline"]=!0),!u&&v.hasInlines(o,n)){var g=oe.string(n),f=vd(g);f==="rtl"&&(m.dir=f)}if(v.isVoid(o,n)){m["data-slate-void"]=!0,!l&&u&&(m.contentEditable=!1);var b=u?"span":"div",[[y]]=oe.texts(n);p=C.createElement(b,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},C.createElement(Hd,{renderPlaceholder:a,decorations:[],isLast:!1,parent:n,text:y})),ro.set(y,0),ao.set(y,n)}return r({attributes:m,children:p,element:n})},oy=C.memo(sy,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&Yb(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&V.equals(e.selection,t.selection))),uy=e=>{var{attributes:t,children:n,element:r}=e,a=on(),i=a.isInline(r)?"span":"div";return C.createElement(i,xs(xs({},t),{},{style:{position:"relative"}}),n)},Ud=C.createContext(()=>[]),ly=()=>C.useContext(Ud),cy=C.createContext(!1),Vd=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=ly(),l=on(),u=J.findPath(l,n),c=[],h=ce.isElement(n)&&!l.isInline(n)&&v.hasInlines(l,n),p=0;p<n.children.length;p++){var m=u.concat(p),g=n.children[p],f=J.findKey(l,g),b=v.range(l,m),y=s&&V.intersection(b,s),x=o([g,m]);for(var A of t){var k=V.intersection(A,b);k&&x.push(k)}ce.isElement(g)?c.push(C.createElement(cy.Provider,{key:"provider-".concat(f.id),value:!!y},C.createElement(oy,{decorations:x,element:g,key:f.id,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:y}))):c.push(C.createElement(Hd,{decorations:x,key:f.id,isLast:h&&p===n.children.length-1,parent:n,renderPlaceholder:a,renderLeaf:i,text:g})),ro.set(g,p),ao.set(g,n)}return c},Kd=C.createContext(!1),dy=()=>C.useContext(Kd),Zd=C.createContext(null),Bn=()=>{var e=C.useContext(Zd);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function fy(){var e=on(),t=C.useRef(!1),n=C.useRef(0),r=C.useCallback(()=>{if(!t.current){t.current=!0;var a=J.getWindow(e);a.cancelAnimationFrame(n.current),n.current=a.requestAnimationFrame(()=>{t.current=!1})}},[e]);return C.useEffect(()=>()=>cancelAnimationFrame(n.current),[]),{receivedUserInput:t,onUserInput:r}}var hy=3,my={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"},py={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"},gy={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},ze=e=>{var t=my[e],n=py[e],r=gy[e],a=t&&Di(t),i=n&&Di(n),s=r&&Di(r);return o=>!!(a&&a(o)||Qu&&i&&i(o)||!Qu&&s&&s(o))},qe={isBold:ze("bold"),isCompose:ze("compose"),isMoveBackward:ze("moveBackward"),isMoveForward:ze("moveForward"),isDeleteBackward:ze("deleteBackward"),isDeleteForward:ze("deleteForward"),isDeleteLineBackward:ze("deleteLineBackward"),isDeleteLineForward:ze("deleteLineForward"),isDeleteWordBackward:ze("deleteWordBackward"),isDeleteWordForward:ze("deleteWordForward"),isExtendBackward:ze("extendBackward"),isExtendForward:ze("extendForward"),isExtendLineBackward:ze("extendLineBackward"),isExtendLineForward:ze("extendLineForward"),isItalic:ze("italic"),isMoveLineBackward:ze("moveLineBackward"),isMoveLineForward:ze("moveLineForward"),isMoveWordBackward:ze("moveWordBackward"),isMoveWordForward:ze("moveWordForward"),isRedo:ze("redo"),isSoftBreak:ze("insertSoftBreak"),isSplitBlock:ze("splitBlock"),isTransposeCharacter:ze("transposeCharacter"),isUndo:ze("undo")},vy=(e,t)=>{var n=[],r=()=>{n=[]},a=s=>{if(t.current){var o=s.filter(l=>oo(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}},by={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Yd extends C.Component{constructor(){super(...arguments),xt(this,"context",null),xt(this,"manager",null),xt(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,by)}componentDidMount(){var{receivedUserInput:t}=this.props,n=this.context;this.manager=vy(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}}xt(Yd,"contextType",no);var yy=ot?Yd:e=>{var{children:t}=e;return C.createElement(C.Fragment,null,t)},Dy=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],Cy=["text"];function ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ol(Object(n),!0).forEach(function(r){xt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ol(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var xy=e=>C.createElement(C.Fragment,null,Vd(e)),wy=e=>{var t=C.useCallback(j=>C.createElement(Ey,Tt({},j)),[]),{autoFocus:n,decorate:r=ky,onDOMBeforeInput:a,placeholder:i,readOnly:s=!1,renderElement:o,renderLeaf:l,renderPlaceholder:u=t,scrollSelectionIntoView:c=_y,style:h={},as:p="div",disableDefaultStyles:m=!1}=e,g=Zn(e,Dy),f=Bn(),[b,y]=C.useState(!1),x=C.useRef(null),A=C.useRef([]),[k,w]=C.useState(),{onUserInput:F,receivedUserInput:S}=fy(),[,z]=C.useReducer(j=>j+1,0);Nd.set(f,z),vs.set(f,s);var N=C.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);C.useEffect(()=>{x.current&&n&&x.current.focus()},[n]);var $=C.useRef(),I=C.useMemo(()=>P0(()=>{var j=$.current;if((ot||!J.isComposing(f))&&(!N.isUpdatingSelection||j!=null&&j.isFlushing())&&!N.isDraggingInternally){var q=J.findDocumentOrShadowRoot(f),{activeElement:L}=q,U=J.toDOMNode(f,f),ne=q.getSelection();if(L===U?(N.latestElement=L,en.set(f,!0)):en.delete(f),!ne)return Q.deselect(f);var{anchorNode:re,focusNode:ae}=ne,fe=J.hasEditableTarget(f,re)||J.isTargetInsideNonReadonlyVoid(f,re),ee=J.hasEditableTarget(f,ae)||J.isTargetInsideNonReadonlyVoid(f,ae);if(fe&&ee){var be=J.toSlateRange(f,ne,{exactMatch:!1,suppressThrow:!0});be&&(!J.isComposing(f)&&!(j!=null&&j.hasPendingChanges())&&!(j!=null&&j.isFlushing())?Q.select(f,be):j==null||j.handleUserSelect(be))}s&&(!fe||!ee)&&Q.deselect(f)}},100),[f,s,N]),E=C.useMemo(()=>A0(I,0),[I]);$.current=Ub({node:x,onDOMSelectionChange:I,scheduleOnDOMSelectionChange:E}),jr(()=>{var j,q,L;x.current&&(L=so(x.current))?(Pd.set(f,L),fa.set(f,x.current),bn.set(f,x.current),Sr.set(x.current,f)):bn.delete(f);var{selection:U}=f,ne=J.findDocumentOrShadowRoot(f),re=ne.getSelection();if(!(!re||!J.isFocused(f)||(j=$.current)!==null&&j!==void 0&&j.hasPendingAction())){var ae=me=>{var xe=re.type!=="None";if(!(!U&&!xe)){var Fe=re.focusNode,Te;if($n&&re.rangeCount>1){var Ke=re.getRangeAt(0),We=re.getRangeAt(re.rangeCount-1);Ke.startContainer===Fe?Te=We.endContainer:Te=Ke.startContainer}else Te=re.anchorNode;var He=fa.get(f),Qe=!1;if(He.contains(Te)&&He.contains(Fe)&&(Qe=!0),xe&&Qe&&U&&!me){var he=J.toSlateRange(f,re,{exactMatch:!0,suppressThrow:!0});if(he&&V.equals(he,U)){var ke;if(!N.hasMarkPlaceholder||(ke=Te)!==null&&ke!==void 0&&(ke=ke.parentElement)!==null&&ke!==void 0&&ke.hasAttribute("data-slate-mark-placeholder"))return}}if(U&&!J.hasRange(f,U)){f.selection=J.toSlateRange(f,re,{exactMatch:!1,suppressThrow:!0});return}N.isUpdatingSelection=!0;var $e=U&&J.toDOMRange(f,U);return $e?(J.isComposing(f)&&!ot?re.collapseToEnd():V.isBackward(U)?re.setBaseAndExtent($e.endContainer,$e.endOffset,$e.startContainer,$e.startOffset):re.setBaseAndExtent($e.startContainer,$e.startOffset,$e.endContainer,$e.endOffset),c(f,$e)):re.removeAllRanges(),$e}};re.rangeCount<=1&&ae();var fe=((q=$.current)===null||q===void 0?void 0:q.isFlushing())==="action";if(!ot||!fe){setTimeout(()=>{N.isUpdatingSelection=!1});return}var ee=null,be=requestAnimationFrame(()=>{if(fe){var me=xe=>{try{var Fe=J.toDOMNode(f,f);Fe.focus(),ae(xe)}catch{}};me(),ee=setTimeout(()=>{me(!0),N.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(be),ee&&clearTimeout(ee)}}});var B=C.useCallback(j=>{if(F(),!s&&J.hasEditableTarget(f,j.target)&&!By(j,a)){var q;if($.current)return $.current.handleDOMBeforeInput(j);E.flush(),I.flush();var{selection:L}=f,{inputType:U}=j,ne=j.dataTransfer||j.data||void 0,re=U==="insertCompositionText"||U==="deleteCompositionText";if(re&&J.isComposing(f))return;var ae=!1;if(U==="insertText"&&L&&V.isCollapsed(L)&&j.data&&j.data.length===1&&/[a-z ]/i.test(j.data)&&L.anchor.offset!==0){var fe,ee;ae=!0,f.marks&&(ae=!1);var{anchor:be}=L,[me,xe]=J.toDOMPoint(f,be),Fe=(fe=me.parentElement)===null||fe===void 0?void 0:fe.closest("a"),Te=J.getWindow(f);if(ae&&Fe&&J.hasDOMNode(f,Fe)){var Ke,We=Te==null?void 0:Te.document.createTreeWalker(Fe,NodeFilter.SHOW_TEXT).lastChild();We===me&&((Ke=We.textContent)===null||Ke===void 0?void 0:Ke.length)===xe&&(ae=!1)}if(ae&&me.parentElement&&(Te==null||(ee=Te.getComputedStyle(me.parentElement))===null||ee===void 0?void 0:ee.whiteSpace)==="pre"){var He=v.above(f,{at:be.path,match:se=>ce.isElement(se)&&v.isBlock(f,se)});He&&oe.string(He[0]).includes(" ")&&(ae=!1)}}if(!U.startsWith("delete")||U.startsWith("deleteBy")){var[Qe]=j.getTargetRanges();if(Qe){var he=J.toSlateRange(f,Qe,{exactMatch:!1,suppressThrow:!1});if(!L||!V.equals(L,he)){ae=!1;var ke=!re&&f.selection&&v.rangeRef(f,f.selection);Q.select(f,he),ke&&br.set(f,ke)}}}if(re)return;if(ae||j.preventDefault(),L&&V.isExpanded(L)&&U.startsWith("delete")){var $e=U.endsWith("Backward")?"backward":"forward";v.deleteFragment(f,{direction:$e});return}switch(U){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{v.deleteFragment(f);break}case"deleteContent":case"deleteContentForward":{v.deleteForward(f);break}case"deleteContentBackward":{v.deleteBackward(f);break}case"deleteEntireSoftLine":{v.deleteBackward(f,{unit:"line"}),v.deleteForward(f,{unit:"line"});break}case"deleteHardLineBackward":{v.deleteBackward(f,{unit:"block"});break}case"deleteSoftLineBackward":{v.deleteBackward(f,{unit:"line"});break}case"deleteHardLineForward":{v.deleteForward(f,{unit:"block"});break}case"deleteSoftLineForward":{v.deleteForward(f,{unit:"line"});break}case"deleteWordBackward":{v.deleteBackward(f,{unit:"word"});break}case"deleteWordForward":{v.deleteForward(f,{unit:"word"});break}case"insertLineBreak":v.insertSoftBreak(f);break;case"insertParagraph":{v.insertBreak(f);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{U==="insertFromComposition"&&J.isComposing(f)&&(y(!1),mn.set(f,!1)),(ne==null?void 0:ne.constructor.name)==="DataTransfer"?J.insertData(f,ne):typeof ne=="string"&&(ae?A.current.push(()=>v.insertText(f,ne)):v.insertText(f,ne));break}}var K=(q=br.get(f))===null||q===void 0?void 0:q.unref();br.delete(f),K&&(!f.selection||!V.equals(f.selection,K))&&Q.select(f,K)}},[f,I,F,a,s,E]),T=C.useCallback(j=>{j==null?(I.cancel(),E.cancel(),fa.delete(f),bn.delete(f),x.current&&Zt&&x.current.removeEventListener("beforeinput",B)):Zt&&j.addEventListener("beforeinput",B),x.current=j},[I,E,f,B]);jr(()=>{var j=J.getWindow(f);return j.document.addEventListener("selectionchange",E),()=>{j.document.removeEventListener("selectionchange",E)}},[E]);var M=r([f,[]]),R=i&&f.children.length===1&&Array.from(oe.texts(f)).length===1&&oe.string(f)===""&&!b,W=C.useCallback(j=>{if(j&&R){var q;w((q=j.getBoundingClientRect())===null||q===void 0?void 0:q.height)}else w(void 0)},[R]);if(R){var X=v.start(f,[]);M.push({[Yn]:!0,placeholder:i,onPlaceholderResize:W,anchor:X,focus:X})}var{marks:G}=f;if(N.hasMarkPlaceholder=!1,f.selection&&V.isCollapsed(f.selection)&&G){var{anchor:D}=f.selection,H=oe.leaf(f,D.path),te=Zn(H,Cy);if(!de.equals(H,G,{loose:!0})){N.hasMarkPlaceholder=!0;var _=Object.fromEntries(Object.keys(te).map(j=>[j,null]));M.push(Tt(Tt(Tt({[Rd]:!0},_),G),{},{anchor:D,focus:D}))}}return C.useEffect(()=>{setTimeout(()=>{var{selection:j}=f;if(j){var{anchor:q}=j,L=oe.leaf(f,q.path);if(G&&!de.equals(L,G,{loose:!0})){_t.set(f,G);return}}_t.delete(f)})}),C.createElement(Kd.Provider,{value:s},C.createElement(Ud.Provider,{value:r},C.createElement(yy,{node:x,receivedUserInput:S},C.createElement(p,Tt(Tt({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},g),{},{spellCheck:Zt||!da?g.spellCheck:!1,autoCorrect:Zt||!da?g.autoCorrect:"false",autoCapitalize:Zt||!da?g.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:T,style:Tt(Tt({},m?{}:Tt({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},k?{minHeight:k}:{})),h),onBeforeInput:C.useCallback(j=>{if(!Zt&&!s&&!at(j,g.onBeforeInput)&&J.hasSelectableTarget(f,j.target)&&(j.preventDefault(),!J.isComposing(f))){var q=j.data;v.insertText(f,q)}},[g.onBeforeInput,f,s]),onInput:C.useCallback(j=>{if(!at(j,g.onInput)){if($.current){$.current.handleInput();return}for(var q of A.current)q();A.current=[]}},[g.onInput]),onBlur:C.useCallback(j=>{if(!(s||N.isUpdatingSelection||!J.hasSelectableTarget(f,j.target)||at(j,g.onBlur))){var q=J.findDocumentOrShadowRoot(f);if(N.latestElement!==q.activeElement){var{relatedTarget:L}=j,U=J.toDOMNode(f,f);if(L!==U&&!(Ct(L)&&L.hasAttribute("data-slate-spacer"))){if(L!=null&&nn(L)&&J.hasDOMNode(f,L)){var ne=J.toSlateNode(f,L);if(ce.isElement(ne)&&!f.isVoid(ne))return}if(mr){var re=q.getSelection();re==null||re.removeAllRanges()}en.delete(f)}}}},[s,N.isUpdatingSelection,N.latestElement,f,g.onBlur]),onClick:C.useCallback(j=>{if(J.hasTarget(f,j.target)&&!at(j,g.onClick)&&nn(j.target)){var q=J.toSlateNode(f,j.target),L=J.findPath(f,q);if(!v.hasPath(f,L)||oe.get(f,L)!==q)return;if(j.detail===hy&&L.length>=1){var U=L;if(!(ce.isElement(q)&&v.isBlock(f,q))){var ne,re=v.above(f,{match:Fe=>ce.isElement(Fe)&&v.isBlock(f,Fe),at:L});U=(ne=re==null?void 0:re[1])!==null&&ne!==void 0?ne:L.slice(0,1)}var ae=v.range(f,U);Q.select(f,ae);return}if(s)return;var fe=v.start(f,L),ee=v.end(f,L),be=v.void(f,{at:fe}),me=v.void(f,{at:ee});if(be&&me&&P.equals(be[1],me[1])){var xe=v.range(f,fe);Q.select(f,xe)}}},[f,g.onClick,s]),onCompositionEnd:C.useCallback(j=>{if(J.hasSelectableTarget(f,j.target)){var q;if(J.isComposing(f)&&Promise.resolve().then(()=>{y(!1),mn.set(f,!1)}),(q=$.current)===null||q===void 0||q.handleCompositionEnd(j),at(j,g.onCompositionEnd)||ot)return;if(!mr&&!gb&&!fb&&!bb&&!vb&&j.data){var L=_t.get(f);_t.delete(f),L!==void 0&&(qt.set(f,f.marks),f.marks=L),v.insertText(f,j.data);var U=qt.get(f);qt.delete(f),U!==void 0&&(f.marks=U)}}},[g.onCompositionEnd,f]),onCompositionUpdate:C.useCallback(j=>{J.hasSelectableTarget(f,j.target)&&!at(j,g.onCompositionUpdate)&&(J.isComposing(f)||(y(!0),mn.set(f,!0)))},[g.onCompositionUpdate,f]),onCompositionStart:C.useCallback(j=>{if(J.hasSelectableTarget(f,j.target)){var q;if((q=$.current)===null||q===void 0||q.handleCompositionStart(j),at(j,g.onCompositionStart)||ot)return;y(!0);var{selection:L}=f;if(L&&V.isExpanded(L)){v.deleteFragment(f);return}}},[g.onCompositionStart,f]),onCopy:C.useCallback(j=>{J.hasSelectableTarget(f,j.target)&&!at(j,g.onCopy)&&!ul(j)&&(j.preventDefault(),J.setFragmentData(f,j.clipboardData,"copy"))},[g.onCopy,f]),onCut:C.useCallback(j=>{if(!s&&J.hasSelectableTarget(f,j.target)&&!at(j,g.onCut)&&!ul(j)){j.preventDefault(),J.setFragmentData(f,j.clipboardData,"cut");var{selection:q}=f;if(q)if(V.isExpanded(q))v.deleteFragment(f);else{var L=oe.parent(f,q.anchor.path);v.isVoid(f,L)&&Q.delete(f)}}},[s,f,g.onCut]),onDragOver:C.useCallback(j=>{if(J.hasTarget(f,j.target)&&!at(j,g.onDragOver)){var q=J.toSlateNode(f,j.target);ce.isElement(q)&&v.isVoid(f,q)&&j.preventDefault()}},[g.onDragOver,f]),onDragStart:C.useCallback(j=>{if(!s&&J.hasTarget(f,j.target)&&!at(j,g.onDragStart)){var q=J.toSlateNode(f,j.target),L=J.findPath(f,q),U=ce.isElement(q)&&v.isVoid(f,q)||v.void(f,{at:L,voids:!0});if(U){var ne=v.range(f,L);Q.select(f,ne)}N.isDraggingInternally=!0,J.setFragmentData(f,j.dataTransfer,"drag")}},[s,f,g.onDragStart,N]),onDrop:C.useCallback(j=>{if(!s&&J.hasTarget(f,j.target)&&!at(j,g.onDrop)){j.preventDefault();var q=f.selection,L=J.findEventRange(f,j),U=j.dataTransfer;Q.select(f,L),N.isDraggingInternally&&q&&!V.equals(q,L)&&!v.void(f,{at:L,voids:!0})&&Q.delete(f,{at:q}),J.insertData(f,U),J.isFocused(f)||J.focus(f)}N.isDraggingInternally=!1},[s,f,g.onDrop,N]),onDragEnd:C.useCallback(j=>{!s&&N.isDraggingInternally&&g.onDragEnd&&J.hasTarget(f,j.target)&&g.onDragEnd(j),N.isDraggingInternally=!1},[s,N,g,f]),onFocus:C.useCallback(j=>{if(!s&&!N.isUpdatingSelection&&J.hasEditableTarget(f,j.target)&&!at(j,g.onFocus)){var q=J.toDOMNode(f,f),L=J.findDocumentOrShadowRoot(f);if(N.latestElement=L.activeElement,$n&&j.target!==q){q.focus();return}en.set(f,!0)}},[s,N,f,g.onFocus]),onKeyDown:C.useCallback(j=>{if(!s&&J.hasEditableTarget(f,j.target)){var q;(q=$.current)===null||q===void 0||q.handleKeyDown(j);var{nativeEvent:L}=j;if(J.isComposing(f)&&L.isComposing===!1&&(mn.set(f,!1),y(!1)),at(j,g.onKeyDown)||J.isComposing(f))return;var{selection:U}=f,ne=f.children[U!==null?U.focus.path[0]:0],re=vd(oe.string(ne))==="rtl";if(qe.isRedo(L)){j.preventDefault();var ae=f;typeof ae.redo=="function"&&ae.redo();return}if(qe.isUndo(L)){j.preventDefault();var fe=f;typeof fe.undo=="function"&&fe.undo();return}if(qe.isMoveLineBackward(L)){j.preventDefault(),Q.move(f,{unit:"line",reverse:!0});return}if(qe.isMoveLineForward(L)){j.preventDefault(),Q.move(f,{unit:"line"});return}if(qe.isExtendLineBackward(L)){j.preventDefault(),Q.move(f,{unit:"line",edge:"focus",reverse:!0});return}if(qe.isExtendLineForward(L)){j.preventDefault(),Q.move(f,{unit:"line",edge:"focus"});return}if(qe.isMoveBackward(L)){j.preventDefault(),U&&V.isCollapsed(U)?Q.move(f,{reverse:!re}):Q.collapse(f,{edge:re?"end":"start"});return}if(qe.isMoveForward(L)){j.preventDefault(),U&&V.isCollapsed(U)?Q.move(f,{reverse:re}):Q.collapse(f,{edge:re?"start":"end"});return}if(qe.isMoveWordBackward(L)){j.preventDefault(),U&&V.isExpanded(U)&&Q.collapse(f,{edge:"focus"}),Q.move(f,{unit:"word",reverse:!re});return}if(qe.isMoveWordForward(L)){j.preventDefault(),U&&V.isExpanded(U)&&Q.collapse(f,{edge:"focus"}),Q.move(f,{unit:"word",reverse:re});return}if(Zt){if((Od||mr)&&U&&(qe.isDeleteBackward(L)||qe.isDeleteForward(L))&&V.isCollapsed(U)){var ee=oe.parent(f,U.anchor.path);if(ce.isElement(ee)&&v.isVoid(f,ee)&&(v.isInline(f,ee)||v.isBlock(f,ee))){j.preventDefault(),v.deleteBackward(f,{unit:"block"});return}}}else{if(qe.isBold(L)||qe.isItalic(L)||qe.isTransposeCharacter(L)){j.preventDefault();return}if(qe.isSoftBreak(L)){j.preventDefault(),v.insertSoftBreak(f);return}if(qe.isSplitBlock(L)){j.preventDefault(),v.insertBreak(f);return}if(qe.isDeleteBackward(L)){j.preventDefault(),U&&V.isExpanded(U)?v.deleteFragment(f,{direction:"backward"}):v.deleteBackward(f);return}if(qe.isDeleteForward(L)){j.preventDefault(),U&&V.isExpanded(U)?v.deleteFragment(f,{direction:"forward"}):v.deleteForward(f);return}if(qe.isDeleteLineBackward(L)){j.preventDefault(),U&&V.isExpanded(U)?v.deleteFragment(f,{direction:"backward"}):v.deleteBackward(f,{unit:"line"});return}if(qe.isDeleteLineForward(L)){j.preventDefault(),U&&V.isExpanded(U)?v.deleteFragment(f,{direction:"forward"}):v.deleteForward(f,{unit:"line"});return}if(qe.isDeleteWordBackward(L)){j.preventDefault(),U&&V.isExpanded(U)?v.deleteFragment(f,{direction:"backward"}):v.deleteBackward(f,{unit:"word"});return}if(qe.isDeleteWordForward(L)){j.preventDefault(),U&&V.isExpanded(U)?v.deleteFragment(f,{direction:"forward"}):v.deleteForward(f,{unit:"word"});return}}}},[s,f,g.onKeyDown]),onPaste:C.useCallback(j=>{!s&&J.hasEditableTarget(f,j.target)&&!at(j,g.onPaste)&&(!Zt||Cb(j.nativeEvent)||mr)&&(j.preventDefault(),J.insertData(f,j.clipboardData))},[s,f,g.onPaste])}),C.createElement(xy,{decorations:M,node:f,renderElement:o,renderPlaceholder:u,renderLeaf:l,selection:f.selection})))))},Ey=e=>{var{attributes:t,children:n}=e;return C.createElement("span",Tt({},t),n,ot&&C.createElement("br",null))},ky=()=>[],_y=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&V.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),M0(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},at=(e,t)=>{if(!t)return!1;var n=t(e);return n??(e.isDefaultPrevented()||e.isPropagationStopped())},ul=e=>nn(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),By=(e,t)=>{if(!t)return!1;var n=t(e);return n??e.defaultPrevented},Ay=C.createContext(!1),Fy=C.createContext({});function Ty(e){var t=C.useRef([]).current,n=C.useRef({editor:e}).current,r=C.useCallback(i=>{n.editor=i,t.forEach(s=>s(i))},[t,n]),a=C.useMemo(()=>({getSlate:()=>n.editor,addEventListener:i=>(t.push(i),()=>{t.splice(t.indexOf(i),1)})}),[t,n]);return{selectorContext:a,onChange:r}}var Sy=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],jy=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:a,onValueChange:i,initialValue:s}=e,o=Zn(e,Sy),[l,u]=C.useState(()=>{if(!oe.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(Je.stringify(s)));if(!v.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(Je.stringify(t)));return t.children=s,Object.assign(t,o),{v:0,editor:t}}),{selectorContext:c,onChange:h}=Ty(t),p=C.useCallback(f=>{var b;switch(r&&r(t.children),f==null||(b=f.operation)===null||b===void 0?void 0:b.type){case"set_selection":a==null||a(t.selection);break;default:i==null||i(t.children)}u(y=>({v:y.v+1,editor:t})),h(t)},[t,h,r,a,i]);C.useEffect(()=>(bs.set(t,p),()=>{bs.set(t,()=>{})}),[t,p]);var[m,g]=C.useState(J.isFocused(t));return C.useEffect(()=>{g(J.isFocused(t))},[t]),jr(()=>{var f=()=>g(J.isFocused(t));return jd>=17?(document.addEventListener("focusin",f),document.addEventListener("focusout",f),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",f)}):(document.addEventListener("focus",f,!0),document.addEventListener("blur",f,!0),()=>{document.removeEventListener("focus",f,!0),document.removeEventListener("blur",f,!0)})},[]),C.createElement(Fy.Provider,{value:c},C.createElement(Zd.Provider,{value:l},C.createElement(no.Provider,{value:l.editor},C.createElement(Ay.Provider,{value:m},n))))},ll=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},cl=(e,t,n)=>{var r=J.toDOMRange(e,t).getBoundingClientRect(),a=J.toDOMRange(e,n).getBoundingClientRect();return ll(r,a)&&ll(a,r)},Oy=(e,t)=>{var n=v.range(e,V.end(t)),r=Array.from(v.positions(e,{at:t})),a=0,i=r.length,s=Math.floor(i/2);if(cl(e,v.range(e,r[a]),n))return v.range(e,r[a],n);if(r.length<2)return v.range(e,r[r.length-1],n);for(;s!==r.length&&s!==a;)cl(e,v.range(e,r[s]),n)?i=s:a=s,s=Math.floor((a+i)/2);return v.range(e,r[i],n)};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 fl(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){xt(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 Py=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 Ya.set(r,new WeakMap),r.addMark=(u,c)=>{var h,p;(h=io.get(r))===null||h===void 0||h(),!_t.get(r)&&(p=ct.get(r))!==null&&p!==void 0&&p.length&&_t.set(r,null),qt.delete(r),o(u,c)},r.removeMark=u=>{var c;!_t.get(r)&&(c=ct.get(r))!==null&&c!==void 0&&c.length&&_t.set(r,null),qt.delete(r),l(u)},r.deleteBackward=u=>{if(u!=="line")return s(u);if(r.selection&&V.isCollapsed(r.selection)){var c=v.above(r,{match:g=>ce.isElement(g)&&v.isBlock(r,g),at:r.selection});if(c){var[,h]=c,p=v.range(r,h,r.selection.anchor),m=Oy(r,p);V.isCollapsed(m)||Q.delete(r,{at:m})}}},r.apply=u=>{var c=[],h=[],p=ct.get(r);if(p!=null&&p.length){var m=p.map(T=>Pb(T,u)).filter(Boolean);ct.set(r,m)}var g=Qt.get(r);g&&Qt.set(r,Xu(r,g,u));var f=Gt.get(r);if(f!=null&&f.at){var b=Ee.isPoint(f==null?void 0:f.at)?Cs(r,f.at,u):Xu(r,f.at,u);Gt.set(r,b?fl(fl({},f),{},{at:b}):null)}switch(u.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{c.push(...jn(r,u.path));break}case"set_selection":{var y;(y=br.get(r))===null||y===void 0||y.unref(),br.delete(r);break}case"insert_node":case"remove_node":{c.push(...jn(r,P.parent(u.path)));break}case"merge_node":{var x=P.previous(u.path);c.push(...jn(r,x));break}case"move_node":{var A=P.common(P.parent(u.path),P.parent(u.newPath));c.push(...jn(r,A));var k;P.isBefore(u.path,u.newPath)?(c.push(...jn(r,P.parent(u.path))),k=u.newPath):(c.push(...jn(r,P.parent(u.newPath))),k=u.path);var w=oe.get(t,P.parent(k)),F=J.findKey(r,w),S=v.pathRef(r,P.parent(k));h.push([S,F]);break}}a(u);for(var[z,N]of c){var[$]=v.node(r,z);_a.set($,N)}for(var[I,E]of h)if(I.current){var[B]=v.node(r,I.current);_a.set(B,E)}},r.setFragmentData=u=>{var{selection:c}=r;if(c){var[h,p]=V.edges(c),m=v.void(r,{at:h.path}),g=v.void(r,{at:p.path});if(!(V.isCollapsed(c)&&!m)){var f=J.toDOMRange(r,c),b=f.cloneContents(),y=b.childNodes[0];if(b.childNodes.forEach($=>{$.textContent&&$.textContent.trim()!==""&&(y=$)}),g){var[x]=g,A=f.cloneRange(),k=J.toDOMNode(r,x);A.setEndAfter(k),b=A.cloneContents()}if(m&&(y=b.querySelector("[data-slate-spacer]")),Array.from(b.querySelectorAll("[data-slate-zero-width]")).forEach($=>{var I=$.getAttribute("data-slate-zero-width")==="n";$.textContent=I?`
112
+ `:""}),Md(y)){var w=y.ownerDocument.createElement("span");w.style.whiteSpace="pre",w.appendChild(y),b.appendChild(w),y=w}var F=r.getFragment(),S=JSON.stringify(F),z=window.btoa(encodeURIComponent(S));y.setAttribute("data-slate-fragment",z),u.setData("application/".concat(n),z);var N=b.ownerDocument.createElement("div");return N.appendChild(b),N.setAttribute("hidden","true"),b.ownerDocument.body.appendChild(N),u.setData("text/html",N.innerHTML),u.setData("text/plain",$d(N)),b.ownerDocument.body.removeChild(N),u}}},r.insertData=u=>{r.insertFragmentData(u)||r.insertTextData(u)},r.insertFragmentData=u=>{var c=u.getData("application/".concat(n))||_b(u);if(c){var h=decodeURIComponent(window.atob(c)),p=JSON.parse(h);return r.insertFragment(p),!0}return!1},r.insertTextData=u=>{var c=u.getData("text/plain");if(c){var h=c.split(/\r\n|\r|\n/),p=!1;for(var m of h)p&&Q.splitNodes(r,{always:!0}),r.insertText(m),p=!0;return!0}return!1},r.onChange=u=>{var c=jd<18?gc.unstable_batchedUpdates:h=>h();c(()=>{var h=bs.get(r);h&&h(u),i(u)})},r},jn=(e,t)=>{var n=[];for(var[r,a]of v.levels(e,{at:t})){var i=J.findKey(e,r);n.push([a,i])}return n};const Ny={id:"",tabbableOption:"",setFocus:()=>{},openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null},lastAnchor:null,dispatch:()=>{},reportError:e=>{console.error(e)}},Vt=C.createContext(Ny);var Z=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e))(Z||{}),Ot=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(Ot||{});const Ry=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case Z.blockquote:return d.jsx("blockquote",{className:"subtle",...e,children:t});case Z.link:return d.jsx("a",{...e,children:t});case Z.li:return d.jsx("li",{...e,children:t});case Z.mention:const a=r;return d.jsxs("a",{...e,className:"mention",children:["@",(a==null?void 0:a.name)||"",t]});case Z.ol:return d.jsx("ol",{...e,children:t});case Z.ul:return d.jsx("ul",{...e,children:t});case Z.span:return d.jsx("span",{...e,children:t});case Z.paragraph:return d.jsx("p",{...e,children:t});default:return d.jsx("span",{...e,children:t})}},My=({attributes:e,children:t,leaf:n})=>{const r=n;return r[Z.bold]&&(t=d.jsx("strong",{children:t})),r[Z.italic]&&(t=d.jsx("em",{children:t})),r[Z.strikethrough]&&(t=d.jsx("s",{children:t})),d.jsx("span",{...e,children:t})},ws="MENTION: ",Gd={anchor:{offset:0,path:[0,0]},focus:{offset:0,path:[0,0]}},hl={"mention-popover":35,default:-52},xi=16,Qd=(e,t,n)=>{const r=C.useRef(null),{showLinkEditor:a,mentionPopover:i}=C.useContext(Vt),s=t==="link-editor"?a:i.show,o=[s];return e&&t==="link-editor"&&o.push(e.selection),C.useEffect(()=>{var m,g;if(!(r!=null&&r.current)||!s)return;const l=r==null?void 0:r.current;if(!l)return;let u,c=0;if(t==="mention-popover"){const{position:f}=i,b=A=>{if(!v.hasPath(e,A.path))return!1;const k=oe.get(e,A.path);return v.isEditor(k)||ce.isElement(k)?A.offset<=k.children.length:de.isText(k)?A.offset<=k.text.length:!1};if(f&&(!b(f==null?void 0:f.anchor)||!b(f==null?void 0:f.focus)))return;u=J.toDOMRange(e,f||Gd).getBoundingClientRect();const x=(m=document.getElementById(n))==null?void 0:m.getBoundingClientRect();l.style.setProperty("--width",`${((x==null?void 0:x.width)||0)/xi}rem`),c=(x==null?void 0:x.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=hl[t]||hl.default,p=((u==null?void 0:u.top)||0)+window.scrollY+h;c===0&&(c=Math.max(((u==null?void 0:u.left)||0)-(l.offsetWidth-((u==null?void 0:u.width)||0)),0)),l.style.top=`${p/xi}rem`,l.style.left=`${c/xi}rem`},o),r},Iy=e=>{const[t,n]=C.useState(null);return C.useEffect(()=>{const{selection:r}=e;if(!r){n(null);return}const[a]=v.nodes(e,{at:r,match:i=>i.type===Z.link});if(a){const i=a[0],s=Rc(i.link),o=i.children[0],l=(o==null?void 0:o.text)||"";n({...s,text:l})}else n(null)},[e,e.selection]),t};var st=(e=>(e.paragraph="paragraph",e.heading="heading",e.list="list",e.listItem="listItem",e.link="link",e.mention="mention",e.image="image",e.blockquote="blockquote",e.code="code",e.html="html",e.emphasis="emphasis",e.strong="strong",e.delete="delete",e.inlineCode="inlineCode",e.thematicBreak="thematicBreak",e.text="text",e))(st||{});const Ln={[Z.paragraph]:Z.paragraph,[Z.blockquote]:Z.blockquote,[Z.codeblock]:Z.codeblock,[Z.link]:Z.link,[Z.ul]:Z.ul,[Z.ol]:Z.ol,[Z.li]:Z.li,[Z.mention]:Z.mention,[Z.heading]:{1:"heading_one",2:"heading_two",3:"heading_three",4:"heading_four",5:"heading_five",6:"heading_six"},[Ot.emphasis]:Z.italic,[Ot.strong]:Z.bold,[Ot.delete]:Z.strikethrough,[Ot.code]:Z.code,[Z.hr]:Z.hr,[Z.image]:Z.image};function ml(e){if(e)throw e}var ha=Object.prototype.hasOwnProperty,Jd=Object.prototype.toString,pl=Object.defineProperty,gl=Object.getOwnPropertyDescriptor,vl=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Jd.call(t)==="[object Array]"},bl=function(t){if(!t||Jd.call(t)!=="[object Object]")return!1;var n=ha.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ha.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||ha.call(t,a)},yl=function(t,n){pl&&n.name==="__proto__"?pl(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Dl=function(t,n){if(n==="__proto__")if(ha.call(t,n)){if(gl)return gl(t,n).value}else return;return t[n]},$y=function e(){var t,n,r,a,i,s,o=arguments[0],l=1,u=arguments.length,c=!1;for(typeof o=="boolean"&&(c=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Dl(o,n),a=Dl(t,n),o!==a&&(c&&a&&(bl(a)||(i=vl(a)))?(i?(i=!1,s=r&&vl(r)?r:[]):s=r&&bl(r)?r:{},yl(o,{name:n,newValue:e(c,s,a)})):typeof a<"u"&&yl(o,{name:n,newValue:a}));return o};const wi=wn($y);function Es(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 Ly(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...u){const c=e[++i];let h=-1;if(l){s(l);return}for(;++h<a.length;)(u[h]===null||u[h]===void 0)&&(u[h]=a[h]);a=u,c?zy(c,o)(...u):s(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function zy(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(a);try{l=e.apply(this,s)}catch(u){const c=u;if(o&&n)throw c;return a(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){n||(n=!0,t(s,...o))}function i(s){a(null,s)}}function yr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cl(e.position):"start"in e||"end"in e?Cl(e):"line"in e||"column"in e?ks(e):""}function ks(e){return xl(e&&e.line)+":"+xl(e&&e.column)}function Cl(e){return ks(e&&e.start)+"-"+ks(e&&e.end)}function xl(e){return e&&typeof e=="number"?e:1}class ht extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=yr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ht.prototype.file="";ht.prototype.name="";ht.prototype.reason="";ht.prototype.message="";ht.prototype.stack="";ht.prototype.column=void 0;ht.prototype.line=void 0;ht.prototype.ancestors=void 0;ht.prototype.cause=void 0;ht.prototype.fatal=void 0;ht.prototype.place=void 0;ht.prototype.ruleId=void 0;ht.prototype.source=void 0;const St={basename:qy,dirname:Wy,extname:Hy,join:Uy,sep:"/"};function qy(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Nr(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 Wy(e){if(Nr(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 Hy(e){Nr(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 Uy(...e){let t=-1,n;for(;++t<e.length;)Nr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Vy(n)}function Vy(e){Nr(e);const t=e.codePointAt(0)===47;let n=Ky(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ky(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 Nr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Zy={cwd:Yy};function Yy(){return"/"}function _s(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Gy(e){if(typeof e=="string")e=new URL(e);else if(!_s(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 Qy(e)}function Qy(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 Ei=["history","path","basename","stem","extname","dirname"];class Jy{constructor(t){let n;t?_s(t)?n={path:t}:typeof t=="string"||Xy(t)?n={value:t}:n=t:n={},this.cwd=Zy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ei.length;){const i=Ei[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)Ei.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?St.basename(this.path):void 0}set basename(t){_i(t,"basename"),ki(t,"basename"),this.path=St.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?St.dirname(this.path):void 0}set dirname(t){wl(this.basename,"dirname"),this.path=St.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?St.extname(this.path):void 0}set extname(t){if(ki(t,"extname"),wl(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=St.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_s(t)&&(t=Gy(t)),_i(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?St.basename(this.path,this.extname):void 0}set stem(t){_i(t,"stem"),ki(t,"stem"),this.path=St.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new ht(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ki(e,t){if(e&&e.includes(St.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+St.sep+"`")}function _i(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Xy(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const e1=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},t1={}.hasOwnProperty;class uo extends e1{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=Ly()}copy(){const t=new uo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(wi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fi("data",this.frozen),this.namespace[t]=n,this):t1.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fi("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=Qr(t),r=this.parser||this.Parser;return Bi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Bi("process",this.parser||this.Parser),Ai("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=Qr(t),l=r.parse(o);r.run(l,o,function(c,h,p){if(c||!h||!p)return u(c);const m=h,g=r.stringify(m,p);a1(g)?p.value=g:p.result=g,u(c,p)});function u(c,h){c||!h?s(c):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Bi("processSync",this.parser||this.Parser),Ai("processSync",this.compiler||this.Compiler),this.process(t,a),kl("processSync","process",n),r;function a(i,s){n=!0,ml(i),r=s}}run(t,n,r){El(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=Qr(n);a.run(t,l,u);function u(c,h,p){const m=h||t;c?o(c):s?s(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),kl("runSync","run",r),a;function i(s,o){ml(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=Qr(n),a=this.compiler||this.Compiler;return Ai("stringify",a),El(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Fi("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(a.settings=wi(!0,a.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...c]);else if(c.length>0){let[m,...g]=c;const f=r[p][1];Es(f)&&Es(m)&&(m=wi(!0,f,m)),r[p]=[u,m,...g]}}}}const n1=new uo().freeze();function Bi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ai(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fi(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 El(e){if(!Es(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function kl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Qr(e){return r1(e)?e:new Jy(e)}function r1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function a1(e){return typeof e=="string"||i1(e)}function i1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s1={};function o1(e,t){const n=t||s1,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Xd(e,r,a)}function Xd(e,t,n){if(u1(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 _l(e.children,t,n)}return Array.isArray(e)?_l(e,t,n):""}function _l(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Xd(e[a],t,n);return r.join("")}function u1(e){return!!(e&&typeof e=="object")}const Bl=document.createElement("i");function lo(e){const t="&"+e+";";Bl.innerHTML=t;const n=Bl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Rt(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 Dt(e,t){return e.length>0?(Rt(e,e.length,0,t),e):t}const Al={}.hasOwnProperty;function l1(e){const t={};let n=-1;for(;++n<e.length;)c1(t,e[n]);return t}function c1(e,t){let n;for(n in t){const a=(Al.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Al.call(a,s)||(a[s]=[]);const o=i[s];d1(a[s],Array.isArray(o)?o:o?[o]:[])}}}function d1(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Rt(e,0,0,r)}function ef(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 Wn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jt=un(/[A-Za-z]/),Bt=un(/[\dA-Za-z]/),f1=un(/[#-'*+\--9=?A-Z^-~]/);function Bs(e){return e!==null&&(e<32||e===127)}const As=un(/\d/),h1=un(/[\dA-Fa-f]/),m1=un(/[!-/:-@[-`{-~]/);function ye(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const p1=un(/\p{P}|\p{S}/u),g1=un(/\s/);function un(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ie(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return je(l)?(e.enter(n),o(l)):t(l)}function o(l){return je(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const v1={tokenize:b1};function b1(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"),Ie(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 y1={tokenize:D1},Fl={tokenize:C1};function D1(e){const t=this,n=[];let r=0,a,i,s;return o;function o(A){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,u)(A)}return u(A)}function l(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const k=t.events.length;let w=k,F;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){F=t.events[w][1].end;break}y(r);let S=k;for(;S<t.events.length;)t.events[S][1].end=Object.assign({},F),S++;return Rt(t.events,w+1,0,t.events.slice(k)),t.events.length=S,u(A)}return o(A)}function u(A){if(r===n.length){if(!a)return p(A);if(a.currentConstruct&&a.currentConstruct.concrete)return g(A);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fl,c,h)(A)}function c(A){return a&&x(),y(r),p(A)}function h(A){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(A)}function p(A){return t.containerState={},e.attempt(Fl,m,g)(A)}function m(A){return r++,n.push([t.currentConstruct,t.containerState]),p(A)}function g(A){if(A===null){a&&x(),y(0),e.consume(A);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),f(A)}function f(A){if(A===null){b(e.exit("chunkFlow"),!0),y(0),e.consume(A);return}return ye(A)?(e.consume(A),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(A),f)}function b(A,k){const w=t.sliceStream(A);if(k&&w.push(null),A.previous=i,i&&(i.next=A),i=A,a.defineSkip(A.start),a.write(w),t.parser.lazy[A.start.line]){let F=a.events.length;for(;F--;)if(a.events[F][1].start.offset<s&&(!a.events[F][1].end||a.events[F][1].end.offset>s))return;const S=t.events.length;let z=S,N,$;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(N){$=t.events[z][1].end;break}N=!0}for(y(r),F=S;F<t.events.length;)t.events[F][1].end=Object.assign({},$),F++;Rt(t.events,z+1,0,t.events.slice(S)),t.events.length=F}}function y(A){let k=n.length;for(;k-- >A;){const w=n[k];t.containerState=w[1],w[0].exit.call(t,e)}n.length=A}function x(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function C1(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Tl(e){if(e===null||ft(e)||g1(e))return 1;if(p1(e))return 2}function co(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 Fs={name:"attention",tokenize:w1,resolveAll:x1};function x1(e,t){let n=-1,r,a,i,s,o,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);Sl(h,-l),Sl(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},o.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Dt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Dt(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=Dt(u,co(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Dt(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Dt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Rt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function w1(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Tl(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const u=e.exit("attentionSequence"),c=Tl(l),h=!c||c===2&&a||n.includes(l),p=!a||a===2&&c||n.includes(r);return u._open=!!(i===42?h:h&&(a||!p)),u._close=!!(i===42?p:p&&(c||!h)),t(l)}}function Sl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const E1={name:"autolink",tokenize:k1};function k1(e,t,n){let r=0;return a;function a(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return jt(m)?(e.consume(m),s):u(m)}function s(m){return m===43||m===45||m===46||Bt(m)?(r=1,o(m)):u(m)}function o(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||Bt(m))&&r++<32?(e.consume(m),o):(r=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Bs(m)?n(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),c):f1(m)?(e.consume(m),u):n(m)}function c(m){return Bt(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||Bt(m))&&r++<63){const g=m===45?p:h;return e.consume(m),g}return n(m)}}const Ga={tokenize:_1,partial:!0};function _1(e,t,n){return r;function r(i){return je(i)?Ie(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ye(i)?t(i):n(i)}}const tf={name:"blockQuote",tokenize:B1,continuation:{tokenize:A1},exit:F1};function B1(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 je(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function A1(e,t,n){const r=this;return a;function a(s){return je(s)?Ie(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(tf,t,n)(s)}}function F1(e){e.exit("blockQuote")}const nf={name:"characterEscape",tokenize:T1};function T1(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 m1(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const rf={name:"characterReference",tokenize:S1};function S1(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=Bt,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=h1,c):(e.enter("characterReferenceValue"),i=7,s=As,c(h))}function c(h){if(h===59&&a){const p=e.exit("characterReferenceValue");return s===Bt&&!lo(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),c):n(h)}}const jl={tokenize:O1,partial:!0},Ol={name:"codeFenced",tokenize:j1,concrete:!0};function j1(e,t,n){const r=this,a={tokenize:w,partial:!0};let i=0,s=0,o;return l;function l(F){return u(F)}function u(F){const S=r.events[r.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,o=F,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(F)}function c(F){return F===o?(s++,e.consume(F),c):s<3?n(F):(e.exit("codeFencedFenceSequence"),je(F)?Ie(e,h,"whitespace")(F):h(F))}function h(F){return F===null||ye(F)?(e.exit("codeFencedFence"),r.interrupt?t(F):e.check(jl,f,k)(F)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(F))}function p(F){return F===null||ye(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(F)):je(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ie(e,m,"whitespace")(F)):F===96&&F===o?n(F):(e.consume(F),p)}function m(F){return F===null||ye(F)?h(F):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(F))}function g(F){return F===null||ye(F)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(F)):F===96&&F===o?n(F):(e.consume(F),g)}function f(F){return e.attempt(a,k,b)(F)}function b(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),y}function y(F){return i>0&&je(F)?Ie(e,x,"linePrefix",i+1)(F):x(F)}function x(F){return F===null||ye(F)?e.check(jl,f,k)(F):(e.enter("codeFlowValue"),A(F))}function A(F){return F===null||ye(F)?(e.exit("codeFlowValue"),x(F)):(e.consume(F),A)}function k(F){return e.exit("codeFenced"),t(F)}function w(F,S,z){let N=0;return $;function $(M){return F.enter("lineEnding"),F.consume(M),F.exit("lineEnding"),I}function I(M){return F.enter("codeFencedFence"),je(M)?Ie(F,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):E(M)}function E(M){return M===o?(F.enter("codeFencedFenceSequence"),B(M)):z(M)}function B(M){return M===o?(N++,F.consume(M),B):N>=s?(F.exit("codeFencedFenceSequence"),je(M)?Ie(F,T,"whitespace")(M):T(M)):z(M)}function T(M){return M===null||ye(M)?(F.exit("codeFencedFence"),S(M)):z(M)}}}function O1(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 Ti={name:"codeIndented",tokenize:N1},P1={tokenize:R1,partial:!0};function N1(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),Ie(e,i,"linePrefix",4+1)(u)}function i(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ye(u)?e.attempt(P1,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 R1(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):Ie(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 M1={name:"codeText",tokenize:L1,resolve:I1,previous:$1};function I1(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 $1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function L1(e,t,n){let r=0,a,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),a=0,c(h)):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 c(h){return h===96?(e.consume(h),a++,c):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}function af(e){const t={};let n=-1,r,a,i,s,o,l,u;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[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,z1(e,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(s=e[i],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(a&&(e[a][1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},e[a][1].start),o=e.slice(a,n),o.unshift(r),Rt(e,a,n-a+1,o))}}return!u}function z1(e,t){const n=e[t][1],r=e[t][2];let a=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),o=s.events,l=[],u={};let c,h,p=-1,m=n,g=0,f=0;const b=[f];for(;m;){for(;e[++a][1]!==m;);i.push(a),m._tokenizer||(c=r.sliceStream(m),m.next||c.push(null),h&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(f=p+1,b.push(f),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),p=b.length;p--;){const y=o.slice(b[p],b[p+1]),x=i.pop();l.unshift([x,x+y.length-1]),Rt(e,x,2,y)}for(p=-1;++p<l.length;)u[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return u}const q1={tokenize:U1,resolve:H1},W1={tokenize:V1,partial:!0};function H1(e){return af(e),e}function U1(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(W1,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 V1(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ie(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 sf(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(y){return y===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(y),e.exit(i),p):y===null||y===32||y===41||Bs(y)?n(y):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function p(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),p(y)):y===null||y===60||ye(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function f(y){return!c&&(y===null||y===41||ft(y))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(y)):c<u&&y===40?(e.consume(y),c++,f):y===41?(e.consume(y),c--,f):y===null||y===32||y===40||Bs(y)?n(y):(e.consume(y),y===92?b:f)}function b(y){return y===40||y===41||y===92?(e.consume(y),f):f(y)}}function of(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(m){return e.enter(r),e.enter(a),e.consume(m),e.exit(a),e.enter(i),c}function c(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(i),e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):ye(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||ye(m)||o++>999?(e.exit("chunkString"),c(m)):(e.consume(m),l||(l=!je(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,h):h(m)}}function uf(e,t,n,r,a,i){let s;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(a),e.consume(p),e.exit(a),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===s?(e.exit(i),l(s)):p===null?n(p):ye(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ie(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||ye(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?h:c)}function h(p){return p===s||p===92?(e.consume(p),c):c(p)}}function Dr(e,t){let n;return r;function r(a){return ye(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):je(a)?Ie(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const K1={name:"definition",tokenize:Y1},Z1={tokenize:G1,partial:!0};function Y1(e,t,n){const r=this;let a;return i;function i(m){return e.enter("definition"),s(m)}function s(m){return of.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return a=Wn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return ft(m)?Dr(e,u)(m):u(m)}function u(m){return sf(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(Z1,h,h)(m)}function h(m){return je(m)?Ie(e,p,"whitespace")(m):p(m)}function p(m){return m===null||ye(m)?(e.exit("definition"),r.parser.defined.push(a),t(m)):n(m)}}function G1(e,t,n){return r;function r(o){return ft(o)?Dr(e,a)(o):n(o)}function a(o){return uf(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return je(o)?Ie(e,s,"whitespace")(o):s(o)}function s(o){return o===null||ye(o)?t(o):n(o)}}const Q1={name:"hardBreakEscape",tokenize:J1};function J1(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 X1={name:"headingAtx",tokenize:tD,resolve:eD};function eD(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"},Rt(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function tD(e,t,n){let r=0;return a;function a(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||ft(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ye(c)?(e.exit("atxHeading"),t(c)):je(c)?Ie(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||ft(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const nD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Pl=["pre","script","style","textarea"],rD={name:"htmlFlow",tokenize:oD,resolveTo:sD,concrete:!0},aD={tokenize:lD,partial:!0},iD={tokenize:uD,partial:!0};function sD(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 oD(e,t,n){const r=this;let a,i,s,o,l;return u;function u(_){return c(_)}function c(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),h}function h(_){return _===33?(e.consume(_),p):_===47?(e.consume(_),i=!0,f):_===63?(e.consume(_),a=3,r.interrupt?t:D):jt(_)?(e.consume(_),s=String.fromCharCode(_),b):n(_)}function p(_){return _===45?(e.consume(_),a=2,m):_===91?(e.consume(_),a=5,o=0,g):jt(_)?(e.consume(_),a=4,r.interrupt?t:D):n(_)}function m(_){return _===45?(e.consume(_),r.interrupt?t:D):n(_)}function g(_){const j="CDATA[";return _===j.charCodeAt(o++)?(e.consume(_),o===j.length?r.interrupt?t:E:g):n(_)}function f(_){return jt(_)?(e.consume(_),s=String.fromCharCode(_),b):n(_)}function b(_){if(_===null||_===47||_===62||ft(_)){const j=_===47,q=s.toLowerCase();return!j&&!i&&Pl.includes(q)?(a=1,r.interrupt?t(_):E(_)):nD.includes(s.toLowerCase())?(a=6,j?(e.consume(_),y):r.interrupt?t(_):E(_)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):i?x(_):A(_))}return _===45||Bt(_)?(e.consume(_),s+=String.fromCharCode(_),b):n(_)}function y(_){return _===62?(e.consume(_),r.interrupt?t:E):n(_)}function x(_){return je(_)?(e.consume(_),x):$(_)}function A(_){return _===47?(e.consume(_),$):_===58||_===95||jt(_)?(e.consume(_),k):je(_)?(e.consume(_),A):$(_)}function k(_){return _===45||_===46||_===58||_===95||Bt(_)?(e.consume(_),k):w(_)}function w(_){return _===61?(e.consume(_),F):je(_)?(e.consume(_),w):A(_)}function F(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,S):je(_)?(e.consume(_),F):z(_)}function S(_){return _===l?(e.consume(_),l=null,N):_===null||ye(_)?n(_):(e.consume(_),S)}function z(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||ft(_)?w(_):(e.consume(_),z)}function N(_){return _===47||_===62||je(_)?A(_):n(_)}function $(_){return _===62?(e.consume(_),I):n(_)}function I(_){return _===null||ye(_)?E(_):je(_)?(e.consume(_),I):n(_)}function E(_){return _===45&&a===2?(e.consume(_),R):_===60&&a===1?(e.consume(_),W):_===62&&a===4?(e.consume(_),H):_===63&&a===3?(e.consume(_),D):_===93&&a===5?(e.consume(_),G):ye(_)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(aD,te,B)(_)):_===null||ye(_)?(e.exit("htmlFlowData"),B(_)):(e.consume(_),E)}function B(_){return e.check(iD,T,te)(_)}function T(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),M}function M(_){return _===null||ye(_)?B(_):(e.enter("htmlFlowData"),E(_))}function R(_){return _===45?(e.consume(_),D):E(_)}function W(_){return _===47?(e.consume(_),s="",X):E(_)}function X(_){if(_===62){const j=s.toLowerCase();return Pl.includes(j)?(e.consume(_),H):E(_)}return jt(_)&&s.length<8?(e.consume(_),s+=String.fromCharCode(_),X):E(_)}function G(_){return _===93?(e.consume(_),D):E(_)}function D(_){return _===62?(e.consume(_),H):_===45&&a===2?(e.consume(_),D):E(_)}function H(_){return _===null||ye(_)?(e.exit("htmlFlowData"),te(_)):(e.consume(_),H)}function te(_){return e.exit("htmlFlow"),t(_)}}function uD(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 lD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ga,t,n)}}const cD={name:"htmlText",tokenize:dD};function dD(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),A):jt(D)?(e.consume(D),z):n(D)}function u(D){return D===45?(e.consume(D),c):D===91?(e.consume(D),i=0,g):jt(D)?(e.consume(D),x):n(D)}function c(D){return D===45?(e.consume(D),m):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),p):ye(D)?(s=h,W(D)):(e.consume(D),h)}function p(D){return D===45?(e.consume(D),m):h(D)}function m(D){return D===62?R(D):D===45?p(D):h(D)}function g(D){const H="CDATA[";return D===H.charCodeAt(i++)?(e.consume(D),i===H.length?f:g):n(D)}function f(D){return D===null?n(D):D===93?(e.consume(D),b):ye(D)?(s=f,W(D)):(e.consume(D),f)}function b(D){return D===93?(e.consume(D),y):f(D)}function y(D){return D===62?R(D):D===93?(e.consume(D),y):f(D)}function x(D){return D===null||D===62?R(D):ye(D)?(s=x,W(D)):(e.consume(D),x)}function A(D){return D===null?n(D):D===63?(e.consume(D),k):ye(D)?(s=A,W(D)):(e.consume(D),A)}function k(D){return D===62?R(D):A(D)}function w(D){return jt(D)?(e.consume(D),F):n(D)}function F(D){return D===45||Bt(D)?(e.consume(D),F):S(D)}function S(D){return ye(D)?(s=S,W(D)):je(D)?(e.consume(D),S):R(D)}function z(D){return D===45||Bt(D)?(e.consume(D),z):D===47||D===62||ft(D)?N(D):n(D)}function N(D){return D===47?(e.consume(D),R):D===58||D===95||jt(D)?(e.consume(D),$):ye(D)?(s=N,W(D)):je(D)?(e.consume(D),N):R(D)}function $(D){return D===45||D===46||D===58||D===95||Bt(D)?(e.consume(D),$):I(D)}function I(D){return D===61?(e.consume(D),E):ye(D)?(s=I,W(D)):je(D)?(e.consume(D),I):N(D)}function E(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),a=D,B):ye(D)?(s=E,W(D)):je(D)?(e.consume(D),E):(e.consume(D),T)}function B(D){return D===a?(e.consume(D),a=void 0,M):D===null?n(D):ye(D)?(s=B,W(D)):(e.consume(D),B)}function T(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||ft(D)?N(D):(e.consume(D),T)}function M(D){return D===47||D===62||ft(D)?N(D):n(D)}function R(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function W(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),X}function X(D){return je(D)?Ie(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):G(D)}function G(D){return e.enter("htmlTextData"),s(D)}}const fo={name:"labelEnd",tokenize:vD,resolveTo:gD,resolveAll:pD},fD={tokenize:bD},hD={tokenize:yD},mD={tokenize:DD};function pD(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 gD(e,t){let n=e.length,r=0,a,i,s,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},c={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return o=[["enter",l,t],["enter",u,t]],o=Dt(o,e.slice(i+1,i+r+3)),o=Dt(o,[["enter",c,t]]),o=Dt(o,co(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=Dt(o,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),o=Dt(o,e.slice(s+1)),o=Dt(o,[["exit",l,t]]),Rt(e,i,e.length,o),e}function vD(e,t,n){const r=this;let a=r.events.length,i,s;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(p){return i?i._inactive?h(p):(s=r.parser.defined.includes(Wn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(fD,c,s?c:h)(p):p===91?e.attempt(hD,c,s?u:h)(p):s?c(p):h(p)}function u(p){return e.attempt(mD,c,h)(p)}function c(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function bD(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return ft(h)?Dr(e,i)(h):i(h)}function i(h){return h===41?c(h):sf(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ft(h)?Dr(e,l)(h):c(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?uf(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return ft(h)?Dr(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function yD(e,t,n){const r=this;return a;function a(o){return of.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Wn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function DD(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 CD={name:"labelStartImage",tokenize:xD,resolveAll:fo.resolveAll};function xD(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 wD={name:"labelStartLink",tokenize:ED,resolveAll:fo.resolveAll};function ED(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 Si={name:"lineEnding",tokenize:kD};function kD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ie(e,t,"linePrefix")}}const ma={name:"thematicBreak",tokenize:_D};function _D(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"),je(u)?Ie(e,o,"whitespace")(u):o(u))}}const lt={name:"list",tokenize:FD,continuation:{tokenize:TD},exit:jD},BD={tokenize:OD,partial:!0},AD={tokenize:SD,partial:!0};function FD(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:As(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ma,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return As(m)&&++s<10?(e.consume(m),l):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Ga,r.interrupt?n:c,e.attempt(BD,p,h))}function c(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function h(m){return je(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function TD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ga,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!je(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(AD,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(lt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function SD(e,t,n){const r=this;return Ie(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 jD(e){e.exit(this.containerState.type)}function OD(e,t,n){const r=this;return Ie(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!je(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Nl={name:"setextUnderline",tokenize:ND,resolveTo:PD};function PD(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 ND(e,t,n){const r=this;let a;return i;function i(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===a?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),je(u)?Ie(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ye(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const RD={tokenize:MD};function MD(e){const t=this,n=e.attempt(Ga,r,e.attempt(this.parser.constructs.flowInitial,a,Ie(e,e.attempt(this.parser.constructs.flow,a,e.attempt(q1,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 ID={resolveAll:cf()},$D=lf("string"),LD=lf("text");function lf(e){return{tokenize:t,resolveAll:cf(e==="text"?zD:void 0)};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(c){return u(c)?i(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),i(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=a[c];let p=-1;if(h)for(;++p<h.length;){const m=h[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function cf(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 zD(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 qD(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:x,enter:A,exit:k,attempt:S(w),check:S(F),interrupt:S(F,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:p,now:g,defineSkip:f,write:h};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h(I){return s=Dt(s,I),b(),s[s.length-1]!==null?[]:(z(t,0),u.events=co(i,u.events,u),u.events)}function p(I,E){return HD(m(I),E)}function m(I){return WD(s,I)}function g(){const{line:I,column:E,offset:B,_index:T,_bufferIndex:M}=r;return{line:I,column:E,offset:B,_index:T,_bufferIndex:M}}function f(I){a[I.line]=I.column,$()}function b(){let I;for(;r._index<s.length;){const E=s[r._index];if(typeof E=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<E.length;)y(E.charCodeAt(r._bufferIndex));else y(E)}}function y(I){c=c(I)}function x(I){ye(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,$()):I!==-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=I}function A(I,E){const B=E||{};return B.type=I,B.start=g(),u.events.push(["enter",B,u]),o.push(B),B}function k(I){const E=o.pop();return E.end=g(),u.events.push(["exit",E,u]),E}function w(I,E){z(I,E.from)}function F(I,E){E.restore()}function S(I,E){return B;function B(T,M,R){let W,X,G,D;return Array.isArray(T)?te(T):"tokenize"in T?te([T]):H(T);function H(L){return U;function U(ne){const re=ne!==null&&L[ne],ae=ne!==null&&L.null,fe=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return te(fe)(ne)}}function te(L){return W=L,X=0,L.length===0?R:_(L[X])}function _(L){return U;function U(ne){return D=N(),G=L,L.partial||(u.currentConstruct=L),L.name&&u.parser.constructs.disable.null.includes(L.name)?q():L.tokenize.call(E?Object.assign(Object.create(u),E):u,l,j,q)(ne)}}function j(L){return I(G,D),M}function q(L){return D.restore(),++X<W.length?_(W[X]):R}}}function z(I,E){I.resolveAll&&!i.includes(I)&&i.push(I),I.resolve&&Rt(u.events,E,u.events.length-E,I.resolve(u.events.slice(E),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function N(){const I=g(),E=u.previous,B=u.currentConstruct,T=u.events.length,M=Array.from(o);return{restore:R,from:T};function R(){r=I,u.previous=E,u.currentConstruct=B,u.events.length=T,o=M,$()}}function $(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function WD(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 HD(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=`
113
113
  `;break}case-3:{s=`\r
114
- `;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 UD={42:lt,43:lt,45:lt,48:lt,49:lt,50:lt,51:lt,52:lt,53:lt,54:lt,55:lt,56:lt,57:lt,62:tf},VD={91:K1},KD={[-2]:Fi,[-1]:Fi,32:Fi},ZD={35:X1,42:ha,45:[Nl,ha],60:rD,61:Nl,95:ha,96:Ol,126:Ol},YD={38:rf,92:nf},GD={[-5]:Ti,[-4]:Ti,[-3]:Ti,33:CD,38:rf,42:Fs,60:[E1,cD],91:wD,92:[Q1,nf],93:fo,95:Fs,96:M1},QD={null:[Fs,ID]},JD={null:[42,95]},XD={null:[]},eC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:JD,contentInitial:VD,disable:XD,document:UD,flow:ZD,flowInitial:KD,insideSpan:QD,string:YD,text:GD},Symbol.toStringTag,{value:"Module"}));function tC(e){const n=l1([eC,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:a(v1),document:a(y1),flow:a(RD),string:a($D),text:a(LD)};return r;function a(i){return s;function s(o){return qD(r,i,o)}}}function nC(e){for(;!af(e););return e}const Rl=/[\0\t\n\r]/g;function rC(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,c,h,p,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(Rl.lastIndex=h,u=Rl.exec(i),p=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(p),!u){t=i.slice(h);break}if(m===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(i.slice(h,p)),e+=p-h),m){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const aC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iC(e){return e.replace(aC,sC)}function sC(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return ef(n.slice(i?2:1),i?16:10)}return lo(n)||e}const df={}.hasOwnProperty;function oC(e,t,n){return typeof t!="string"&&(n=t,t=void 0),uC(n)(nC(tC(n).document().write(rC()(e,t,!0))))}function uC(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ke),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(he),blockQuote:i(re),characterEscape:R,characterReference:R,codeFenced:i(ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ae,s),codeText:i(fe,s),codeTextData:R,data:R,codeFlowValue:R,definition:i(X),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(be),hardBreakEscape:i(xe),hardBreakTrailing:i(xe),htmlFlow:i(Ae,s),htmlFlowData:R,htmlText:i(Ae,s),htmlTextData:R,image:i(Fe),label:s,link:i(Ke),listItem:i(He),listItemValue:p,listOrdered:i(We,h),listUnordered:i(We),paragraph:i(Qe),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(he),strong:i(me),thematicBreak:i($e)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:ne,autolinkProtocol:U,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:L,codeFenced:l(D),codeFencedFence:f,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:M,codeIndented:l(y),codeText:l(j),codeTextData:M,data:M,definition:l(),definitionDestinationString:_,definitionLabelString:x,definitionTitleString:A,emphasis:l(),hardBreakEscape:l(w),hardBreakTrailing:l(w),htmlFlow:l(k),htmlFlowData:M,htmlText:l(O),htmlTextData:M,image:l(H),label:J,labelText:te,lineEnding:$,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:S,resourceDestinationString:v,resourceTitleString:W,resource:ee,setextHeading:l(I),setextHeadingLineSequence:T,setextHeadingText:F,strong:l(),thematicBreak:l()}};ff(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let se={type:"root",children:[]};const pe={stack:[se],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:c,data:n},ge=[];let we=-1;for(;++we<K.length;)if(K[we][1].type==="listOrdered"||K[we][1].type==="listUnordered")if(K[we][0]==="enter")ge.push(we);else{const Ye=ge.pop();we=a(K,Ye,we)}for(we=-1;++we<K.length;){const Ye=t[K[we][0]];df.call(Ye,K[we][1].type)&&Ye[K[we][1].type].call(Object.assign({sliceSerialize:K[we][2].sliceSerialize},pe),K[we][1])}if(pe.tokenStack.length>0){const Ye=pe.tokenStack[pe.tokenStack.length-1];(Ye[1]||Ml).call(pe,void 0,Ye[0])}for(se.position={start:Yt(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Yt(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)se=t.transforms[we](se)||se;return se}function a(K,se,pe){let ge=se-1,we=-1,Ye=!1,Ge,mt,Mt,Et;for(;++ge<=pe;){const Xe=K[ge];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?we++:we--,Et=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ge&&!Et&&!we&&!Mt&&(Mt=ge),Et=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Et=void 0}if(!we&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||we===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ge){let At=ge;for(mt=void 0;At--;){const pt=K[At];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;mt&&(K[mt][1].type="lineEndingBlank",Ye=!0),pt[1].type="lineEnding",mt=At}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}Mt&&(!mt||Mt<mt)&&(Ge._spread=!0),Ge.end=Object.assign({},mt?K[mt][1].start:Xe[1].end),K.splice(mt||ge,0,["exit",Ge,Xe[2]]),ge++,pe++}if(Xe[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ge=At,K.splice(ge,0,["enter",At,Xe[2]]),ge++,pe++,Mt=void 0,Et=!0}}}return K[se][1]._spread=Ye,pe}function i(K,se){return pe;function pe(ge){o.call(this,K(ge),ge),se&&se.call(this,ge)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(K,se,pe){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([se,pe]),K.position={start:Yt(se.start),end:void 0}}function l(K){return se;function se(pe){K&&K.call(this,pe),u.call(this,pe)}}function u(K,se){const pe=this.stack.pop(),ge=this.tokenStack.pop();if(ge)ge[0].type!==K.type&&(se?se.call(this,K,ge[0]):(ge[1]||Ml).call(this,K,ge[0]));else throw new Error("Cannot close `"+K.type+"` ("+yr({start:K.start,end:K.end})+"): it’s not open");pe.position.end=Yt(K.end)}function c(){return o1(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(K){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function m(){const K=this.resume(),se=this.stack[this.stack.length-1];se.lang=K}function g(){const K=this.resume(),se=this.stack[this.stack.length-1];se.meta=K}function f(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function D(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/(\r?\n|\r)$/g,"")}function x(K){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.label=se,pe.identifier=Wn(this.sliceSerialize(K)).toLowerCase()}function A(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function _(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function E(K){const se=this.stack[this.stack.length-1];if(!se.depth){const pe=this.sliceSerialize(K).length;se.depth=pe}}function F(){this.data.setextHeadingSlurpLineEnding=!0}function T(K){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function R(K){const pe=this.stack[this.stack.length-1].children;let ge=pe[pe.length-1];(!ge||ge.type!=="text")&&(ge=Te(),ge.position={start:Yt(K.start),end:void 0},pe.push(ge)),this.stack.push(ge)}function M(K){const se=this.stack.pop();se.value+=this.sliceSerialize(K),se.position.end=Yt(K.end)}function $(K){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=se.children[se.children.length-1];pe.position.end=Yt(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(R.call(this,K),M.call(this,K))}function w(){this.data.atHardBreak=!0}function k(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function O(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function j(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function z(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function H(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function te(K){const se=this.sliceSerialize(K),pe=this.stack[this.stack.length-2];pe.label=iC(se),pe.identifier=Wn(se).toLowerCase()}function J(){const K=this.stack[this.stack.length-1],se=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const ge=K.children;pe.children=ge}else pe.alt=se}function v(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function W(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function ee(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function S(K){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.label=se,pe.identifier=Wn(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function q(K){this.data.characterReferenceType=K.type}function L(K){const se=this.sliceSerialize(K),pe=this.data.characterReferenceType;let ge;pe?(ge=ef(se,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=lo(se);const we=this.stack.pop();we.value+=ge,we.position.end=Yt(K.end)}function U(K){M.call(this,K);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(K)}function ne(K){M.call(this,K);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(K)}function re(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function he(){return{type:"heading",depth:0,children:[]}}function xe(){return{type:"break"}}function Ae(){return{type:"html",value:""}}function Fe(){return{type:"image",title:null,url:"",alt:null}}function Ke(){return{type:"link",title:null,url:"",children:[]}}function We(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function He(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function me(){return{type:"strong",children:[]}}function Te(){return{type:"text",value:""}}function $e(){return{type:"thematicBreak"}}}function Yt(e){return{line:e.line,column:e.column,offset:e.offset}}function ff(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ff(e,r):lC(e,r)}}function lC(e,t){let n;for(n in t)if(df.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 Ml(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yr({start:t.start,end:t.end})+") is still open")}function cC(e){const t=this;t.parser=n;function n(r){return oC(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hf(e,t){var l,u,c;const n={...Ln,...t==null?void 0:t.nodeTypes,[Z.heading]:{...Ln[Z.heading],...(l=t==null?void 0:t.nodeTypes)==null?void 0:l[Z.heading]}},r=(t==null?void 0:t.linkDestinationKey)??"link",a=(t==null?void 0:t.imageSourceKey)??"link",i=(t==null?void 0:t.imageCaptionKey)??"caption";let s=[{text:""}];const o=e.children;switch(o&&Array.isArray(o)&&o.length>0&&(s=o.flatMap(h=>hf({...h,ordered:e.ordered||!1},t))),e.type){case st.heading:return{type:n[Z.heading][e.depth||1],children:s};case st.list:return{type:e.ordered?n[Z.ol]:n[Z.ul],children:s};case st.listItem:return{type:n[Z.li],children:s};case st.paragraph:return{type:n[Z.paragraph],children:s};case st.link:return{type:n[Z.link],[r]:e.url,children:s};case st.image:return{type:n[Z.image],children:[{text:""}],[a]:e.url,[i]:e.alt};case st.blockquote:return{type:n[Z.blockquote],children:s};case st.code:return{type:n[Z.codeblock],language:e.lang,children:[{text:e.value}]};case st.html:return(u=e.value)!=null&&u.includes("<br>")?{break:!0,type:n[Z.paragraph],children:[{text:((c=e.value)==null?void 0:c.replace(/<br>/g,""))||""}]}:{type:Z.paragraph,children:[{text:e.value||""}]};case st.emphasis:return{[n[Ot.emphasis]]:!0,...Si(s),...Qr(s)};case st.strong:return{[n[Ot.strong]]:!0,...Si(s),...Qr(s)};case st.delete:return{[n[Ot.delete]]:!0,...Si(s),...Qr(s)};case st.inlineCode:return{[n[Ot.code]]:!0,text:e.value,...Qr(s)};case st.thematicBreak:return{type:n[Z.hr],children:[{text:""}]};case"text":default:return{text:e.value||""}}}const Si=e=>({text:e.map(t=>t==null?void 0:t.text).join("")});function Qr(e){return e.reduce((t,n)=>(Object.keys(n).forEach(function(r){r==="children"||r==="type"||r==="text"||(t[r]=n[r])}),t),{})}const dC=function(t){const n=r=>r.children.map(a=>hf(a,t));this.Compiler=n},fC=(e,t=n=>{})=>{n1().use(cC).use(dC).process(e).then(n=>{const r=pn(n.result),a=s=>{const o=s;[Z.li,Z.blockquote].includes(o.type)&&o.children.map((l,u)=>{const c=l;c.type===Z.paragraph&&o.children.splice(u,1,...c.children)}),"children"in s&&s.children&&s.children.forEach(l=>a(l))};r.forEach(a);const i=s=>{const o=s;if(o.type===Z.link){const l=o.children&&o.children[0];if(l&&"text"in l&&l.text.includes(ws)){const u=o,c=l.text.replace(ws,""),h="link"in u&&u.link?u.link:"";u.type=Z.mention,u.id=h,u.name=c,u.children=[{text:""}]}}"children"in s&&s.children&&s.children.forEach(l=>i(l))};r.forEach(i),r.map(s=>{"children"in s&&s.children&&s.children.map((o,l)=>{if("text"in o&&o.text){const u=o.text.match(/~~(.*?)~~/g);u&&u.map(c=>{const h=c.replace(/~~/g,""),p=o.text.indexOf(c),m=o.text.substring(0,p),g=o.text.substring(p+c.length),f=[{text:m},{text:h,[Z.strikethrough]:!0},{text:g}];s.children.splice(l,1,...f)})}})}),t(r)})},ho=e=>{const t=document.getElementById(e);if(t){const n=t.querySelector(".input");n&&(n==null||n.focus())}},hC=e=>{const{selection:t}=e;return t?b.string(e,t):null},Il=e=>{let t="";for(const n of oe.descendants(e)){const[r]=n,a=r;a.text&&(t+=a.text)}return t},$l={"mod+b":Z.bold,"mod+i":Z.italic,"mod+shift+x":Z.strikethrough,"mod+k":Z.link,"mod+shift+7":Z.ol,"mod+shift+8":Z.ul,"mod+shift+9":Z.blockquote},mC=(e,t,n,r)=>{for(const a in $l)if(ub(a,e)){e.stopPropagation(),e.preventDefault();const i=$l[a];if(i===Z.link){n([{type:"showLinkEditor",value:!0}]);return}if(kC(i)){Df(t,i,r);return}vf(t,i,r)}},mf=(e,t,n,r)=>{var c;const{selectedUser:a,possibleUsers:i}=t,s=i[a];if(!s)return;const o=s.userId||"",l=(c=s.user)==null?void 0:c.name;n([{type:"mentionPopover",value:{...t,show:!1}}]);const u={type:Z.mention,id:o,name:l,children:[{text:""}]};G.select(e,(t==null?void 0:t.position)||Gd),G.insertNodes(e,[u,{text:" "}]),G.move(e,{distance:1,unit:"offset"}),ho(r)},pC=async(e,t,n,r)=>{const{selection:a}=e;if(a&&V.isCollapsed(a)){const[i]=V.edges(a),s=b.start(e,i.path),o=b.range(e,s,i),u=b.string(e,o).match(Sc);if(u){const c=u.index||0,h={path:i.path,offset:c},p={path:i.path,offset:c+u[0].length},m=b.range(e,h,p),g=b.after(e,i),f=b.range(e,i,g);if(b.string(e,f).match(/^(\s|\.|,|\?|!|:|;|'|"|`|$)/)){const x=u[1];let A=[];n&&(A=await n({name:x})),r([{type:"mentionPopover",value:{show:A.length>0,selectedUser:0,possibleUsers:A,position:A.length>0?m:null}}])}return}}t&&r([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null}}])},On=e=>typeof e.text=="string",gC=[Z.hr,Z.image,Z.mention],Ll="<br>";function pf(e,t={nodeTypes:Ln}){const{nodeTypes:n=Ln,ignoreParagraphNewline:r=!1,listDepth:a=0}=t,i=e.text||"";let s=e.type||"";const o={...Ln,...n,heading:{...Ln[Z.heading],...n[Z.heading]}},l=[o[Z.ul],o[Z.ol]];let u=i;if(!On(e)&&s!==Z.mention&&(u=e.children.map(c=>{const h=On(c)?!1:l.includes(c.type||""),p=l.includes(e.type||"");let m=!1;return!On(e)&&Array.isArray(e.children)&&(m=e.children.some(g=>!On(g)&&g.type===o.link)),pf({...c,parentType:s},{nodeTypes:o,ignoreParagraphNewline:(r||h||p||m)&&!c.break,listDepth:l.includes(c.type||"")?a+1:a,inBlockquote:s===o[Z.blockquote]||e.parentType===o[Z.blockquote]})}).join("")),!r&&(i===""||i===`
114
+ `;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 UD={42:lt,43:lt,45:lt,48:lt,49:lt,50:lt,51:lt,52:lt,53:lt,54:lt,55:lt,56:lt,57:lt,62:tf},VD={91:K1},KD={[-2]:Ti,[-1]:Ti,32:Ti},ZD={35:X1,42:ma,45:[Nl,ma],60:rD,61:Nl,95:ma,96:Ol,126:Ol},YD={38:rf,92:nf},GD={[-5]:Si,[-4]:Si,[-3]:Si,33:CD,38:rf,42:Fs,60:[E1,cD],91:wD,92:[Q1,nf],93:fo,95:Fs,96:M1},QD={null:[Fs,ID]},JD={null:[42,95]},XD={null:[]},eC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:JD,contentInitial:VD,disable:XD,document:UD,flow:ZD,flowInitial:KD,insideSpan:QD,string:YD,text:GD},Symbol.toStringTag,{value:"Module"}));function tC(e){const n=l1([eC,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:a(v1),document:a(y1),flow:a(RD),string:a($D),text:a(LD)};return r;function a(i){return s;function s(o){return qD(r,i,o)}}}function nC(e){for(;!af(e););return e}const Rl=/[\0\t\n\r]/g;function rC(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,c,h,p,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(Rl.lastIndex=h,u=Rl.exec(i),p=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(p),!u){t=i.slice(h);break}if(m===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(i.slice(h,p)),e+=p-h),m){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const aC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iC(e){return e.replace(aC,sC)}function sC(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return ef(n.slice(i?2:1),i?16:10)}return lo(n)||e}const df={}.hasOwnProperty;function oC(e,t,n){return typeof t!="string"&&(n=t,t=void 0),uC(n)(nC(tC(n).document().write(rC()(e,t,!0))))}function uC(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ke),autolinkProtocol:N,autolinkEmail:N,atxHeading:i(me),blockQuote:i(re),characterEscape:N,characterReference:N,codeFenced:i(ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ae,s),codeText:i(fe,s),codeTextData:N,data:N,codeFlowValue:N,definition:i(ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(be),hardBreakEscape:i(xe),hardBreakTrailing:i(xe),htmlFlow:i(Fe,s),htmlFlowData:N,htmlText:i(Fe,s),htmlTextData:N,image:i(Te),label:s,link:i(Ke),listItem:i(He),listItemValue:p,listOrdered:i(We,h),listUnordered:i(We),paragraph:i(Qe),reference:_,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(me),strong:i(he),thematicBreak:i($e)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:ne,autolinkProtocol:U,blockQuote:l(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:L,codeFenced:l(b),codeFencedFence:f,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:$,codeIndented:l(y),codeText:l(M),codeTextData:$,data:$,definition:l(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:A,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(B),htmlFlowData:$,htmlText:l(T),htmlTextData:$,image:l(W),label:G,labelText:X,lineEnding:I,link:l(R),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:j,resourceDestinationString:D,resourceTitleString:H,resource:te,setextHeading:l(z),setextHeadingLineSequence:S,setextHeadingText:F,strong:l(),thematicBreak:l()}};ff(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let se={type:"root",children:[]};const pe={stack:[se],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:c,data:n},ge=[];let we=-1;for(;++we<K.length;)if(K[we][1].type==="listOrdered"||K[we][1].type==="listUnordered")if(K[we][0]==="enter")ge.push(we);else{const Ye=ge.pop();we=a(K,Ye,we)}for(we=-1;++we<K.length;){const Ye=t[K[we][0]];df.call(Ye,K[we][1].type)&&Ye[K[we][1].type].call(Object.assign({sliceSerialize:K[we][2].sliceSerialize},pe),K[we][1])}if(pe.tokenStack.length>0){const Ye=pe.tokenStack[pe.tokenStack.length-1];(Ye[1]||Ml).call(pe,void 0,Ye[0])}for(se.position={start:Yt(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Yt(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)se=t.transforms[we](se)||se;return se}function a(K,se,pe){let ge=se-1,we=-1,Ye=!1,Ge,mt,Mt,Et;for(;++ge<=pe;){const Xe=K[ge];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?we++:we--,Et=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ge&&!Et&&!we&&!Mt&&(Mt=ge),Et=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Et=void 0}if(!we&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||we===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ge){let At=ge;for(mt=void 0;At--;){const pt=K[At];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;mt&&(K[mt][1].type="lineEndingBlank",Ye=!0),pt[1].type="lineEnding",mt=At}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}Mt&&(!mt||Mt<mt)&&(Ge._spread=!0),Ge.end=Object.assign({},mt?K[mt][1].start:Xe[1].end),K.splice(mt||ge,0,["exit",Ge,Xe[2]]),ge++,pe++}if(Xe[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ge=At,K.splice(ge,0,["enter",At,Xe[2]]),ge++,pe++,Mt=void 0,Et=!0}}}return K[se][1]._spread=Ye,pe}function i(K,se){return pe;function pe(ge){o.call(this,K(ge),ge),se&&se.call(this,ge)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(K,se,pe){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([se,pe]),K.position={start:Yt(se.start),end:void 0}}function l(K){return se;function se(pe){K&&K.call(this,pe),u.call(this,pe)}}function u(K,se){const pe=this.stack.pop(),ge=this.tokenStack.pop();if(ge)ge[0].type!==K.type&&(se?se.call(this,K,ge[0]):(ge[1]||Ml).call(this,K,ge[0]));else throw new Error("Cannot close `"+K.type+"` ("+yr({start:K.start,end:K.end})+"): it’s not open");pe.position.end=Yt(K.end)}function c(){return o1(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(K){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function m(){const K=this.resume(),se=this.stack[this.stack.length-1];se.lang=K}function g(){const K=this.resume(),se=this.stack[this.stack.length-1];se.meta=K}function f(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/(\r?\n|\r)$/g,"")}function x(K){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.label=se,pe.identifier=Wn(this.sliceSerialize(K)).toLowerCase()}function A(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function k(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function w(K){const se=this.stack[this.stack.length-1];if(!se.depth){const pe=this.sliceSerialize(K).length;se.depth=pe}}function F(){this.data.setextHeadingSlurpLineEnding=!0}function S(K){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function N(K){const pe=this.stack[this.stack.length-1].children;let ge=pe[pe.length-1];(!ge||ge.type!=="text")&&(ge=ke(),ge.position={start:Yt(K.start),end:void 0},pe.push(ge)),this.stack.push(ge)}function $(K){const se=this.stack.pop();se.value+=this.sliceSerialize(K),se.position.end=Yt(K.end)}function I(K){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=se.children[se.children.length-1];pe.position.end=Yt(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(N.call(this,K),$.call(this,K))}function E(){this.data.atHardBreak=!0}function B(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function T(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function M(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function R(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function W(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function X(K){const se=this.sliceSerialize(K),pe=this.stack[this.stack.length-2];pe.label=iC(se),pe.identifier=Wn(se).toLowerCase()}function G(){const K=this.stack[this.stack.length-1],se=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const ge=K.children;pe.children=ge}else pe.alt=se}function D(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function H(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function te(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function j(K){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.label=se,pe.identifier=Wn(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function q(K){this.data.characterReferenceType=K.type}function L(K){const se=this.sliceSerialize(K),pe=this.data.characterReferenceType;let ge;pe?(ge=ef(se,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=lo(se);const we=this.stack.pop();we.value+=ge,we.position.end=Yt(K.end)}function U(K){$.call(this,K);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(K)}function ne(K){$.call(this,K);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(K)}function re(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function xe(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Ke(){return{type:"link",title:null,url:"",children:[]}}function We(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function He(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function he(){return{type:"strong",children:[]}}function ke(){return{type:"text",value:""}}function $e(){return{type:"thematicBreak"}}}function Yt(e){return{line:e.line,column:e.column,offset:e.offset}}function ff(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ff(e,r):lC(e,r)}}function lC(e,t){let n;for(n in t)if(df.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 Ml(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yr({start:t.start,end:t.end})+") is still open")}function cC(e){const t=this;t.parser=n;function n(r){return oC(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hf(e,t){var l,u,c;const n={...Ln,...t==null?void 0:t.nodeTypes,[Z.heading]:{...Ln[Z.heading],...(l=t==null?void 0:t.nodeTypes)==null?void 0:l[Z.heading]}},r=(t==null?void 0:t.linkDestinationKey)??"link",a=(t==null?void 0:t.imageSourceKey)??"link",i=(t==null?void 0:t.imageCaptionKey)??"caption";let s=[{text:""}];const o=e.children;switch(o&&Array.isArray(o)&&o.length>0&&(s=o.flatMap(h=>hf({...h,ordered:e.ordered||!1},t))),e.type){case st.heading:return{type:n[Z.heading][e.depth||1],children:s};case st.list:return{type:e.ordered?n[Z.ol]:n[Z.ul],children:s};case st.listItem:return{type:n[Z.li],children:s};case st.paragraph:return{type:n[Z.paragraph],children:s};case st.link:return{type:n[Z.link],[r]:e.url,children:s};case st.image:return{type:n[Z.image],children:[{text:""}],[a]:e.url,[i]:e.alt};case st.blockquote:return{type:n[Z.blockquote],children:s};case st.code:return{type:n[Z.codeblock],language:e.lang,children:[{text:e.value}]};case st.html:return(u=e.value)!=null&&u.includes("<br>")?{break:!0,type:n[Z.paragraph],children:[{text:((c=e.value)==null?void 0:c.replace(/<br>/g,""))||""}]}:{type:Z.paragraph,children:[{text:e.value||""}]};case st.emphasis:return{[n[Ot.emphasis]]:!0,...ji(s),...Jr(s)};case st.strong:return{[n[Ot.strong]]:!0,...ji(s),...Jr(s)};case st.delete:return{[n[Ot.delete]]:!0,...ji(s),...Jr(s)};case st.inlineCode:return{[n[Ot.code]]:!0,text:e.value,...Jr(s)};case st.thematicBreak:return{type:n[Z.hr],children:[{text:""}]};case"text":default:return{text:e.value||""}}}const ji=e=>({text:e.map(t=>t==null?void 0:t.text).join("")});function Jr(e){return e.reduce((t,n)=>(Object.keys(n).forEach(function(r){r==="children"||r==="type"||r==="text"||(t[r]=n[r])}),t),{})}const dC=function(t){const n=r=>r.children.map(a=>hf(a,t));this.Compiler=n},fC=(e,t=n=>{})=>{n1().use(cC).use(dC).process(e).then(n=>{const r=pn(n.result),a=s=>{const o=s;[Z.li,Z.blockquote].includes(o.type)&&o.children.map((l,u)=>{const c=l;c.type===Z.paragraph&&o.children.splice(u,1,...c.children)}),"children"in s&&s.children&&s.children.forEach(l=>a(l))};r.forEach(a);const i=s=>{for(let o=0;o<s.length;o++){const l=s[o],u=l;if(u.type===Z.link){const c=u.children&&u.children[0];if(c&&"text"in c&&c.text.includes(ws)){const h=u,p=c.text.replace(ws,""),m="link"in h&&h.link?h.link:"";h.type=Z.mention,h.id=m,h.name=p,h.children=[{text:""}],s[o+1]||s.splice(o+1,0,{text:" "}),o++}}"children"in l&&l.children&&i(l.children)}};i(r),r.map(s=>{"children"in s&&s.children&&s.children.map((o,l)=>{if("text"in o&&o.text){const u=o.text.match(/~~(.*?)~~/g);u&&u.map(c=>{const h=c.replace(/~~/g,""),p=o.text.indexOf(c),m=o.text.substring(0,p),g=o.text.substring(p+c.length),f=[{text:m},{text:h,[Z.strikethrough]:!0},{text:g}];s.children.splice(l,1,...f)})}})}),t(r)})},ho=e=>{const t=document.getElementById(e);if(t){const n=t.querySelector(".input");n&&(n==null||n.focus())}},hC=e=>{const{selection:t}=e;return t?v.string(e,t):null},Il=e=>{let t="";for(const n of oe.descendants(e)){const[r]=n,a=r;a.text&&(t+=a.text)}return t},$l={"mod+b":Z.bold,"mod+i":Z.italic,"mod+shift+x":Z.strikethrough,"mod+k":Z.link,"mod+shift+7":Z.ol,"mod+shift+8":Z.ul,"mod+shift+9":Z.blockquote},mC=(e,t,n,r)=>{for(const a in $l)if(ub(a,e)){e.stopPropagation(),e.preventDefault();const i=$l[a];if(i===Z.link){n([{type:"showLinkEditor",value:!0}]);return}if(kC(i)){Df(t,i,r);return}vf(t,i,r)}},mf=(e,t,n,r)=>{var c;const{selectedUser:a,possibleUsers:i}=t,s=i[a];if(!s)return;const o=s.userId||"",l=(c=s.user)==null?void 0:c.name;n([{type:"mentionPopover",value:{...t,show:!1}}]);const u={type:Z.mention,id:o,name:l,children:[{text:""}]};Q.select(e,(t==null?void 0:t.position)||Gd),Q.insertNodes(e,[u,{text:" "}]),Q.move(e,{distance:1,unit:"offset"}),ho(r)},pC=async(e,t,n,r)=>{const{selection:a}=e;if(a&&V.isCollapsed(a)){const[i]=V.edges(a),s=v.start(e,i.path),o=v.range(e,s,i),u=v.string(e,o).match(Sc);if(u){const c=u.index||0,h={path:i.path,offset:c},p={path:i.path,offset:c+u[0].length},m=v.range(e,h,p),g=v.after(e,i),f=v.range(e,i,g);if(v.string(e,f).match(/^(\s|\.|,|\?|!|:|;|'|"|`|$)/)){const x=u[1];let A=[];n&&(A=await n({name:x})),r([{type:"mentionPopover",value:{show:A.length>0,selectedUser:0,possibleUsers:A,position:A.length>0?m:null}}])}return}}t&&r([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null}}])},On=e=>typeof e.text=="string",gC=[Z.hr,Z.image,Z.mention],Ll="<br>";function pf(e,t={nodeTypes:Ln}){const{nodeTypes:n=Ln,ignoreParagraphNewline:r=!1,listDepth:a=0}=t,i=e.text||"";let s=e.type||"";const o={...Ln,...n,heading:{...Ln[Z.heading],...n[Z.heading]}},l=[o[Z.ul],o[Z.ol]];let u=i;if(!On(e)&&s!==Z.mention&&(u=e.children.map(c=>{const h=On(c)?!1:l.includes(c.type||""),p=l.includes(e.type||"");let m=!1;return!On(e)&&Array.isArray(e.children)&&(m=e.children.some(g=>!On(g)&&g.type===o.link)),pf({...c,parentType:s},{nodeTypes:o,ignoreParagraphNewline:(r||h||p||m)&&!c.break,listDepth:l.includes(c.type||"")?a+1:a,inBlockquote:s===o[Z.blockquote]||e.parentType===o[Z.blockquote]})}).join("")),!r&&(i===""||i===`
115
115
  `)&&e.parentType===o[Z.paragraph]&&s!==o[Z.mention]&&(s=o[Z.paragraph],u=Ll),!(u===""&&!gC.find(c=>o[c]===s)))switch(u!==Ll&&On(e)&&(e[Z.strikethrough]&&e[Z.bold]&&e[Z.italic]?u=Pn(u,"~~***"):e[Z.bold]&&e[Z.italic]?u=Pn(u,"***"):(e[Z.bold]&&(u=Pn(u,"**")),e[Z.italic]&&(u=Pn(u,"_")),e[Z.strikethrough]&&(u=Pn(u,"~~")),e[Z.code]&&(u=Pn(u,"`")))),s){case o[Z.heading][1]:return`# ${u}
116
116
  `;case o[Z.heading][2]:return`## ${u}
117
117
  `;case o[Z.heading][3]:return`### ${u}
@@ -129,31 +129,31 @@ ${u}
129
129
  `:""}`;case o[Z.paragraph]:return`${u}
130
130
 
131
131
  `;case o[Z.hr]:return`---
132
- `;default:return u}}function Pn(e,t){const n=e.trim(),r=n,a=`${t}${r}${zl(t)}`;if(r.length===e.length)return a;const i=t+r+zl(t);return e.replace(n,i)}const zl=e=>e.split("").reverse().join(""),vC=e=>e.map(t=>pf(t)).join("").trim();const bC=()=>{const e=Bn(),{dispatch:t,mentionPopover:n,id:r}=C.useContext(Vt),{show:a,selectedUser:i,possibleUsers:s}=n,o=Qd(e,"mention-popover",`toolbar-${r}`);return!a||!s.length?null:d.jsx(Ms,{children:d.jsx(Mc,{ref:o,className:"mention-popover",onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t([{type:"showMentionPopover",value:!1}]))},children:d.jsx("ul",{children:s.map(({userId:l,user:u},c)=>d.jsx(tr,{element:"li",className:Y({selected:c===i}),member:{id:l,...u,link:!1},functions:{onClick:h=>{h.preventDefault(),h.stopPropagation();const p={...n,selectedUser:c};t([{type:"mentionPopover",value:p}]),mf(e,p,t,r)}}},l))})})})},mo=({id:e,active:t,hasDivider:n=!1,callback:r,className:a="",children:i,...s})=>{const o=ue.useIntl(),l=Bn(),{id:u,tabbableOption:c,setFocus:h,openTooltip:p,dispatch:m}=C.useContext(Vt),g={};return e!==c&&(g.tabIndex=-1),d.jsxs("li",{id:`${u}-${e}`,className:Y(e,{"has-divider":n}),onMouseEnter:()=>{m([{type:"openTooltip",value:e}])},onMouseLeave:()=>{m([{type:"openTooltip",value:null}])},onFocus:()=>{m([{type:"openTooltip",value:e}])},onBlur:f=>{f.stopPropagation();const D=[{type:"openTooltip",value:null}];l.selection&&D.push({type:"lastAnchor",value:l.selection.anchor}),m(D)},contentEditable:!1,children:[d.jsxs("button",{...s,...g,className:Y(e,a,{active:t}),onClick:f=>{f.stopPropagation(),f.preventDefault()},onMouseDown:f=>{f.stopPropagation(),f.preventDefault(),r()},onKeyDown:f=>{var D,y,x,A;if(f.key!=="Tab")switch(f.key){case"Enter":f.stopPropagation(),f.preventDefault(),r();break;case"ArrowLeft":case"ArrowRight":f.stopPropagation(),f.preventDefault();const _=f.currentTarget.closest("li");let E=_==null?void 0:_.nextElementSibling;if(f.key==="ArrowLeft"){const I=_==null?void 0:_.previousElementSibling;I?E=I:E=(D=_==null?void 0:_.parentElement)==null?void 0:D.lastElementChild}else E||(E=(y=_==null?void 0:_.parentElement)==null?void 0:y.firstElementChild);const F=E==null?void 0:E.className.split(" ")[0];F&&(h(F),(x=E==null?void 0:E.querySelector("button"))==null||x.focus());break;default:const T=f.currentTarget.closest("fieldset");if(T){(A=T==null?void 0:T.previousElementSibling)==null||A.focus();break}}},children:[d.jsx(Me,{showOnFocus:!1,children:o.formatMessage({id:`richTextEditor_${e}`})}),d.jsx(En,{id:`tooltip-${e}`,styling:{extraPadding:!1,hasPointer:"bottom"},isOpen:p===e,"aria-hidden":!0,children:o.formatMessage({id:`richTextEditor_${e}`})})]}),i]})},ql=[Z.ol,Z.ul],gf=(e,t)=>{const{selection:n}=e;if(!n)return!1;const[r]=Array.from(b.nodes(e,{at:b.unhangRange(e,n),match:a=>{const i=a;return!b.isEditor(a)&&ce.isElement(a)&&i.type===t}}));return!!r},yC=e=>{const[t]=b.nodes(e,{match:n=>n.type===Z.blockquote});return!!t},vf=(e,t,n)=>{try{const r=yC(e),a=gf(e,t),i=ql.includes(t);G.unwrapNodes(e,{match:l=>{const u=l;return!b.isEditor(u)&&ce.isElement(u)&&ql.includes(u.type)},split:!0});const o={type:a?Z.paragraph:i?Z.li:t};if(G.setNodes(e,o),i)if(a){const{selection:l}=e;if(!l)return;const[u,c]=b.parent(e,l,{edge:"end"});Array.from(b.nodes(e,{at:c,match:p=>{const m=p;return!b.isEditor(p)&&ce.isElement(p)&&m.type===Z.li}})).forEach(([p,m])=>{oe.string(p).trim()===""&&G.removeNodes(e,{at:m})})}else{if(r){const u={type:Z.blockquote,children:[]};G.wrapNodes(e,u)}const l={type:t,children:[]};G.wrapNodes(e,l)}}catch(r){const a=r.message;n(`Error toggling block: ${a}`)}},DC=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=C.useContext(Vt),a=Bn(),i=gf(a,e);return d.jsx(mo,{id:e,active:i,hasDivider:t,callback:()=>{vf(a,e,r),n(i?null:e)}})},Cr=e=>{const[t]=b.nodes(e,{match:n=>{const r=n;return!b.isEditor(n)&&ce.isElement(n)&&r.type===Z.link}});return!!t},CC=(e,t,n,r)=>{e.selection&&po(e,t,n,r)},xC=(e,t,n,r)=>{const{selection:a}=e;if(a&&V.isCollapsed(a)){const[s]=b.nodes(e,{match:o=>{const l=o;return!b.isEditor(o)&&ce.isElement(o)&&l.type===Z.link}});if(s){const[o,l]=s,u={link:t};G.setNodes(e,u,{at:l}),ho(n)}}else po(e,t,n,r)},po=(e,t,n,r=a=>{console.error(a)})=>{try{Cr(e)&&bf(e);const{selection:a}=e,i=a&&V.isCollapsed(a),s={type:Z.link,link:t,children:i?[{text:t}]:[]};i?(G.insertNodes(e,s),G.move(e,{distance:1,unit:"offset"})):(G.wrapNodes(e,s,{split:!0}),G.collapse(e,{edge:"end"}),G.insertNodes(e,{text:""}),G.move(e,{distance:1,unit:"offset"})),ho(n)}catch(a){const i=a.message;r(`Error in wrapLink: ${i}`)}},bf=e=>{G.unwrapNodes(e,{match:t=>{const n=t;return!b.isEditor(t)&&ce.isElement(t)&&n.type===Z.link}})};let ji=null;const wC=()=>{const e=ue.useIntl(),t="richTextEditor_link_",{id:n,showLinkEditor:r,dispatch:a,reportError:i}=C.useContext(Vt),s=Bn(),o=Iy(s),l=(o==null?void 0:o.text)||hC(s),[u,c]=C.useState(Cr(s)),h=Qd(s,"link-editor",`${n}-link`),p=C.useRef(null);C.useEffect(()=>{var D;!u&&r&&((D=p.current)==null||D.focus())},[u]),C.useEffect(()=>{ji&&clearTimeout(ji),ji=setTimeout(()=>{c(Cr(s))},500)},[s.selection]);const m=[],g=["open","edit","remove"].map(D=>{const y={variant:"tertiary",size:"small",children:e.formatMessage({id:`${t}${D}`},{link:o==null?void 0:o.pretty})};switch(m.push({className:D}),D){case"open":y.href=(o==null?void 0:o.full)||"",y.onClick=x=>{x.preventDefault(),x.stopPropagation(),window.open((o==null?void 0:o.full)||"","_blank"),a([{type:"showLinkEditor",value:!1}])},y.children=d.jsxs(d.Fragment,{children:[y.children,d.jsx(Me,{children:e.formatMessage({id:`${t}${D}_text`})})]});break;case"edit":y.onClick=()=>{c(!1)};break;case"remove":y.onClick=()=>{const x=[{type:"showLinkEditor",value:!1}];Cr(s)&&(bf(s),x.push({type:"lastAnchor",value:null})),a(x)};break}return y}),f=[{id:"url",type:"url",inputRef:p,label:e.formatMessage({id:`${t}url`}),placeholder:e.formatMessage({id:`${t}placeholder`}),value:(o==null?void 0:o.full)||"",validation:[{condition:"required",error:e.formatMessage({id:`${t}error_required`})},{condition:"valid-url"}],submitOnEnter:!0,autoFocus:!0}];return l&&f.unshift({component:()=>d.jsxs("p",{children:[d.jsx("strong",{"aria-label":e.formatMessage({id:`${t}text_aria`}),children:e.formatMessage({id:`${t}text`})})," ",l]})}),d.jsx(Ms,{children:d.jsx(En,{ref:h,className:"link-editor",isOpen:r,styling:{extraPadding:!1,hasForm:!u},functions:{onBlur:()=>{a([{type:"showLinkEditor",value:!1}])}},callbacks:{onOpen:()=>{setTimeout(()=>{var D;return(D=p.current)==null?void 0:D.focus()})}},children:u?d.jsx(kn,{wrappers:m,buttons:g}):d.jsx(nr,{element:"fieldset",id:`${n}-link-editor`,className:Y({"show-labels":l}),meta:{shouldReset:!0,showRequiredLabels:!1},functions:{onSuccess:async D=>{setTimeout(()=>{const y=[{type:"showLinkEditor",value:!1}];if(D.url){const{full:x}=Rc(D.url);o!=null&&o.full?xC(s,x,n,i):CC(s,x,n,i),y.push({type:"lastAnchor",value:null})}a(y)})}},fields:f,button:{text:e.formatMessage({id:`${t}button`}),variant:"tertiary",size:"small"}})})})},EC=()=>{const e=Bn(),{setFocus:t,dispatch:n}=C.useContext(Vt),[r,a]=C.useState(!1);return C.useEffect(()=>{a(Cr(e))},[e.selection]),d.jsx(mo,{id:"link",active:r,hasDivider:!0,callback:()=>{n([{type:"showLinkEditor",value:!0}]),t(r?null:"link"),a(!0)}})},kC=e=>[Z.bold,Z.italic,Z.strikethrough].includes(e),yf=(e,t)=>{const n=b.marks(e);return n?n[t]===!0:!1},Df=(e,t,n)=>{try{yf(e,t)?b.removeMark(e,t):b.addMark(e,t,!0)}catch(r){const a=r.message;n(`Error toggling mark: ${a}`)}},_C=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=C.useContext(Vt),a=Bn(),i=yf(a,e);return d.jsx(mo,{id:e,active:i,hasDivider:t,callback:()=>{Df(a,e,r),n(i?null:e)}})},_a=[Z.bold,Z.italic,Z.strikethrough],BC=[Z.ol,Z.ul,Z.blockquote];const AC=({...e})=>{const t=ue.useIntl(),{id:n}=C.useContext(Vt);return d.jsxs(d.Fragment,{children:[d.jsxs("fieldset",{id:`toolbar-${n}`,className:"toolbar",...e,children:[d.jsx(Me,{element:"legend",showOnFocus:!1,children:t.formatMessage({id:"richTextEditor_toolbar"})}),d.jsxs("ul",{children:[_a.map((r,a)=>d.jsx(_C,{format:r,hasDivider:a===_a.length-1},r)),d.jsx(EC,{}),BC.map((r,a)=>d.jsx(DC,{format:r,hasDivider:a===1},r))]})]}),d.jsx(wC,{})]})};var FC=OC,TC=/^(?:\w+:)?\/\/(\S+)$/,SC=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,jC=/^[^\s\.]+\.\S{2,}$/;function OC(e){if(typeof e!="string")return!1;var t=e.match(TC);if(!t)return!1;var n=t[1];return n?!!(SC.test(n)||jC.test(n)):!1}const PC=wn(FC),NC=(e,t,n)=>{const{insertText:r,isInline:a}=e;try{e.isInline=i=>{const s=i;return[Z.link].includes(s.type)||a(i)},e.insertText=i=>{i&&PC(i)?po(e,i,t):r(i)}}catch(i){const s=i.message;n(`Error in withInlines: ${s}`)}return e},RC=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:a}=e;try{e.isInline=i=>i.type===Z.mention?!0:n(i),e.isVoid=i=>i.type===Z.mention?!0:r(i),e.markableVoid=i=>i.type===Z.mention||a(i)}catch(i){const s=i.message;t(`Error in withMentions: ${s}`)}return e},MC=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,a])=>{if(r.type===Z.link&&oe.string(r).trim()===""){G.removeNodes(e,{at:a});return}n([r,a])}}catch(r){const a=r.message;t(`Error in withoutEmptyLinks: ${a}`)}return e};const Cf=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,functions:a,autoFocus:i=!0,data:s,...o})=>{const l=ue.useIntl(),u=Oh(),{listMembers:c,onChange:h=()=>{},reportError:p=j=>{console.error(j)}}=a||{},m=[{type:Z.paragraph,children:[{text:""}]}],g={originalValue:t||"",initialValue:t?null:m,tabbableOption:_a[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1},[f,D]=C.useReducer(Or,g),{originalValue:y,initialValue:x,stringValue:A,lastAnchor:_,lastKey:E,hasInteracted:F,hasLoaded:T,mentionPopover:I}=f,R=j=>{const z=j||_a[0];j&&D([{type:"tabbableOption",value:z}])},M=`rte-${e}`,$=C.useCallback(j=>d.jsx(Ry,{...j}),[]),w=C.useCallback(j=>d.jsx(My,{...j}),[]),k=C.useMemo(()=>NC(RC(MC(wv(Py(Cv())),p),p),M,p),[]);C.useEffect(()=>{t&&(async()=>{let z=pn(t);z.includes("<")&&(z=new ya().turndown(z)),s&&s.mentions&&(z=await Nc({text:z,template:`[${ws}{{name}}]({{id}})`,mentions:s.mentions,listMembers:c||(()=>Promise.resolve([]))})),fC(z,H=>{D([{type:"initialValue",value:H}]),setTimeout(()=>{D([{type:"stringValue",value:Il(k)}])},150)})})()},[]),C.useEffect(()=>{if(k.children.length>0&&!T){if(D([{type:"hasLoaded",value:!0}]),!i)return;const j=b.end(k,[]);G.select(k,j),Q.focus(k)}},[k.children.length]),C.useEffect(()=>{t!==""||!k||vc(y,t)&&!F||(b.withoutNormalizing(k,()=>{G.delete(k,{at:{anchor:b.start(k,[]),focus:b.end(k,[])}}),G.deselect(k),k.children.length!==0&&G.unwrapNodes(k,{at:[0]}),G.insertNodes(k,m,{at:[0]})}),D([{type:"initialValue",value:m},{type:"lastAnchor",value:null}]))},[t]);const O=xc(()=>{pC(k,I.show,c,D)},100);return x?d.jsx("div",{id:M,className:"rich-text-editor",children:d.jsxs(Vt.Provider,{value:{...f,id:M,setFocus:R,dispatch:D,reportError:p},children:[d.jsxs(jy,{editor:k,initialValue:x,onChange:j=>{if(k.operations.some(H=>H.type!=="set_selection")){const H=vC(j);h(H),D([{type:"stringValue",value:Il(k)}]),F||D([{type:"hasInteracted",value:!0}]),O(),u&&console.log({serialized:H,json:j})}},...o,children:[d.jsx(wy,{className:"input",renderElement:$,renderLeaf:w,placeholder:n||l.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:i,tabIndex:0,onKeyDown:j=>{if(j.key==="Enter"){I.show&&(j.preventDefault(),j.stopPropagation(),mf(k,I,D,M));const{selection:z}=k;if(z){const H=V.isCollapsed(z),[te,J]=b.node(k,z,{depth:1});let v=te,W=v.type;const ee=v.children[0];if(ee&&[Z.ol,Z.ul].includes(ee.type)&&(v=ee,W=ee.type),v&&ce.isElement(v)&&W!==Z.paragraph){if(W===Z.blockquote&&!j.shiftKey){j.stopPropagation(),j.preventDefault(),G.insertNodes(k,m);return}if(H){const[B]=b.parent(k,z,{edge:"end"}),q=B.type;if(E==="Enter"&&q===Z.li&&[Z.ul,Z.ol].includes(W)){j.stopPropagation(),j.preventDefault(),G.insertNodes(k,m,{at:N.next(J)}),G.select(k,b.end(k,N.next(J)));return}}}}}else if(j.key==="Escape"){if(I.show){j.preventDefault(),j.stopPropagation(),D([{type:"mentionPopover",value:{...I,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(j.key)&&I.show){j.preventDefault(),j.stopPropagation();const{selectedUser:z,possibleUsers:H}=I;let te=j.key==="ArrowUp"?z-1:z+1;te<0&&(te=H.length-1),te>=H.length&&(te=0),D([{type:"mentionPopover",value:{...I,selectedUser:te}}])}D([{type:"lastKey",value:j.key}]),mC(j,k,D,p)},onBlur:()=>{k.selection&&D([{type:"lastAnchor",value:k.selection.anchor}])},onFocus:()=>{if(_){if(!N.isPath(_.path)||!oe.has(k,_.path))return;const j=oe.get(k,_.path);let z=0;if(de.isText(j)?z=j.text.length:j.children&&(z=j.children.length),_.offset>z)return;try{G.select(k,{anchor:_,focus:_})}catch(H){const te=H.message;p(`Error focusing editor: ${te}`)}}}}),d.jsx(AC,{}),c?d.jsx(bC,{}):null]}),d.jsx(qs,{limit:r,valueLength:qa(A)})]})}):null};const IC=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:a=()=>{}},isDisabled:i=!1,className:s=""})=>{const[o,l]=C.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);C.useEffect(()=>{r&&l(r)},[r]);const u=c=>{i||(l(c),a(c))};return d.jsxs("div",{className:Y("toggle",s),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[d.jsx("p",{children:t}),d.jsx("ul",{className:Y("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(c=>{const h=`${e}-${c.value}`;return d.jsxs("li",{className:"hidden",children:[d.jsx("input",{type:"radio",id:h,name:e,value:c.value,checked:o===c.value,onChange:()=>u(c.value),disabled:i}),d.jsx("label",{htmlFor:h,children:c.label})]},h)})})]})};function $C({className:e="",userId:t,userName:n,src:r,setUserImage:a,uploadImage:i}){const[s,o]=C.useState(!1),[l,u]=C.useState(!1),c=C.useRef(null),h=async p=>{o(!0),u(!1);try{const m=p.target.files&&p.target.files[0];if(!m||!t)throw o(!1),new Error("Image file or userID is missing");const g=await i({fileObject:m,userId:t});a(f=>({...f,image:{thumbnail:g.thumbnailURL,full:g.originalURL}}))}catch{u(!0)}finally{o(!1)}o(!1)};return d.jsxs("div",{className:Y("profile-image-change-figure",e),children:[d.jsx(sn,{className:"profile-image-change-picture",name:n,src:r,"data-testid":"profile-picture"}),l&&d.jsx("p",{className:"error text-small",children:d.jsx(ue.FormattedMessage,{id:"profile_image_change_error"})}),d.jsx("input",{id:"file",type:"file",accept:"image/*",ref:c,onChange:h,hidden:!0,"data-testid":"file-input"}),d.jsx(ke,{onClick:()=>c.current&&c.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${r?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:s,children:d.jsx(ue.FormattedMessage,{id:s?"profile_image_change_uploading_text":r?"profile_image_change_cta_with_picture":"profile_image_change_cta_without_picture"})})]})}const xf=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return d.jsx(nr,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}]},{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 wf=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[c,h]=C.useState([]),[p,m]=C.useState(!0),[g,f]=C.useState(u),{formatMessage:D}=ue.useIntl(),y=async _=>{_.preventDefault();try{await l(c),h([]),f("SUCCESS")}catch(E){f("ERROR"),o(E)}},x=_=>{_.preventDefault(),f("NOT_SUBMITTED"),m(!0),h([])},A=_=>{_.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?d.jsxs("div",{className:"invite-form-wrapper",children:[d.jsx("div",{className:"content centred",children:g==="SUCCESS"?d.jsx("h2",{className:"success-title",children:D({id:"inviteForm_success"})}):d.jsxs("h2",{className:"error-title",children:[" ",D({id:"inviteForm_error"})]})}),d.jsx(tn,{}),d.jsx("div",{className:"footer",children:g==="SUCCESS"?d.jsxs(d.Fragment,{children:[d.jsx(ke,{variant:"secondary",onClick:x,children:D({id:"inviteForm_ctaSendMoreInvites"})}),d.jsx(ke,{onClick:A,children:D({id:"inviteForm_ctaDone"})})]}):d.jsx(ke,{onClick:x,children:D({id:"inviteForm_ctaTryAgain"})})})]}):d.jsx("div",{className:"invite-form-wrapper",children:d.jsxs("form",{style:{backgroundColor:i},onSubmit:y,className:Y("invite-form gtm-trackable"),children:[d.jsxs("fieldset",{className:"content",children:[d.jsx("h2",{className:"title",style:{color:r},children:e}),d.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),d.jsx(Dh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:D({id:"inviteForm_email_placeholder"}),emails:c,onChange:_=>{h(_),m(!_.length)},autoFocus:!1,getLabel:(_,E,F)=>d.jsxs("div",{className:"email text-medium",children:[d.jsx("div",{"data-tag-item":!0,children:_}),d.jsx(ke,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{F(E),m(!c.length)},className:"remove-email-button",screenreaderText:D({id:"overlay_close"})})]},E)})]}),d.jsx(tn,{}),d.jsx("fieldset",{className:"footer",children:d.jsx(ke,{className:"sendEmailsButton",disabled:p,children:n})})]})})},ma=e=>e.map(t=>({condition:t})),yt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},LC=({functions:e,...t})=>{const{formatMessage:n}=ue.useIntl(),[r,a]=C.useState(null),[i,s]=C.useState(!1),[o,l]=C.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=m=>m[yt.NEW_PASSWORD]!==m[yt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=m=>!as(m[yt.NEW_PASSWORD]).isValid,h=[{"data-testid":yt.NEW_PASSWORD,id:yt.NEW_PASSWORD,type:"password",autoComplete:"password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:ma(["required",c]),functions:{onChange:m=>l(as(m).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":yt.CONFIRMED_PASSWORD,id:yt.CONFIRMED_PASSWORD,type:"password",autoComplete:"password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:ma(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":yt.CURRENT_PASSWORD,id:yt.CURRENT_PASSWORD,type:"password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:ma(["required"])}),i&&h.push({component:Qc,props:{matchingRules:o}});const p={id:yt.FORM_ID,fields:h,functions:{...e,onSuccess:async m=>(e.createPassword(m),e.onSuccess&&e.onSuccess(m)),onCatch:m=>a(m==null?void 0:m.statusCode),onFailure:(m,g)=>{(g.includes(yt.NEW_PASSWORD)||g.includes(yt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return d.jsxs(d.Fragment,{children:[d.jsx(nr,{...p}),r&&d.jsx(an,{variant:"error",text:r})]})};const Ef=({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=ue.useIntl(),u=C.useRef(null);Un(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const c=h=>{h.preventDefault(),h.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return d.jsx("form",{onSubmit:c,className:Y("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:d.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:d.jsxs("p",{children:[d.jsx(Me,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),d.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&c(h)}}),d.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:d.jsx(Me,{children:l.formatMessage({id:"search_clear"})})}),d.jsx("button",{className:"search",onClick:c,children:d.jsx(Me,{children:l.formatMessage({id:"search_cta"})})})]})})})},Wl=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const a=e.current.value.toString().toLowerCase().trim(),i={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},i);try{s=await t(a),s===void 0&&(s=i)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:a,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let c="";return o?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:a,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},zC=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"]}},qC=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=zC(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}])},WC=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=s,h=(m,g)=>{m.current&&s.validFields[g]!==m.current.validity.valid&&o([{type:`validFields.${g}`,value:m.current.validity.valid}])},p=[{id:"full_name",type:"text",inputRef:i.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>h(i.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:i.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),functions:{onBlur:()=>{Wl({ref:i.email,validateEmail:r,dispatch:o})},onChange:(m,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Vc,props:{email:c.email,type:c.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(p.push({id:"job_title",type:"text",inputRef:i.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>h(i.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:i.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{h(i.organisation,"organisation")}},validation:[{condition:"required"}],"data-testid":"signup-org-input"}),e.url&&p.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:m=>d.jsx("small",{children:m})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&p.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:m=>d.jsx("small",{className:"notes text-small",children:m})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),p.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:m=>d.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:m}),privacy:m=>d.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:m})}),shownValue:"accepted",functions:{onChange:m=>{if(!m)return;const g=[];["name","email"].forEach(f=>{s.validFields[f]!==i[f].current.validity.valid&&(g.push({type:`validFields.${f}`,value:i[f].current.validity.valid}),f==="email"&&Wl({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),p};const HC=({className:e=""})=>d.jsxs("div",{className:Y("success-message",e),"data-testid":"success-message",children:[d.jsx("p",{className:"success-title",children:d.jsx(ue.FormattedMessage,{id:"signup_success_title"})}),d.jsx(ue.FormattedMessage,{id:"signup_success_text",values:{p:t=>d.jsx("p",{children:t})}})]});const UC={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},VC=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>{}},shouldShow:a={},submitButton:i,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ue.useIntl(),{title:u=!0,expectation:c=!1,url:h=!0,logInButton:p=!0,successMessage:m=!0}=a,g={title:u,expectation:c,url:h,logInButton:p,successMessage:m},[f,D]=C.useReducer(Or,UC),{validFields:y,emailDetails:x,shouldManuallyApprove:A,shouldDisableButton:_,showSuccessMessage:E,showError:F}=f,[T,I]=Os.useCookies(["signup-this-session","functional-cookie-consent"]),R={form:C.createRef(),name:C.createRef(),email:C.createRef(),jobTitle:C.createRef(),organisation:C.createRef(),tc:C.createRef(),hiddenValidation:C.createRef()};C.useEffect(()=>{A===!0&&R.jobTitle.current&&R.jobTitle.current.focus()},[A]),C.useEffect(()=>{T["signup-this-session"]&&D([{type:"showSuccessMessage",value:!0}])},[T]),C.useEffect(()=>{E&&T["functional-cookie-consent"]&&I("signup-this-session","true",{path:"/",maxAge:3600})},[E]);const M=C.useMemo(()=>WC({placeholders:n,labels:t,shouldShow:g,functions:r,refs:R,state:f,dispatch:D,dataToSubmit:s,intl:l}),[s,r,l,R,g,f]),$=_?!0:A?!Object.values(y).every(w=>w===!0):!y.name||!y.email||["exists","pending","verify"].includes(x.boxType);return g.successMessage&&E?d.jsx(HC,{className:e}):d.jsxs("fieldset",{className:Y("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&d.jsx("p",{className:"signup-title",children:d.jsx(ue.FormattedMessage,{id:"signup_title"})}),F&&d.jsx(an,{variant:"error",text:l.formatMessage({id:"signup_error"})}),d.jsx(nr,{className:"signup-form",formRef:R.form,id:"sign-up-form",fields:M,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:$?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/user-onboarding/login","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:g.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await qC({refs:R,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:D,state:f})},onCatch:w=>{r.handleError(w),D([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),d.jsx("button",{className:"validation-button",ref:R.hiddenValidation})]})};var Ts={exports:{}},Jr={exports:{}},Oe={};/** @license React v16.13.1
132
+ `;default:return u}}function Pn(e,t){const n=e.trim(),r=n,a=`${t}${r}${zl(t)}`;if(r.length===e.length)return a;const i=t+r+zl(t);return e.replace(n,i)}const zl=e=>e.split("").reverse().join(""),vC=e=>e.map(t=>pf(t)).join("").trim();const bC=()=>{const e=Bn(),{dispatch:t,mentionPopover:n,id:r}=C.useContext(Vt),{show:a,selectedUser:i,possibleUsers:s}=n,o=Qd(e,"mention-popover",`toolbar-${r}`);return!a||!s.length?null:d.jsx(Ms,{children:d.jsx(Mc,{ref:o,className:"mention-popover",onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t([{type:"showMentionPopover",value:!1}]))},children:d.jsx("ul",{children:s.map(({userId:l,user:u},c)=>d.jsx(tr,{element:"li",className:Y({selected:c===i}),member:{id:l,...u,link:!1},functions:{onClick:h=>{h.preventDefault(),h.stopPropagation();const p={...n,selectedUser:c};t([{type:"mentionPopover",value:p}]),mf(e,p,t,r)}}},l))})})})},mo=({id:e,active:t,hasDivider:n=!1,callback:r,className:a="",children:i,...s})=>{const o=ue.useIntl(),l=Bn(),{id:u,tabbableOption:c,setFocus:h,openTooltip:p,dispatch:m}=C.useContext(Vt),g={};return e!==c&&(g.tabIndex=-1),d.jsxs("li",{id:`${u}-${e}`,className:Y(e,{"has-divider":n}),onMouseEnter:()=>{m([{type:"openTooltip",value:e}])},onMouseLeave:()=>{m([{type:"openTooltip",value:null}])},onFocus:()=>{m([{type:"openTooltip",value:e}])},onBlur:f=>{f.stopPropagation();const b=[{type:"openTooltip",value:null}];l.selection&&b.push({type:"lastAnchor",value:l.selection.anchor}),m(b)},contentEditable:!1,children:[d.jsxs("button",{...s,...g,className:Y(e,a,{active:t}),onClick:f=>{f.stopPropagation(),f.preventDefault()},onMouseDown:f=>{f.stopPropagation(),f.preventDefault(),r()},onKeyDown:f=>{var b,y,x,A;if(f.key!=="Tab")switch(f.key){case"Enter":f.stopPropagation(),f.preventDefault(),r();break;case"ArrowLeft":case"ArrowRight":f.stopPropagation(),f.preventDefault();const k=f.currentTarget.closest("li");let w=k==null?void 0:k.nextElementSibling;if(f.key==="ArrowLeft"){const z=k==null?void 0:k.previousElementSibling;z?w=z:w=(b=k==null?void 0:k.parentElement)==null?void 0:b.lastElementChild}else w||(w=(y=k==null?void 0:k.parentElement)==null?void 0:y.firstElementChild);const F=w==null?void 0:w.className.split(" ")[0];F&&(h(F),(x=w==null?void 0:w.querySelector("button"))==null||x.focus());break;default:const S=f.currentTarget.closest("fieldset");if(S){(A=S==null?void 0:S.previousElementSibling)==null||A.focus();break}}},children:[d.jsx(Me,{showOnFocus:!1,children:o.formatMessage({id:`richTextEditor_${e}`})}),d.jsx(En,{id:`tooltip-${e}`,styling:{extraPadding:!1,hasPointer:"bottom"},isOpen:p===e,"aria-hidden":!0,children:o.formatMessage({id:`richTextEditor_${e}`})})]}),i]})},ql=[Z.ol,Z.ul],gf=(e,t)=>{const{selection:n}=e;if(!n)return!1;const[r]=Array.from(v.nodes(e,{at:v.unhangRange(e,n),match:a=>{const i=a;return!v.isEditor(a)&&ce.isElement(a)&&i.type===t}}));return!!r},yC=e=>{const[t]=v.nodes(e,{match:n=>n.type===Z.blockquote});return!!t},vf=(e,t,n)=>{try{const r=yC(e),a=gf(e,t),i=ql.includes(t);Q.unwrapNodes(e,{match:l=>{const u=l;return!v.isEditor(u)&&ce.isElement(u)&&ql.includes(u.type)},split:!0});const o={type:a?Z.paragraph:i?Z.li:t};if(Q.setNodes(e,o),i)if(a){const{selection:l}=e;if(!l)return;const[u,c]=v.parent(e,l,{edge:"end"});Array.from(v.nodes(e,{at:c,match:p=>{const m=p;return!v.isEditor(p)&&ce.isElement(p)&&m.type===Z.li}})).forEach(([p,m])=>{oe.string(p).trim()===""&&Q.removeNodes(e,{at:m})})}else{if(r){const u={type:Z.blockquote,children:[]};Q.wrapNodes(e,u)}const l={type:t,children:[]};Q.wrapNodes(e,l)}}catch(r){const a=r.message;n(`Error toggling block: ${a}`)}},DC=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=C.useContext(Vt),a=Bn(),i=gf(a,e);return d.jsx(mo,{id:e,active:i,hasDivider:t,callback:()=>{vf(a,e,r),n(i?null:e)}})},Cr=e=>{const[t]=v.nodes(e,{match:n=>{const r=n;return!v.isEditor(n)&&ce.isElement(n)&&r.type===Z.link}});return!!t},CC=(e,t,n,r)=>{e.selection&&po(e,t,n,r)},xC=(e,t,n,r)=>{const{selection:a}=e;if(a&&V.isCollapsed(a)){const[s]=v.nodes(e,{match:o=>{const l=o;return!v.isEditor(o)&&ce.isElement(o)&&l.type===Z.link}});if(s){const[o,l]=s,u={link:t};Q.setNodes(e,u,{at:l}),ho(n)}}else po(e,t,n,r)},po=(e,t,n,r=a=>{console.error(a)})=>{try{Cr(e)&&bf(e);const{selection:a}=e,i=a&&V.isCollapsed(a),s={type:Z.link,link:t,children:i?[{text:t}]:[]};i?(Q.insertNodes(e,s),Q.move(e,{distance:1,unit:"offset"})):(Q.wrapNodes(e,s,{split:!0}),Q.collapse(e,{edge:"end"}),Q.insertNodes(e,{text:""}),Q.move(e,{distance:1,unit:"offset"})),ho(n)}catch(a){const i=a.message;r(`Error in wrapLink: ${i}`)}},bf=e=>{Q.unwrapNodes(e,{match:t=>{const n=t;return!v.isEditor(t)&&ce.isElement(t)&&n.type===Z.link}})};let Oi=null;const wC=()=>{const e=ue.useIntl(),t="richTextEditor_link_",{id:n,showLinkEditor:r,dispatch:a,reportError:i}=C.useContext(Vt),s=Bn(),o=Iy(s),l=(o==null?void 0:o.text)||hC(s),[u,c]=C.useState(Cr(s)),h=Qd(s,"link-editor",`${n}-link`),p=C.useRef(null);C.useEffect(()=>{var b;!u&&r&&((b=p.current)==null||b.focus())},[u]),C.useEffect(()=>{Oi&&clearTimeout(Oi),Oi=setTimeout(()=>{c(Cr(s))},500)},[s.selection]);const m=[],g=["open","edit","remove"].map(b=>{const y={variant:"tertiary",size:"small",children:e.formatMessage({id:`${t}${b}`},{link:o==null?void 0:o.pretty})};switch(m.push({className:b}),b){case"open":y.href=(o==null?void 0:o.full)||"",y.onClick=x=>{x.preventDefault(),x.stopPropagation(),window.open((o==null?void 0:o.full)||"","_blank"),a([{type:"showLinkEditor",value:!1}])},y.children=d.jsxs(d.Fragment,{children:[y.children,d.jsx(Me,{children:e.formatMessage({id:`${t}${b}_text`})})]});break;case"edit":y.onClick=()=>{c(!1)};break;case"remove":y.onClick=()=>{const x=[{type:"showLinkEditor",value:!1}];Cr(s)&&(bf(s),x.push({type:"lastAnchor",value:null})),a(x)};break}return y}),f=[{id:"url",type:"url",inputRef:p,label:e.formatMessage({id:`${t}url`}),placeholder:e.formatMessage({id:`${t}placeholder`}),value:(o==null?void 0:o.full)||"",validation:[{condition:"required",error:e.formatMessage({id:`${t}error_required`})},{condition:"valid-url"}],submitOnEnter:!0,autoFocus:!0}];return l&&f.unshift({component:()=>d.jsxs("p",{children:[d.jsx("strong",{"aria-label":e.formatMessage({id:`${t}text_aria`}),children:e.formatMessage({id:`${t}text`})})," ",l]})}),d.jsx(Ms,{children:d.jsx(En,{ref:h,className:"link-editor",isOpen:r,styling:{extraPadding:!1,hasForm:!u},functions:{onBlur:()=>{a([{type:"showLinkEditor",value:!1}])}},callbacks:{onOpen:()=>{setTimeout(()=>{var b;return(b=p.current)==null?void 0:b.focus()})}},children:u?d.jsx(kn,{wrappers:m,buttons:g}):d.jsx(nr,{element:"fieldset",id:`${n}-link-editor`,className:Y({"show-labels":l}),meta:{shouldReset:!0,showRequiredLabels:!1},functions:{onSuccess:async b=>{setTimeout(()=>{const y=[{type:"showLinkEditor",value:!1}];if(b.url){const{full:x}=Rc(b.url);o!=null&&o.full?xC(s,x,n,i):CC(s,x,n,i),y.push({type:"lastAnchor",value:null})}a(y)})}},fields:f,button:{text:e.formatMessage({id:`${t}button`}),variant:"tertiary",size:"small"}})})})},EC=()=>{const e=Bn(),{setFocus:t,dispatch:n}=C.useContext(Vt),[r,a]=C.useState(!1);return C.useEffect(()=>{a(Cr(e))},[e.selection]),d.jsx(mo,{id:"link",active:r,hasDivider:!0,callback:()=>{n([{type:"showLinkEditor",value:!0}]),t(r?null:"link"),a(!0)}})},kC=e=>[Z.bold,Z.italic,Z.strikethrough].includes(e),yf=(e,t)=>{const n=v.marks(e);return n?n[t]===!0:!1},Df=(e,t,n)=>{try{yf(e,t)?v.removeMark(e,t):v.addMark(e,t,!0)}catch(r){const a=r.message;n(`Error toggling mark: ${a}`)}},_C=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=C.useContext(Vt),a=Bn(),i=yf(a,e);return d.jsx(mo,{id:e,active:i,hasDivider:t,callback:()=>{Df(a,e,r),n(i?null:e)}})},Ba=[Z.bold,Z.italic,Z.strikethrough],BC=[Z.ol,Z.ul,Z.blockquote];const AC=({...e})=>{const t=ue.useIntl(),{id:n}=C.useContext(Vt);return d.jsxs(d.Fragment,{children:[d.jsxs("fieldset",{id:`toolbar-${n}`,className:"toolbar",...e,children:[d.jsx(Me,{element:"legend",showOnFocus:!1,children:t.formatMessage({id:"richTextEditor_toolbar"})}),d.jsxs("ul",{children:[Ba.map((r,a)=>d.jsx(_C,{format:r,hasDivider:a===Ba.length-1},r)),d.jsx(EC,{}),BC.map((r,a)=>d.jsx(DC,{format:r,hasDivider:a===1},r))]})]}),d.jsx(wC,{})]})};var FC=OC,TC=/^(?:\w+:)?\/\/(\S+)$/,SC=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,jC=/^[^\s\.]+\.\S{2,}$/;function OC(e){if(typeof e!="string")return!1;var t=e.match(TC);if(!t)return!1;var n=t[1];return n?!!(SC.test(n)||jC.test(n)):!1}const PC=wn(FC),NC=(e,t,n)=>{const{insertText:r,isInline:a}=e;try{e.isInline=i=>{const s=i;return[Z.link].includes(s.type)||a(i)},e.insertText=i=>{i&&PC(i)?po(e,i,t):r(i)}}catch(i){const s=i.message;n(`Error in withInlines: ${s}`)}return e},RC=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:a}=e;try{e.isInline=i=>i.type===Z.mention?!0:n(i),e.isVoid=i=>i.type===Z.mention?!0:r(i),e.markableVoid=i=>i.type===Z.mention||a(i)}catch(i){const s=i.message;t(`Error in withMentions: ${s}`)}return e},MC=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,a])=>{if(r.type===Z.link&&oe.string(r).trim()===""){Q.removeNodes(e,{at:a});return}n([r,a])}}catch(r){const a=r.message;t(`Error in withoutEmptyLinks: ${a}`)}return e};const Cf=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,functions:a,autoFocus:i=!0,data:s,...o})=>{const l=ue.useIntl(),u=Oh(),{listMembers:c,onChange:h=()=>{},reportError:p=R=>{console.error(R)}}=a||{},m=[{type:Z.paragraph,children:[{text:""}]}],g={editorKey:null,originalValue:t||"",initialValue:t?null:m,tabbableOption:Ba[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1},[f,b]=C.useReducer(Pr,g),{editorKey:y,originalValue:x,initialValue:A,stringValue:k,lastAnchor:w,lastKey:F,hasInteracted:S,hasLoaded:z,mentionPopover:N}=f,$=R=>{const W=R||Ba[0];R&&b([{type:"tabbableOption",value:W}])},I=`rte-${e}`,E=C.useCallback(R=>d.jsx(Ry,{...R}),[]),B=C.useCallback(R=>d.jsx(My,{...R}),[]),T=C.useMemo(()=>NC(RC(MC(wv(Py(Cv())),p),p),I,p),[]);C.useEffect(()=>{if(!t)return;Er.lastIndex=0;const R=t.match(Er);!R||R.length>1||R[0].length!==t.length||S||b([{type:"originalValue",value:t}])},[t]),C.useEffect(()=>{x&&(async()=>{let W=pn(x);W.includes("<")&&(W=new Da().turndown(W)),s&&s.mentions&&(W=await Nc({text:W,template:`[${ws}{{name}}]({{id}})`,mentions:s.mentions,listMembers:c||(()=>Promise.resolve([]))})),fC(W,X=>{b([{type:"initialValue",value:X},{type:"editorKey",value:x.toString()}]),setTimeout(()=>{b([{type:"stringValue",value:Il(T)}])},150)})})()},[x]),C.useEffect(()=>{if(T.children.length>0&&!z){if(b([{type:"hasLoaded",value:!0}]),!i)return;const R=v.end(T,[]);Q.select(T,R),J.focus(T)}},[T.children.length,A]),C.useEffect(()=>{t!==""||!T||vc(x,t)&&!S||(v.withoutNormalizing(T,()=>{Q.delete(T,{at:{anchor:v.start(T,[]),focus:v.end(T,[])}}),Q.deselect(T),T.children.length!==0&&Q.unwrapNodes(T,{at:[0]}),Q.insertNodes(T,m,{at:[0]})}),b([{type:"initialValue",value:m},{type:"lastAnchor",value:null}]))},[t]);const M=xc(()=>{pC(T,N.show,c,b)},100);return A?d.jsx("div",{id:I,className:"rich-text-editor",children:d.jsxs(Vt.Provider,{value:{...f,id:I,setFocus:$,dispatch:b,reportError:p},children:[d.jsxs(jy,{editor:T,initialValue:A,onChange:R=>{if(T.operations.some(X=>X.type!=="set_selection")){const X=vC(R);h(X),b([{type:"stringValue",value:Il(T)}]),S||b([{type:"hasInteracted",value:!0}]),M(),u&&console.log({serialized:X,json:R})}},...o,children:[d.jsx(wy,{className:"input",renderElement:E,renderLeaf:B,placeholder:n||l.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:i,tabIndex:0,onKeyDown:R=>{if(R.key==="Enter"){N.show&&(R.preventDefault(),R.stopPropagation(),mf(T,N,b,I));const{selection:W}=T;if(W){const X=V.isCollapsed(W),[G,D]=v.node(T,W,{depth:1});let H=G,te=H.type;const _=H.children[0];if(_&&[Z.ol,Z.ul].includes(_.type)&&(H=_,te=_.type),H&&ce.isElement(H)&&te!==Z.paragraph){if(te===Z.blockquote&&!R.shiftKey){R.stopPropagation(),R.preventDefault(),Q.insertNodes(T,m);return}if(X){const[j]=v.parent(T,W,{edge:"end"}),L=j.type;if(F==="Enter"&&L===Z.li&&[Z.ul,Z.ol].includes(te)){R.stopPropagation(),R.preventDefault(),Q.insertNodes(T,m,{at:P.next(D)}),Q.select(T,v.end(T,P.next(D)));return}}}}}else if(R.key==="Escape"){if(N.show){R.preventDefault(),R.stopPropagation(),b([{type:"mentionPopover",value:{...N,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(R.key)&&N.show){R.preventDefault(),R.stopPropagation();const{selectedUser:W,possibleUsers:X}=N;let G=R.key==="ArrowUp"?W-1:W+1;G<0&&(G=X.length-1),G>=X.length&&(G=0),b([{type:"mentionPopover",value:{...N,selectedUser:G}}])}b([{type:"lastKey",value:R.key}]),mC(R,T,b,p)},onBlur:()=>{T.selection&&b([{type:"lastAnchor",value:T.selection.anchor}])},onFocus:()=>{if(w){if(!P.isPath(w.path)||!oe.has(T,w.path))return;const R=oe.get(T,w.path);let W=0;if(de.isText(R)?W=R.text.length:R.children&&(W=R.children.length),w.offset>W)return;try{Q.select(T,{anchor:w,focus:w})}catch(X){const G=X.message;p(`Error focusing editor: ${G}`)}}}}),d.jsx(AC,{}),c?d.jsx(bC,{}):null]},y),d.jsx(qs,{limit:r,valueLength:Wa(k)})]})}):null};const IC=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:a=()=>{}},isDisabled:i=!1,className:s=""})=>{const[o,l]=C.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);C.useEffect(()=>{r&&l(r)},[r]);const u=c=>{i||(l(c),a(c))};return d.jsxs("div",{className:Y("toggle",s),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[d.jsx("p",{children:t}),d.jsx("ul",{className:Y("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(c=>{const h=`${e}-${c.value}`;return d.jsxs("li",{className:"hidden",children:[d.jsx("input",{type:"radio",id:h,name:e,value:c.value,checked:o===c.value,onChange:()=>u(c.value),disabled:i}),d.jsx("label",{htmlFor:h,children:c.label})]},h)})})]})};function $C({className:e="",userId:t,userName:n,src:r,setUserImage:a,uploadImage:i}){const[s,o]=C.useState(!1),[l,u]=C.useState(!1),c=C.useRef(null),h=async p=>{o(!0),u(!1);try{const m=p.target.files&&p.target.files[0];if(!m||!t)throw o(!1),new Error("Image file or userID is missing");const g=await i({fileObject:m,userId:t});a(f=>({...f,image:{thumbnail:g.thumbnailURL,full:g.originalURL}}))}catch{u(!0)}finally{o(!1)}o(!1)};return d.jsxs("div",{className:Y("profile-image-change-figure",e),children:[d.jsx(sn,{className:"profile-image-change-picture",name:n,src:r,"data-testid":"profile-picture"}),l&&d.jsx("p",{className:"error text-small",children:d.jsx(ue.FormattedMessage,{id:"profile_image_change_error"})}),d.jsx("input",{id:"file",type:"file",accept:"image/*",ref:c,onChange:h,hidden:!0,"data-testid":"file-input"}),d.jsx(_e,{onClick:()=>c.current&&c.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${r?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:s,children:d.jsx(ue.FormattedMessage,{id:s?"profile_image_change_uploading_text":r?"profile_image_change_cta_with_picture":"profile_image_change_cta_without_picture"})})]})}const xf=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return d.jsx(nr,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}]},{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 wf=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[c,h]=C.useState([]),[p,m]=C.useState(!0),[g,f]=C.useState(u),{formatMessage:b}=ue.useIntl(),y=async k=>{k.preventDefault();try{await l(c),h([]),f("SUCCESS")}catch(w){f("ERROR"),o(w)}},x=k=>{k.preventDefault(),f("NOT_SUBMITTED"),m(!0),h([])},A=k=>{k.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?d.jsxs("div",{className:"invite-form-wrapper",children:[d.jsx("div",{className:"content centred",children:g==="SUCCESS"?d.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):d.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),d.jsx(tn,{}),d.jsx("div",{className:"footer",children:g==="SUCCESS"?d.jsxs(d.Fragment,{children:[d.jsx(_e,{variant:"secondary",onClick:x,children:b({id:"inviteForm_ctaSendMoreInvites"})}),d.jsx(_e,{onClick:A,children:b({id:"inviteForm_ctaDone"})})]}):d.jsx(_e,{onClick:x,children:b({id:"inviteForm_ctaTryAgain"})})})]}):d.jsx("div",{className:"invite-form-wrapper",children:d.jsxs("form",{style:{backgroundColor:i},onSubmit:y,className:Y("invite-form gtm-trackable"),children:[d.jsxs("fieldset",{className:"content",children:[d.jsx("h2",{className:"title",style:{color:r},children:e}),d.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),d.jsx(Dh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:c,onChange:k=>{h(k),m(!k.length)},autoFocus:!1,getLabel:(k,w,F)=>d.jsxs("div",{className:"email text-medium",children:[d.jsx("div",{"data-tag-item":!0,children:k}),d.jsx(_e,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{F(w),m(!c.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},w)})]}),d.jsx(tn,{}),d.jsx("fieldset",{className:"footer",children:d.jsx(_e,{className:"sendEmailsButton",disabled:p,children:n})})]})})},pa=e=>e.map(t=>({condition:t})),yt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},LC=({functions:e,...t})=>{const{formatMessage:n}=ue.useIntl(),[r,a]=C.useState(null),[i,s]=C.useState(!1),[o,l]=C.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=m=>m[yt.NEW_PASSWORD]!==m[yt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=m=>!as(m[yt.NEW_PASSWORD]).isValid,h=[{"data-testid":yt.NEW_PASSWORD,id:yt.NEW_PASSWORD,type:"password",autoComplete:"password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:pa(["required",c]),functions:{onChange:m=>l(as(m).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":yt.CONFIRMED_PASSWORD,id:yt.CONFIRMED_PASSWORD,type:"password",autoComplete:"password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:pa(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":yt.CURRENT_PASSWORD,id:yt.CURRENT_PASSWORD,type:"password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:pa(["required"])}),i&&h.push({component:Qc,props:{matchingRules:o}});const p={id:yt.FORM_ID,fields:h,functions:{...e,onSuccess:async m=>(e.createPassword(m),e.onSuccess&&e.onSuccess(m)),onCatch:m=>a(m==null?void 0:m.statusCode),onFailure:(m,g)=>{(g.includes(yt.NEW_PASSWORD)||g.includes(yt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return d.jsxs(d.Fragment,{children:[d.jsx(nr,{...p}),r&&d.jsx(an,{variant:"error",text:r})]})};const Ef=({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=ue.useIntl(),u=C.useRef(null);Un(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const c=h=>{h.preventDefault(),h.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return d.jsx("form",{onSubmit:c,className:Y("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:d.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:d.jsxs("p",{children:[d.jsx(Me,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),d.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&c(h)}}),d.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:d.jsx(Me,{children:l.formatMessage({id:"search_clear"})})}),d.jsx("button",{className:"search",onClick:c,children:d.jsx(Me,{children:l.formatMessage({id:"search_cta"})})})]})})})},Wl=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const a=e.current.value.toString().toLowerCase().trim(),i={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},i);try{s=await t(a),s===void 0&&(s=i)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:a,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let c="";return o?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:a,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},zC=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"]}},qC=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=zC(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}])},WC=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=s,h=(m,g)=>{m.current&&s.validFields[g]!==m.current.validity.valid&&o([{type:`validFields.${g}`,value:m.current.validity.valid}])},p=[{id:"full_name",type:"text",inputRef:i.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>h(i.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:i.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),functions:{onBlur:()=>{Wl({ref:i.email,validateEmail:r,dispatch:o})},onChange:(m,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Vc,props:{email:c.email,type:c.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(p.push({id:"job_title",type:"text",inputRef:i.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>h(i.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:i.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{h(i.organisation,"organisation")}},validation:[{condition:"required"}],"data-testid":"signup-org-input"}),e.url&&p.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:m=>d.jsx("small",{children:m})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&p.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:m=>d.jsx("small",{className:"notes text-small",children:m})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),p.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:m=>d.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:m}),privacy:m=>d.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:m})}),shownValue:"accepted",functions:{onChange:m=>{if(!m)return;const g=[];["name","email"].forEach(f=>{s.validFields[f]!==i[f].current.validity.valid&&(g.push({type:`validFields.${f}`,value:i[f].current.validity.valid}),f==="email"&&Wl({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),p};const HC=({className:e=""})=>d.jsxs("div",{className:Y("success-message",e),"data-testid":"success-message",children:[d.jsx("p",{className:"success-title",children:d.jsx(ue.FormattedMessage,{id:"signup_success_title"})}),d.jsx(ue.FormattedMessage,{id:"signup_success_text",values:{p:t=>d.jsx("p",{children:t})}})]});const UC={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},VC=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>{}},shouldShow:a={},submitButton:i,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ue.useIntl(),{title:u=!0,expectation:c=!1,url:h=!0,logInButton:p=!0,successMessage:m=!0}=a,g={title:u,expectation:c,url:h,logInButton:p,successMessage:m},[f,b]=C.useReducer(Pr,UC),{validFields:y,emailDetails:x,shouldManuallyApprove:A,shouldDisableButton:k,showSuccessMessage:w,showError:F}=f,[S,z]=Os.useCookies(["signup-this-session","functional-cookie-consent"]),N={form:C.createRef(),name:C.createRef(),email:C.createRef(),jobTitle:C.createRef(),organisation:C.createRef(),tc:C.createRef(),hiddenValidation:C.createRef()};C.useEffect(()=>{A===!0&&N.jobTitle.current&&N.jobTitle.current.focus()},[A]),C.useEffect(()=>{S["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[S]),C.useEffect(()=>{w&&S["functional-cookie-consent"]&&z("signup-this-session","true",{path:"/",maxAge:3600})},[w]);const $=C.useMemo(()=>WC({placeholders:n,labels:t,shouldShow:g,functions:r,refs:N,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,N,g,f]),I=k?!0:A?!Object.values(y).every(E=>E===!0):!y.name||!y.email||["exists","pending","verify"].includes(x.boxType);return g.successMessage&&w?d.jsx(HC,{className:e}):d.jsxs("fieldset",{className:Y("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&d.jsx("p",{className:"signup-title",children:d.jsx(ue.FormattedMessage,{id:"signup_title"})}),F&&d.jsx(an,{variant:"error",text:l.formatMessage({id:"signup_error"})}),d.jsx(nr,{className:"signup-form",formRef:N.form,id:"sign-up-form",fields:$,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:I?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/user-onboarding/login","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:g.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await qC({refs:N,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:E=>{r.handleError(E),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),d.jsx("button",{className:"validation-button",ref:N.hiddenValidation})]})};var Ts={exports:{}},Xr={exports:{}},Oe={};/** @license React v16.13.1
133
133
  * react-is.production.min.js
134
134
  *
135
135
  * Copyright (c) Facebook, Inc. and its affiliates.
136
136
  *
137
137
  * This source code is licensed under the MIT license found in the
138
138
  * LICENSE file in the root directory of this source tree.
139
- */var Hl;function KC(){if(Hl)return Oe;Hl=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,D=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function A(E){if(typeof E=="object"&&E!==null){var F=E.$$typeof;switch(F){case t:switch(E=E.type,E){case l:case u:case r:case i:case a:case h:return E;default:switch(E=E&&E.$$typeof,E){case o:case c:case g:case m:case s:return E;default:return F}}case n:return F}}}function _(E){return A(E)===u}return Oe.AsyncMode=l,Oe.ConcurrentMode=u,Oe.ContextConsumer=o,Oe.ContextProvider=s,Oe.Element=t,Oe.ForwardRef=c,Oe.Fragment=r,Oe.Lazy=g,Oe.Memo=m,Oe.Portal=n,Oe.Profiler=i,Oe.StrictMode=a,Oe.Suspense=h,Oe.isAsyncMode=function(E){return _(E)||A(E)===l},Oe.isConcurrentMode=_,Oe.isContextConsumer=function(E){return A(E)===o},Oe.isContextProvider=function(E){return A(E)===s},Oe.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},Oe.isForwardRef=function(E){return A(E)===c},Oe.isFragment=function(E){return A(E)===r},Oe.isLazy=function(E){return A(E)===g},Oe.isMemo=function(E){return A(E)===m},Oe.isPortal=function(E){return A(E)===n},Oe.isProfiler=function(E){return A(E)===i},Oe.isStrictMode=function(E){return A(E)===a},Oe.isSuspense=function(E){return A(E)===h},Oe.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===u||E===i||E===a||E===h||E===p||typeof E=="object"&&E!==null&&(E.$$typeof===g||E.$$typeof===m||E.$$typeof===s||E.$$typeof===o||E.$$typeof===c||E.$$typeof===D||E.$$typeof===y||E.$$typeof===x||E.$$typeof===f)},Oe.typeOf=A,Oe}var Pe={};/** @license React v16.13.1
139
+ */var Hl;function KC(){if(Hl)return Oe;Hl=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function A(w){if(typeof w=="object"&&w!==null){var F=w.$$typeof;switch(F){case t:switch(w=w.type,w){case l:case u:case r:case i:case a:case h:return w;default:switch(w=w&&w.$$typeof,w){case o:case c:case g:case m:case s:return w;default:return F}}case n:return F}}}function k(w){return A(w)===u}return Oe.AsyncMode=l,Oe.ConcurrentMode=u,Oe.ContextConsumer=o,Oe.ContextProvider=s,Oe.Element=t,Oe.ForwardRef=c,Oe.Fragment=r,Oe.Lazy=g,Oe.Memo=m,Oe.Portal=n,Oe.Profiler=i,Oe.StrictMode=a,Oe.Suspense=h,Oe.isAsyncMode=function(w){return k(w)||A(w)===l},Oe.isConcurrentMode=k,Oe.isContextConsumer=function(w){return A(w)===o},Oe.isContextProvider=function(w){return A(w)===s},Oe.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Oe.isForwardRef=function(w){return A(w)===c},Oe.isFragment=function(w){return A(w)===r},Oe.isLazy=function(w){return A(w)===g},Oe.isMemo=function(w){return A(w)===m},Oe.isPortal=function(w){return A(w)===n},Oe.isProfiler=function(w){return A(w)===i},Oe.isStrictMode=function(w){return A(w)===a},Oe.isSuspense=function(w){return A(w)===h},Oe.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===u||w===i||w===a||w===h||w===p||typeof w=="object"&&w!==null&&(w.$$typeof===g||w.$$typeof===m||w.$$typeof===s||w.$$typeof===o||w.$$typeof===c||w.$$typeof===b||w.$$typeof===y||w.$$typeof===x||w.$$typeof===f)},Oe.typeOf=A,Oe}var Pe={};/** @license React v16.13.1
140
140
  * react-is.development.js
141
141
  *
142
142
  * Copyright (c) Facebook, Inc. and its affiliates.
143
143
  *
144
144
  * This source code is licensed under the MIT license found in the
145
145
  * LICENSE file in the root directory of this source tree.
146
- */var Ul;function ZC(){return Ul||(Ul=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,D=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function A(X){return typeof X=="string"||typeof X=="function"||X===r||X===u||X===i||X===a||X===h||X===p||typeof X=="object"&&X!==null&&(X.$$typeof===g||X.$$typeof===m||X.$$typeof===s||X.$$typeof===o||X.$$typeof===c||X.$$typeof===D||X.$$typeof===y||X.$$typeof===x||X.$$typeof===f)}function _(X){if(typeof X=="object"&&X!==null){var be=X.$$typeof;switch(be){case t:var he=X.type;switch(he){case l:case u:case r:case i:case a:case h:return he;default:var xe=he&&he.$$typeof;switch(xe){case o:case c:case g:case m:case s:return xe;default:return be}}case n:return be}}}var E=l,F=u,T=o,I=s,R=t,M=c,$=r,w=g,k=m,O=n,j=i,z=a,H=h,te=!1;function J(X){return te||(te=!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.")),v(X)||_(X)===l}function v(X){return _(X)===u}function W(X){return _(X)===o}function ee(X){return _(X)===s}function B(X){return typeof X=="object"&&X!==null&&X.$$typeof===t}function S(X){return _(X)===c}function q(X){return _(X)===r}function L(X){return _(X)===g}function U(X){return _(X)===m}function ne(X){return _(X)===n}function re(X){return _(X)===i}function ae(X){return _(X)===a}function fe(X){return _(X)===h}Pe.AsyncMode=E,Pe.ConcurrentMode=F,Pe.ContextConsumer=T,Pe.ContextProvider=I,Pe.Element=R,Pe.ForwardRef=M,Pe.Fragment=$,Pe.Lazy=w,Pe.Memo=k,Pe.Portal=O,Pe.Profiler=j,Pe.StrictMode=z,Pe.Suspense=H,Pe.isAsyncMode=J,Pe.isConcurrentMode=v,Pe.isContextConsumer=W,Pe.isContextProvider=ee,Pe.isElement=B,Pe.isForwardRef=S,Pe.isFragment=q,Pe.isLazy=L,Pe.isMemo=U,Pe.isPortal=ne,Pe.isProfiler=re,Pe.isStrictMode=ae,Pe.isSuspense=fe,Pe.isValidElementType=A,Pe.typeOf=_}()),Pe}var Vl;function kf(){return Vl||(Vl=1,process.env.NODE_ENV==="production"?Jr.exports=KC():Jr.exports=ZC()),Jr.exports}/*
146
+ */var Ul;function ZC(){return Ul||(Ul=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function A(ee){return typeof ee=="string"||typeof ee=="function"||ee===r||ee===u||ee===i||ee===a||ee===h||ee===p||typeof ee=="object"&&ee!==null&&(ee.$$typeof===g||ee.$$typeof===m||ee.$$typeof===s||ee.$$typeof===o||ee.$$typeof===c||ee.$$typeof===b||ee.$$typeof===y||ee.$$typeof===x||ee.$$typeof===f)}function k(ee){if(typeof ee=="object"&&ee!==null){var be=ee.$$typeof;switch(be){case t:var me=ee.type;switch(me){case l:case u:case r:case i:case a:case h:return me;default:var xe=me&&me.$$typeof;switch(xe){case o:case c:case g:case m:case s:return xe;default:return be}}case n:return be}}}var w=l,F=u,S=o,z=s,N=t,$=c,I=r,E=g,B=m,T=n,M=i,R=a,W=h,X=!1;function G(ee){return X||(X=!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)||k(ee)===l}function D(ee){return k(ee)===u}function H(ee){return k(ee)===o}function te(ee){return k(ee)===s}function _(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===t}function j(ee){return k(ee)===c}function q(ee){return k(ee)===r}function L(ee){return k(ee)===g}function U(ee){return k(ee)===m}function ne(ee){return k(ee)===n}function re(ee){return k(ee)===i}function ae(ee){return k(ee)===a}function fe(ee){return k(ee)===h}Pe.AsyncMode=w,Pe.ConcurrentMode=F,Pe.ContextConsumer=S,Pe.ContextProvider=z,Pe.Element=N,Pe.ForwardRef=$,Pe.Fragment=I,Pe.Lazy=E,Pe.Memo=B,Pe.Portal=T,Pe.Profiler=M,Pe.StrictMode=R,Pe.Suspense=W,Pe.isAsyncMode=G,Pe.isConcurrentMode=D,Pe.isContextConsumer=H,Pe.isContextProvider=te,Pe.isElement=_,Pe.isForwardRef=j,Pe.isFragment=q,Pe.isLazy=L,Pe.isMemo=U,Pe.isPortal=ne,Pe.isProfiler=re,Pe.isStrictMode=ae,Pe.isSuspense=fe,Pe.isValidElementType=A,Pe.typeOf=k}()),Pe}var Vl;function kf(){return Vl||(Vl=1,process.env.NODE_ENV==="production"?Xr.exports=KC():Xr.exports=ZC()),Xr.exports}/*
147
147
  object-assign
148
148
  (c) Sindre Sorhus
149
149
  @license MIT
150
- */var Oi,Kl;function YC(){if(Kl)return Oi;Kl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function a(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(s).map(function(c){return s[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Oi=a()?Object.assign:function(i,s){for(var o,l=r(i),u,c=1;c<arguments.length;c++){o=Object(arguments[c]);for(var h in o)t.call(o,h)&&(l[h]=o[h]);if(e){u=e(o);for(var p=0;p<u.length;p++)n.call(o,u[p])&&(l[u[p]]=o[u[p]])}}return l},Oi}var Pi,Zl;function go(){if(Zl)return Pi;Zl=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Pi=e,Pi}var Ni,Yl;function _f(){return Yl||(Yl=1,Ni=Function.call.bind(Object.prototype.hasOwnProperty)),Ni}var Ri,Gl;function GC(){if(Gl)return Ri;Gl=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=go(),n={},r=_f();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function a(i,s,o,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var h;try{if(typeof i[c]!="function"){var p=Error((l||"React class")+": "+o+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=i[c](s,c,l,o,null,t)}catch(g){h=g}if(h&&!(h instanceof Error)&&e((l||"React class")+": type specification of "+o+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var m=u?u():"";e("Failed "+o+" type: "+h.message+(m??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ri=a,Ri}var Mi,Ql;function QC(){if(Ql)return Mi;Ql=1;var e=kf(),t=YC(),n=go(),r=_f(),a=GC(),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 Mi=function(o,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function h(v){var W=v&&(u&&v[u]||v[c]);if(typeof W=="function")return W}var p="<<anonymous>>",m={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:x(),arrayOf:A,element:_(),elementType:E(),instanceOf:F,node:M(),objectOf:I,oneOf:T,oneOfType:R,shape:w,exact:k};function g(v,W){return v===W?v!==0||1/v===1/W:v!==v&&W!==W}function f(v,W){this.message=v,this.data=W&&typeof W=="object"?W:{},this.stack=""}f.prototype=Error.prototype;function D(v){if(process.env.NODE_ENV!=="production")var W={},ee=0;function B(q,L,U,ne,re,ae,fe){if(ne=ne||p,ae=ae||U,fe!==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 be=ne+":"+U;!W[be]&&ee<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ae+"` prop on `"+ne+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),W[be]=!0,ee++)}}return L[U]==null?q?L[U]===null?new f("The "+re+" `"+ae+"` is marked as required "+("in `"+ne+"`, but its value is `null`.")):new f("The "+re+" `"+ae+"` is marked as required in "+("`"+ne+"`, but its value is `undefined`.")):null:v(L,U,ne,re,ae)}var S=B.bind(null,!1);return S.isRequired=B.bind(null,!0),S}function y(v){function W(ee,B,S,q,L,U){var ne=ee[B],re=z(ne);if(re!==v){var ae=H(ne);return new f("Invalid "+q+" `"+L+"` of type "+("`"+ae+"` supplied to `"+S+"`, expected ")+("`"+v+"`."),{expectedType:v})}return null}return D(W)}function x(){return D(s)}function A(v){function W(ee,B,S,q,L){if(typeof v!="function")return new f("Property `"+L+"` of component `"+S+"` has invalid PropType notation inside arrayOf.");var U=ee[B];if(!Array.isArray(U)){var ne=z(U);return new f("Invalid "+q+" `"+L+"` of type "+("`"+ne+"` supplied to `"+S+"`, expected an array."))}for(var re=0;re<U.length;re++){var ae=v(U,re,S,q,L+"["+re+"]",n);if(ae instanceof Error)return ae}return null}return D(W)}function _(){function v(W,ee,B,S,q){var L=W[ee];if(!o(L)){var U=z(L);return new f("Invalid "+S+" `"+q+"` of type "+("`"+U+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return D(v)}function E(){function v(W,ee,B,S,q){var L=W[ee];if(!e.isValidElementType(L)){var U=z(L);return new f("Invalid "+S+" `"+q+"` of type "+("`"+U+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return D(v)}function F(v){function W(ee,B,S,q,L){if(!(ee[B]instanceof v)){var U=v.name||p,ne=J(ee[B]);return new f("Invalid "+q+" `"+L+"` of type "+("`"+ne+"` supplied to `"+S+"`, expected ")+("instance of `"+U+"`."))}return null}return D(W)}function T(v){if(!Array.isArray(v))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 W(ee,B,S,q,L){for(var U=ee[B],ne=0;ne<v.length;ne++)if(g(U,v[ne]))return null;var re=JSON.stringify(v,function(fe,X){var be=H(X);return be==="symbol"?String(X):X});return new f("Invalid "+q+" `"+L+"` of value `"+String(U)+"` "+("supplied to `"+S+"`, expected one of "+re+"."))}return D(W)}function I(v){function W(ee,B,S,q,L){if(typeof v!="function")return new f("Property `"+L+"` of component `"+S+"` has invalid PropType notation inside objectOf.");var U=ee[B],ne=z(U);if(ne!=="object")return new f("Invalid "+q+" `"+L+"` of type "+("`"+ne+"` supplied to `"+S+"`, expected an object."));for(var re in U)if(r(U,re)){var ae=v(U,re,S,q,L+"."+re,n);if(ae instanceof Error)return ae}return null}return D(W)}function R(v){if(!Array.isArray(v))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var W=0;W<v.length;W++){var ee=v[W];if(typeof ee!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+te(ee)+" at index "+W+"."),s}function B(S,q,L,U,ne){for(var re=[],ae=0;ae<v.length;ae++){var fe=v[ae],X=fe(S,q,L,U,ne,n);if(X==null)return null;X.data&&r(X.data,"expectedType")&&re.push(X.data.expectedType)}var be=re.length>0?", expected one of type ["+re.join(", ")+"]":"";return new f("Invalid "+U+" `"+ne+"` supplied to "+("`"+L+"`"+be+"."))}return D(B)}function M(){function v(W,ee,B,S,q){return O(W[ee])?null:new f("Invalid "+S+" `"+q+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return D(v)}function $(v,W,ee,B,S){return new f((v||"React class")+": "+W+" type `"+ee+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+S+"`.")}function w(v){function W(ee,B,S,q,L){var U=ee[B],ne=z(U);if(ne!=="object")return new f("Invalid "+q+" `"+L+"` of type `"+ne+"` "+("supplied to `"+S+"`, expected `object`."));for(var re in v){var ae=v[re];if(typeof ae!="function")return $(S,q,L,re,H(ae));var fe=ae(U,re,S,q,L+"."+re,n);if(fe)return fe}return null}return D(W)}function k(v){function W(ee,B,S,q,L){var U=ee[B],ne=z(U);if(ne!=="object")return new f("Invalid "+q+" `"+L+"` of type `"+ne+"` "+("supplied to `"+S+"`, expected `object`."));var re=t({},ee[B],v);for(var ae in re){var fe=v[ae];if(r(v,ae)&&typeof fe!="function")return $(S,q,L,ae,H(fe));if(!fe)return new f("Invalid "+q+" `"+L+"` key `"+ae+"` supplied to `"+S+"`.\nBad object: "+JSON.stringify(ee[B],null," ")+`
151
- Valid keys: `+JSON.stringify(Object.keys(v),null," "));var X=fe(U,ae,S,q,L+"."+ae,n);if(X)return X}return null}return D(W)}function O(v){switch(typeof v){case"number":case"string":case"undefined":return!0;case"boolean":return!v;case"object":if(Array.isArray(v))return v.every(O);if(v===null||o(v))return!0;var W=h(v);if(W){var ee=W.call(v),B;if(W!==v.entries){for(;!(B=ee.next()).done;)if(!O(B.value))return!1}else for(;!(B=ee.next()).done;){var S=B.value;if(S&&!O(S[1]))return!1}}else return!1;return!0;default:return!1}}function j(v,W){return v==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function z(v){var W=typeof v;return Array.isArray(v)?"array":v instanceof RegExp?"object":j(W,v)?"symbol":W}function H(v){if(typeof v>"u"||v===null)return""+v;var W=z(v);if(W==="object"){if(v instanceof Date)return"date";if(v instanceof RegExp)return"regexp"}return W}function te(v){var W=H(v);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function J(v){return!v.constructor||!v.constructor.name?p:v.constructor.name}return m.checkPropTypes=a,m.resetWarningCache=a.resetWarningCache,m.PropTypes=m,m},Mi}var Ii,Jl;function JC(){if(Jl)return Ii;Jl=1;var e=go();function t(){}function n(){}return n.resetWarningCache=t,Ii=function(){function r(s,o,l,u,c,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ii}if(process.env.NODE_ENV!=="production"){var XC=kf(),ex=!0;Ts.exports=QC()(XC.isElement,ex)}else Ts.exports=JC()();var tx=Ts.exports;/*!
150
+ */var Pi,Kl;function YC(){if(Kl)return Pi;Kl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function a(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(s).map(function(c){return s[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Pi=a()?Object.assign:function(i,s){for(var o,l=r(i),u,c=1;c<arguments.length;c++){o=Object(arguments[c]);for(var h in o)t.call(o,h)&&(l[h]=o[h]);if(e){u=e(o);for(var p=0;p<u.length;p++)n.call(o,u[p])&&(l[u[p]]=o[u[p]])}}return l},Pi}var Ni,Zl;function go(){if(Zl)return Ni;Zl=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ni=e,Ni}var Ri,Yl;function _f(){return Yl||(Yl=1,Ri=Function.call.bind(Object.prototype.hasOwnProperty)),Ri}var Mi,Gl;function GC(){if(Gl)return Mi;Gl=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=go(),n={},r=_f();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function a(i,s,o,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var h;try{if(typeof i[c]!="function"){var p=Error((l||"React class")+": "+o+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=i[c](s,c,l,o,null,t)}catch(g){h=g}if(h&&!(h instanceof Error)&&e((l||"React class")+": type specification of "+o+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var m=u?u():"";e("Failed "+o+" type: "+h.message+(m??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Mi=a,Mi}var Ii,Ql;function QC(){if(Ql)return Ii;Ql=1;var e=kf(),t=YC(),n=go(),r=_f(),a=GC(),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 Ii=function(o,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function h(D){var H=D&&(u&&D[u]||D[c]);if(typeof H=="function")return H}var p="<<anonymous>>",m={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:x(),arrayOf:A,element:k(),elementType:w(),instanceOf:F,node:$(),objectOf:z,oneOf:S,oneOfType:N,shape:E,exact:B};function g(D,H){return D===H?D!==0||1/D===1/H:D!==D&&H!==H}function f(D,H){this.message=D,this.data=H&&typeof H=="object"?H:{},this.stack=""}f.prototype=Error.prototype;function b(D){if(process.env.NODE_ENV!=="production")var H={},te=0;function _(q,L,U,ne,re,ae,fe){if(ne=ne||p,ae=ae||U,fe!==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 be=ne+":"+U;!H[be]&&te<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ae+"` prop on `"+ne+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[be]=!0,te++)}}return L[U]==null?q?L[U]===null?new f("The "+re+" `"+ae+"` is marked as required "+("in `"+ne+"`, but its value is `null`.")):new f("The "+re+" `"+ae+"` is marked as required in "+("`"+ne+"`, but its value is `undefined`.")):null:D(L,U,ne,re,ae)}var j=_.bind(null,!1);return j.isRequired=_.bind(null,!0),j}function y(D){function H(te,_,j,q,L,U){var ne=te[_],re=R(ne);if(re!==D){var ae=W(ne);return new f("Invalid "+q+" `"+L+"` of type "+("`"+ae+"` supplied to `"+j+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return b(H)}function x(){return b(s)}function A(D){function H(te,_,j,q,L){if(typeof D!="function")return new f("Property `"+L+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var U=te[_];if(!Array.isArray(U)){var ne=R(U);return new f("Invalid "+q+" `"+L+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected an array."))}for(var re=0;re<U.length;re++){var ae=D(U,re,j,q,L+"["+re+"]",n);if(ae instanceof Error)return ae}return null}return b(H)}function k(){function D(H,te,_,j,q){var L=H[te];if(!o(L)){var U=R(L);return new f("Invalid "+j+" `"+q+"` of type "+("`"+U+"` supplied to `"+_+"`, expected a single ReactElement."))}return null}return b(D)}function w(){function D(H,te,_,j,q){var L=H[te];if(!e.isValidElementType(L)){var U=R(L);return new f("Invalid "+j+" `"+q+"` of type "+("`"+U+"` supplied to `"+_+"`, expected a single ReactElement type."))}return null}return b(D)}function F(D){function H(te,_,j,q,L){if(!(te[_]instanceof D)){var U=D.name||p,ne=G(te[_]);return new f("Invalid "+q+" `"+L+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected ")+("instance of `"+U+"`."))}return null}return b(H)}function S(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function H(te,_,j,q,L){for(var U=te[_],ne=0;ne<D.length;ne++)if(g(U,D[ne]))return null;var re=JSON.stringify(D,function(fe,ee){var be=W(ee);return be==="symbol"?String(ee):ee});return new f("Invalid "+q+" `"+L+"` of value `"+String(U)+"` "+("supplied to `"+j+"`, expected one of "+re+"."))}return b(H)}function z(D){function H(te,_,j,q,L){if(typeof D!="function")return new f("Property `"+L+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var U=te[_],ne=R(U);if(ne!=="object")return new f("Invalid "+q+" `"+L+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected an object."));for(var re in U)if(r(U,re)){var ae=D(U,re,j,q,L+"."+re,n);if(ae instanceof Error)return ae}return null}return b(H)}function N(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 H=0;H<D.length;H++){var te=D[H];if(typeof te!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(te)+" at index "+H+"."),s}function _(j,q,L,U,ne){for(var re=[],ae=0;ae<D.length;ae++){var fe=D[ae],ee=fe(j,q,L,U,ne,n);if(ee==null)return null;ee.data&&r(ee.data,"expectedType")&&re.push(ee.data.expectedType)}var be=re.length>0?", expected one of type ["+re.join(", ")+"]":"";return new f("Invalid "+U+" `"+ne+"` supplied to "+("`"+L+"`"+be+"."))}return b(_)}function $(){function D(H,te,_,j,q){return T(H[te])?null:new f("Invalid "+j+" `"+q+"` supplied to "+("`"+_+"`, expected a ReactNode."))}return b(D)}function I(D,H,te,_,j){return new f((D||"React class")+": "+H+" type `"+te+"."+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function E(D){function H(te,_,j,q,L){var U=te[_],ne=R(U);if(ne!=="object")return new f("Invalid "+q+" `"+L+"` of type `"+ne+"` "+("supplied to `"+j+"`, expected `object`."));for(var re in D){var ae=D[re];if(typeof ae!="function")return I(j,q,L,re,W(ae));var fe=ae(U,re,j,q,L+"."+re,n);if(fe)return fe}return null}return b(H)}function B(D){function H(te,_,j,q,L){var U=te[_],ne=R(U);if(ne!=="object")return new f("Invalid "+q+" `"+L+"` of type `"+ne+"` "+("supplied to `"+j+"`, expected `object`."));var re=t({},te[_],D);for(var ae in re){var fe=D[ae];if(r(D,ae)&&typeof fe!="function")return I(j,q,L,ae,W(fe));if(!fe)return new f("Invalid "+q+" `"+L+"` key `"+ae+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(te[_],null," ")+`
151
+ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var ee=fe(U,ae,j,q,L+"."+ae,n);if(ee)return ee}return null}return b(H)}function T(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(T);if(D===null||o(D))return!0;var H=h(D);if(H){var te=H.call(D),_;if(H!==D.entries){for(;!(_=te.next()).done;)if(!T(_.value))return!1}else for(;!(_=te.next()).done;){var j=_.value;if(j&&!T(j[1]))return!1}}else return!1;return!0;default:return!1}}function M(D,H){return D==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function R(D){var H=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":M(H,D)?"symbol":H}function W(D){if(typeof D>"u"||D===null)return""+D;var H=R(D);if(H==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return H}function X(D){var H=W(D);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function G(D){return!D.constructor||!D.constructor.name?p:D.constructor.name}return m.checkPropTypes=a,m.resetWarningCache=a.resetWarningCache,m.PropTypes=m,m},Ii}var $i,Jl;function JC(){if(Jl)return $i;Jl=1;var e=go();function t(){}function n(){}return n.resetWarningCache=t,$i=function(){function r(s,o,l,u,c,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},$i}if(process.env.NODE_ENV!=="production"){var XC=kf(),ex=!0;Ts.exports=QC()(XC.isElement,ex)}else Ts.exports=JC()();var tx=Ts.exports;/*!
152
152
  * tabbable 6.2.0
153
153
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
154
- */var Bf=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ba=Bf.join(","),Af=typeof Element>"u",xn=Af?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Aa=!Af&&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},Fa=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},nx=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ff=function(t,n,r){if(Fa(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Ba));return n&&xn.call(t,Ba)&&a.unshift(t),a=a.filter(r),a},Tf=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var s=i.shift();if(!Fa(s,!1))if(s.tagName==="SLOT"){var o=s.assignedElements(),l=o.length?o:s.children,u=e(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:s,candidates:u})}else{var c=xn.call(s,Ba);c&&r.filter(s)&&(n||!t.includes(s))&&a.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Fa(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&p){var m=e(h===!0?s.children:h.children,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return a},Sf=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Jt=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||nx(t))&&!Sf(t)?0:t.tabIndex},rx=function(t,n){var r=Jt(t);return r<0&&n&&!Sf(t)?0:r},ax=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},jf=function(t){return t.tagName==="INPUT"},ix=function(t){return jf(t)&&t.type==="hidden"},sx=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ox=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ux=function(t){if(!t.name)return!0;var n=t.form||Aa(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=ox(a,t.form);return!i||i===t},lx=function(t){return jf(t)&&t.type==="radio"},cx=function(t){return lx(t)&&!ux(t)},dx=function(t){var n,r=t&&Aa(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,o,l;for(i=!!((s=a)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,c,h;r=Aa(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=a)!==null&&c!==void 0&&(h=c.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return i},Xl=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},fx=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=xn.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(xn.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=Aa(t);if(l&&!l.shadowRoot&&a(l)===!0)return Xl(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=o}if(dx(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Xl(t);return!1},hx=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 xn.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Ta=function(t,n){return!(n.disabled||Fa(n)||ix(n)||fx(n,t)||sx(n)||hx(n))},Ss=function(t,n){return!(cx(n)||Jt(n)<0||!Ta(t,n))},mx=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},px=function e(t){var n=[],r=[];return t.forEach(function(a,i){var s=!!a.scopeParent,o=s?a.scopeParent:a,l=rx(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(ax).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},Of=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Tf([t],n.includeContainer,{filter:Ss.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:mx}):r=Ff(t,n.includeContainer,Ss.bind(null,n)),px(r)},Pf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Tf([t],n.includeContainer,{filter:Ta.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Ff(t,n.includeContainer,Ta.bind(null,n)),r},dn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xn.call(t,Ba)===!1?!1:Ss(n,t)},gx=Bf.concat("iframe").join(","),pa=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xn.call(t,gx)===!1?!1:Ta(n,t)};const vx=Object.freeze(Object.defineProperty({__proto__:null,focusable:Pf,getTabIndex:Jt,isFocusable:pa,isTabbable:dn,tabbable:Of},Symbol.toStringTag,{value:"Module"}));/*!
154
+ */var Bf=["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])"],Aa=Bf.join(","),Af=typeof Element>"u",xn=Af?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Fa=!Af&&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},Ta=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},nx=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ff=function(t,n,r){if(Ta(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Aa));return n&&xn.call(t,Aa)&&a.unshift(t),a=a.filter(r),a},Tf=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var s=i.shift();if(!Ta(s,!1))if(s.tagName==="SLOT"){var o=s.assignedElements(),l=o.length?o:s.children,u=e(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:s,candidates:u})}else{var c=xn.call(s,Aa);c&&r.filter(s)&&(n||!t.includes(s))&&a.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Ta(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&p){var m=e(h===!0?s.children:h.children,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return a},Sf=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Jt=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||nx(t))&&!Sf(t)?0:t.tabIndex},rx=function(t,n){var r=Jt(t);return r<0&&n&&!Sf(t)?0:r},ax=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},jf=function(t){return t.tagName==="INPUT"},ix=function(t){return jf(t)&&t.type==="hidden"},sx=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ox=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ux=function(t){if(!t.name)return!0;var n=t.form||Fa(t),r=function(o){return n.querySelectorAll('input[type="radio"][name="'+o+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=ox(a,t.form);return!i||i===t},lx=function(t){return jf(t)&&t.type==="radio"},cx=function(t){return lx(t)&&!ux(t)},dx=function(t){var n,r=t&&Fa(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,o,l;for(i=!!((s=a)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,c,h;r=Fa(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=a)!==null&&c!==void 0&&(h=c.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return i},Xl=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},fx=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=xn.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(xn.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var o=t;t;){var l=t.parentElement,u=Fa(t);if(l&&!l.shadowRoot&&a(l)===!0)return Xl(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=o}if(dx(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Xl(t);return!1},hx=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 xn.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Sa=function(t,n){return!(n.disabled||Ta(n)||ix(n)||fx(n,t)||sx(n)||hx(n))},Ss=function(t,n){return!(cx(n)||Jt(n)<0||!Sa(t,n))},mx=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},px=function e(t){var n=[],r=[];return t.forEach(function(a,i){var s=!!a.scopeParent,o=s?a.scopeParent:a,l=rx(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(ax).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},Of=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Tf([t],n.includeContainer,{filter:Ss.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:mx}):r=Ff(t,n.includeContainer,Ss.bind(null,n)),px(r)},Pf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Tf([t],n.includeContainer,{filter:Sa.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Ff(t,n.includeContainer,Sa.bind(null,n)),r},dn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xn.call(t,Aa)===!1?!1:Ss(n,t)},gx=Bf.concat("iframe").join(","),ga=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xn.call(t,gx)===!1?!1:Sa(n,t)};const vx=Object.freeze(Object.defineProperty({__proto__:null,focusable:Pf,getTabIndex:Jt,isFocusable:ga,isTabbable:dn,tabbable:Of},Symbol.toStringTag,{value:"Module"}));/*!
155
155
  * focus-trap 7.5.4
156
156
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
157
- */function ec(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 tc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ec(Object(n),!0).forEach(function(r){bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ec(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bx(e,t,n){return t=Dx(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yx(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 Dx(e){var t=yx(e,"string");return typeof t=="symbol"?t:String(t)}var nc={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()}},Cx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},xx=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},xr=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},wx=function(t){return xr(t)&&!t.shiftKey},Ex=function(t){return xr(t)&&t.shiftKey},rc=function(t){return setTimeout(t,0)},ac=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},lr=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},Xr=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},kx=[],_x=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||kx,i=tc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:wx,isKeyBackward:Ex},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(w,k,O){return w&&w[k]!==void 0?w[k]:i[O||k]},u=function(w,k){var O=typeof(k==null?void 0:k.composedPath)=="function"?k.composedPath():void 0;return s.containerGroups.findIndex(function(j){var z=j.container,H=j.tabbableNodes;return z.contains(w)||(O==null?void 0:O.includes(z))||H.find(function(te){return te===w})})},c=function(w){var k=i[w];if(typeof k=="function"){for(var O=arguments.length,j=new Array(O>1?O-1:0),z=1;z<O;z++)j[z-1]=arguments[z];k=k.apply(void 0,j)}if(k===!0&&(k=void 0),!k){if(k===void 0||k===!1)return k;throw new Error("`".concat(w,"` was specified but was not a node, or did not return a node"))}var H=k;if(typeof k=="string"&&(H=r.querySelector(k),!H))throw new Error("`".concat(w,"` as selector refers to no known node"));return H},h=function(){var w=c("initialFocus");if(w===!1)return!1;if(w===void 0||!pa(w,i.tabbableOptions))if(u(r.activeElement)>=0)w=r.activeElement;else{var k=s.tabbableGroups[0],O=k&&k.firstTabbableNode;w=O||c("fallbackFocus")}if(!w)throw new Error("Your focus-trap needs to have at least one focusable element");return w},p=function(){if(s.containerGroups=s.containers.map(function(w){var k=Of(w,i.tabbableOptions),O=Pf(w,i.tabbableOptions),j=k.length>0?k[0]:void 0,z=k.length>0?k[k.length-1]:void 0,H=O.find(function(v){return dn(v)}),te=O.slice().reverse().find(function(v){return dn(v)}),J=!!k.find(function(v){return Jt(v)>0});return{container:w,tabbableNodes:k,focusableNodes:O,posTabIndexesFound:J,firstTabbableNode:j,lastTabbableNode:z,firstDomTabbableNode:H,lastDomTabbableNode:te,nextTabbableNode:function(W){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=k.indexOf(W);return B<0?ee?O.slice(O.indexOf(W)+1).find(function(S){return dn(S)}):O.slice(0,O.indexOf(W)).reverse().find(function(S){return dn(S)}):k[B+(ee?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(w){return w.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(w){return w.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function $(w){var k=w.activeElement;if(k)return k.shadowRoot&&k.shadowRoot.activeElement!==null?$(k.shadowRoot):k},g=function $(w){if(w!==!1&&w!==m(document)){if(!w||!w.focus){$(h());return}w.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=w,Cx(w)&&w.select()}},f=function(w){var k=c("setReturnFocus",w);return k||(k===!1?!1:w)},D=function(w){var k=w.target,O=w.event,j=w.isBackward,z=j===void 0?!1:j;k=k||Xr(O),p();var H=null;if(s.tabbableGroups.length>0){var te=u(k,O),J=te>=0?s.containerGroups[te]:void 0;if(te<0)z?H=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:H=s.tabbableGroups[0].firstTabbableNode;else if(z){var v=ac(s.tabbableGroups,function(L){var U=L.firstTabbableNode;return k===U});if(v<0&&(J.container===k||pa(k,i.tabbableOptions)&&!dn(k,i.tabbableOptions)&&!J.nextTabbableNode(k,!1))&&(v=te),v>=0){var W=v===0?s.tabbableGroups.length-1:v-1,ee=s.tabbableGroups[W];H=Jt(k)>=0?ee.lastTabbableNode:ee.lastDomTabbableNode}else xr(O)||(H=J.nextTabbableNode(k,!1))}else{var B=ac(s.tabbableGroups,function(L){var U=L.lastTabbableNode;return k===U});if(B<0&&(J.container===k||pa(k,i.tabbableOptions)&&!dn(k,i.tabbableOptions)&&!J.nextTabbableNode(k))&&(B=te),B>=0){var S=B===s.tabbableGroups.length-1?0:B+1,q=s.tabbableGroups[S];H=Jt(k)>=0?q.firstTabbableNode:q.firstDomTabbableNode}else xr(O)||(H=J.nextTabbableNode(k))}}else H=c("fallbackFocus");return H},y=function(w){var k=Xr(w);if(!(u(k,w)>=0)){if(lr(i.clickOutsideDeactivates,w)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}lr(i.allowOutsideClick,w)||w.preventDefault()}},x=function(w){var k=Xr(w),O=u(k,w)>=0;if(O||k instanceof Document)O&&(s.mostRecentlyFocusedNode=k);else{w.stopImmediatePropagation();var j,z=!0;if(s.mostRecentlyFocusedNode)if(Jt(s.mostRecentlyFocusedNode)>0){var H=u(s.mostRecentlyFocusedNode),te=s.containerGroups[H].tabbableNodes;if(te.length>0){var J=te.findIndex(function(v){return v===s.mostRecentlyFocusedNode});J>=0&&(i.isKeyForward(s.recentNavEvent)?J+1<te.length&&(j=te[J+1],z=!1):J-1>=0&&(j=te[J-1],z=!1))}}else s.containerGroups.some(function(v){return v.tabbableNodes.some(function(W){return Jt(W)>0})})||(z=!1);else z=!1;z&&(j=D({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(j||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},A=function(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=w;var O=D({event:w,isBackward:k});O&&(xr(w)&&w.preventDefault(),g(O))},_=function(w){if(xx(w)&&lr(i.escapeDeactivates,w)!==!1){w.preventDefault(),o.deactivate();return}(i.isKeyForward(w)||i.isKeyBackward(w))&&A(w,i.isKeyBackward(w))},E=function(w){var k=Xr(w);u(k,w)>=0||lr(i.clickOutsideDeactivates,w)||lr(i.allowOutsideClick,w)||(w.preventDefault(),w.stopImmediatePropagation())},F=function(){if(s.active)return nc.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?rc(function(){g(h())}):g(h()),r.addEventListener("focusin",x,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",E,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),o},T=function(){if(s.active)return r.removeEventListener("focusin",x,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",E,!0),r.removeEventListener("keydown",_,!0),o},I=function(w){var k=w.some(function(O){var j=Array.from(O.removedNodes);return j.some(function(z){return z===s.mostRecentlyFocusedNode})});k&&g(h())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,M=function(){R&&(R.disconnect(),s.active&&!s.paused&&s.containers.map(function(w){R.observe(w,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(w){if(s.active)return this;var k=l(w,"onActivate"),O=l(w,"onPostActivate"),j=l(w,"checkCanFocusTrap");j||p(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,k==null||k();var z=function(){j&&p(),F(),M(),O==null||O()};return j?(j(s.containers.concat()).then(z,z),this):(z(),this)},deactivate:function(w){if(!s.active)return this;var k=tc({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},w);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,T(),s.active=!1,s.paused=!1,M(),nc.deactivateTrap(a,o);var O=l(k,"onDeactivate"),j=l(k,"onPostDeactivate"),z=l(k,"checkCanReturnFocus"),H=l(k,"returnFocus","returnFocusOnDeactivate");O==null||O();var te=function(){rc(function(){H&&g(f(s.nodeFocusedBeforeActivation)),j==null||j()})};return H&&z?(z(f(s.nodeFocusedBeforeActivation)).then(te,te),this):(te(),this)},pause:function(w){if(s.paused||!s.active)return this;var k=l(w,"onPause"),O=l(w,"onPostPause");return s.paused=!0,k==null||k(),T(),M(),O==null||O(),this},unpause:function(w){if(!s.paused||!s.active)return this;var k=l(w,"onUnpause"),O=l(w,"onPostUnpause");return s.paused=!1,k==null||k(),p(),F(),M(),O==null||O(),this},updateContainerElements:function(w){var k=[].concat(w).filter(Boolean);return s.containers=k.map(function(O){return typeof O=="string"?r.querySelector(O):O}),s.active&&p(),M(),this}},o.updateContainerElements(t),o};const Bx=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:_x},Symbol.toStringTag,{value:"Module"})),Ax=yc(Bx),Fx=yc(vx);function Gn(e){"@babel/helpers - typeof";return Gn=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},Gn(e)}function Tx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ic(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,Nf(r.key),r)}}function Sx(e,t,n){return t&&ic(e.prototype,t),n&&ic(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jx(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&&js(e,t)}function js(e,t){return js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},js(e,t)}function Ox(e){var t=Nx();return function(){var r=Sa(e),a;if(t){var i=Sa(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Px(this,a)}}function Px(e,t){if(t&&(Gn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pr(e)}function pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nx(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sa(e)}function Rx(e,t,n){return t=Nf(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nf(e){var t=Mx(e,"string");return Gn(t)==="symbol"?t:String(t)}function Mx(e,t){if(Gn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ea=C,ve=tx,Ix=Ax,$x=Ix.createFocusTrap,Lx=Fx,zx=Lx.isFocusable,vo=function(e){jx(n,e);var t=Ox(n);function n(r){var a;Tx(this,n),a=t.call(this,r),Rx(pr(a),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];u=u.apply(void 0,h)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var m=u;if(typeof u=="string"){var g;if(m=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!m)throw new Error("`".concat(o,"` as selector refers to no known node"))}return m}),a.handleDeactivate=a.handleDeactivate.bind(pr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(pr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(pr(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 Sx(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&&!zx(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),a.originalOptions.onPostDeactivate&&a.originalOptions.onPostDeactivate.call(null),a.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(i,i):i()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var a=this.focusTrapElements.some(Boolean);a&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(a){if(this.focusTrap){a.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var i=!a.active&&this.props.active,s=a.active&&!this.props.active,o=!a.paused&&this.props.paused,l=a.paused&&!this.props.paused;if(i&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else a.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var a=this,i=this.props.children?ea.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===ea.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=c||[u]},o=ea.cloneElement(i,{ref:s});return o}return null}}]),n}(ea.Component),cr=typeof Element>"u"?Function:Element;vo.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(cr),ve.string,ve.bool,ve.func]),fallbackFocus:ve.oneOfType([ve.instanceOf(cr),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(cr),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(cr)),children:ve.oneOfType([ve.element,ve.instanceOf(cr)])};vo.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:$x};var qx=vo;const Wx=wn(qx),Rf=({showDevTools:e=!0,children:t})=>{const n=new Ve.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return d.jsxs(Ve.QueryClientProvider,{client:n,children:[t,e&&d.jsx(yh.ReactQueryDevtools,{initialIsOpen:!1})]})};var Hx=C.createContext({client:sa});function Ux(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,i=C.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(sa.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),sa.init(r,a)),sa)},[n,r]);return C.createElement(Hx.Provider,{value:{client:i}},t)}const Mf=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?d.jsx(Ux,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):d.jsx(d.Fragment,{children:e}),If=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...Mh[r],...n||{}};return d.jsx(ue.IntlProvider,{locale:r,messages:a,children:e})},bo=C.createContext({}),ga={en:"English",es:"Español",fr:"Français",pt:"Português"},Kt=C.createContext({isLoading:!0});function Ga(){return C.useContext(Kt)}const $f=({children:e,user:t})=>d.jsx(Kt.Provider,{value:t,children:e}),yo=C.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),Lf=()=>C.useContext(yo),zf=({children:e})=>{const[t,n]=C.useState([]);C.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=C.useCallback(i=>{n(s=>[...s,i])},[]),a=C.useCallback(i=>{n(s=>s.filter(o=>o!==i))},[]);return d.jsx(yo.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},Vx=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=C.useState({isLoading:!0}),s=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[o,l]=C.useState(s),u=c=>{localStorage.setItem("language",c),l(c)};return C.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Pc(5e3)}).catch(c=>{c.message===Tc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1})})},[]),d.jsx(bo.Provider,{value:{language:o,updateLanguage:u},children:d.jsx(If,{locale:o,messages:n==null?void 0:n.messages,children:d.jsx(Os.CookiesProvider,{children:d.jsx($f,{user:a,children:d.jsx(zf,{children:d.jsx(Rf,{showDevTools:r,children:d.jsx(Mf,{user:a,children:t})})})})})})})};const Do=({element:e="section",children:t,className:n,...r})=>C.createElement(e,{className:Y("modal",n),children:typeof t=="string"?d.jsx("p",{children:t}):t,...r});const Nr=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:a=()=>{},onClose:i=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:h="Modal"})=>{const p=ue.useIntl(),{registerOverlay:m,unregisterOverlay:g}=Lf(),[f,D]=C.useState(t),y=_=>{_.key==="Escape"&&x(!1)};C.useEffect(()=>(window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}));const x=_=>{D(_),_?(a(),m(e)):(i(),g(e))};C.useEffect(()=>(x(t),()=>{f&&g(e)}),[t]);const A=r?{"--max-width":`${r/16}rem`}:{};return d.jsx("div",{className:Y("overlay",{open:f}),role:"dialog",children:d.jsx(Do,{id:e,className:Y("overlay-modal",c,{"has-max-width":r}),hidden:!f,style:A,children:t&&d.jsx(Wx,{children:d.jsxs("div",{className:"overlay-content",children:[d.jsxs("div",{className:"top",children:[o&&d.jsx("h2",{className:"modal-title",children:o}),d.jsx(ke,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>x(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&d.jsx(tn,{}),l,u&&d.jsxs("div",{className:"bottom",children:[d.jsx(tn,{}),d.jsx(kn,{buttons:u})]}),s&&d.jsx(Er,{className:"error",children:s})]})})})})},qf=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const Kx=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const c=ue.useIntl();return r||(r=c.formatMessage({id:"inviteModal_formTitle"})),a||(a=c.formatMessage({id:"inviteModal_formLabel"})),i||(i=c.formatMessage({id:"inviteModal_cta"})),d.jsx(Nr,{title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:Y("invite-modal",e,{success:!!n}),children:d.jsx(wf,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const Zx=({members:e})=>{const[t,n]=C.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return d.jsxs(d.Fragment,{children:[d.jsx(sn,{name:i,src:l}),d.jsx("p",{children:i}),d.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return d.jsxs("div",{className:"directory-wrapper",children:[d.jsx("ul",{className:"directory",children:e.map(a=>d.jsx("li",{children:d.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),d.jsx(Nr,{isOpen:t!==!1,children:t===!1?"":d.jsxs(d.Fragment,{children:[r(t),d.jsx(Vn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const Yx=({author:e,authorCite:t,content:n,member:r,className:a=""})=>d.jsxs("blockquote",{className:Y("testimonial-block",a),children:[d.jsx(Pt,{className:"testimonial",children:n}),r?d.jsx(tr,{member:r,styling:{size:"large"}}):d.jsxs(d.Fragment,{children:[e&&d.jsx("p",{className:Y("author",{"text-small":!a.includes("new")}),children:e}),t&&d.jsx("p",{className:Y("author-cite",{"text-small":!a.includes("new")}),children:d.jsx("cite",{children:t})})]})]}),Gx=C.memo(Yx);const Qx=({items:e=[],selector:t="",className:n=""})=>{const r=ue.useIntl(),[a,i]=C.useState(e);return C.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,c)=>{s+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));i(l)},[]),a&&a.length>0&&d.jsxs(Nt,{variant:"subtle",className:Y("table-of-contents",n),children:[d.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),d.jsx("nav",{children:d.jsx("ul",{children:a.map(({id:s,text:o})=>d.jsx("li",{children:d.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const Qa=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=ue.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=c=>{const h=c/60,p=Math.floor(h),m=(h-p)*60,g=Math.round(m),f=`${i.formatMessage({id:`${s}hours`},{time:p})}${p>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${p>0?`${i.formatMessage({id:`${s}hours_short`},{time:p})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:c,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:c}),u=i.formatMessage({id:`${s}range_aria`},{early:u,late:h})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),d.jsx("span",{className:Y("time-to-complete",a),"aria-label":u,children:l})};const Jx=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",d.jsx(er,{...n,className:Y("banner",e),image:{...t,aspect:"banner"}})):null;const ln=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return d.jsx("section",{className:Y("full-width-section",t,{[a]:a!=="default"}),...r,children:e})};const Xx=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),d.jsx(ln,{className:Y("download-section",n),children:d.jsxs("div",{className:"content-default",children:[C.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),d.jsx(kn,{buttons:r})]})})};function Wf({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const ew=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=ue.useIntl();return d.jsxs("div",{className:Y("edit-section-placeholder",{"has-icon":!!e}),style:jc(e),children:[d.jsx("p",{children:t||s({id:"edit_section_placeholder_description"})}),a&&d.jsx(ke,{href:r,variant:"secondary",size:"small",onClick:()=>Wf({href:r,setShowModal:i}),children:n||s({id:"edit_section_placeholder_cta"})})]})},tw=({children:e,className:t="",formProps:n,href:r,title:a,modalTitle:i,placeholder:s,showDivider:o=!0})=>{const[l,u]=C.useState(!1),c=typeof r=="string"||!!n,h=()=>u(!1);return d.jsxs("section",{className:Y("edit-section",t),children:[n&&d.jsx(Nr,{title:i||`Edit ${a}`,isOpen:l,showDivider:!1,showIcon:!1,functions:{onClose:h},className:Y("edit-section-modal"),children:d.jsx(nr,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async p=>{var m,g;(m=n==null?void 0:n.functions)!=null&&m.onSuccess&&await((g=n==null?void 0:n.functions)==null?void 0:g.onSuccess(p)),u(!1)},onCancel:h}})}),d.jsxs("div",{className:"edit-section-header",children:[d.jsx("h2",{className:"edit-section-header-title",children:a}),c&&d.jsx(ke,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Wf({href:r,setShowModal:u}),children:"Edit"})]}),e||d.jsx(ew,{...s,href:r,setShowModal:u,showEditButton:c}),o&&d.jsx(tn,{})]})};const nw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return d.jsxs("div",{className:Y("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&C.createElement(s.element,{className:Y("title",s.className)},s.text),t&&d.jsx("p",{children:t}),d.jsx("ul",{className:Y({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:c,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const f=d.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:h});return d.jsxs("li",{children:[d.jsx("p",{className:"img-wrapper",children:p?d.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&d.jsx("small",{children:m})]},window.btoa(`${c.url}_${g}`))})})]})};const rw=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],aw=({className:e="",content:t,image:n,variant:r,spacing:a="normal",styling:i,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,f;const u={imageFullWidth:!0,...i};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},p={};c.forEach(D=>{if(!t[D]){p[D]=!1;return}if(!s[D]){if(typeof t[D]=="object"){p[D]=t[D];const{text:y,element:x}=t[D];if(x&&rw.includes(x.toLowerCase()))return;p[D]={text:y,element:h[D]};return}p[D]={text:t[D],element:h[D]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=D=>{D.preventDefault(),D.stopPropagation();const y=document.getElementById(o.link.substring(1));y&&y.scrollIntoView({behavior:"smooth"})}),d.jsx(ln,{className:Y("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&a==="normal"&&p.eyebrow&&p.title}),children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"content-wrapper",children:[c.map(D=>{if(p[D]&&typeof p[D]=="object"){const{text:y,element:x=""}=p[D];return D==="text"?d.jsx(Vn,{overrideType:"text-only",className:"text",children:y},D):C.createElement(x,{key:D,className:D},y)}return null}),l,m&&d.jsx(ke,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:Y({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&d.jsx(er,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},iw=C.memo(aw);const sw=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),d.jsx(ln,{className:Y("custom-content-banner",t,r,{"has-image":e}),style:a,children:d.jsx("div",{className:"content-slim",children:n})})};const ow=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?d.jsx(Vn,{children:n}):n;return d.jsxs(ln,{className:Y("highlight-section",t),children:[r&&d.jsx("div",{className:Y("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:d.jsx(er,{image:{...r,description:""}})}),d.jsx("div",{className:Y("highlight-container highlight-content-wrapper",{"no-image":!r}),children:d.jsx("div",{className:Y("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:d.jsx("div",{className:"content-default",children:a})})})]})},uw=C.memo(ow);const lw=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:d.jsxs("aside",{className:Y("marketing-block",e),children:[n&&d.jsx("p",{className:"title",children:n}),r&&d.jsx("p",{children:r}),t&&d.jsx(ke,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":a,"data-gtm-event-type":"learn-more-click",children:t.text})]}),cw=({type:e,data:t})=>{const n=ue.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const h=a&&rs(a);return d.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&d.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})]})]})}if(c&&!i||s)return d.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Rs(c)});if(o)return d.jsx(hn,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&rs(u);return d.jsxs("ul",{className:"details",children:[l&&d.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&d.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})})]})}return null},ja={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"}},dw=({data:e,cta:t,link:n,gtmContext:r})=>{var f,D;const a=ue.useIntl(),[i,s]=C.useState({loading:!1,registered:e.registered||!1});C.useEffect(()=>{e.registered&&s(y=>({...y,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:c,slug:h}=e,p=e.contentType;let m="";if((f=ja[p])!=null&&f.gtmEvent&&(m=ja[p].gtmEvent),l&&u)return n?d.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(p==="people")return n?d.jsx(ke,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(p)&&c!=="premium"){const y=i.loading||i.registered||((D=e==null?void 0:e.members)==null?void 0:D.isMember),x=async A=>{if(A.preventDefault(),A.stopPropagation(),!(y||!t||!t.onClick)){s(_=>({..._,loading:!0}));try{const _=await t.onClick(e);s(_==="success"?()=>({registered:!0,loading:!1}):E=>({...E,loading:!1}))}catch{s(E=>({...E,loading:!1}))}}};return d.jsx("p",{className:Y("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:d.jsx(ke,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:y,"data-gtm-event-context":`${r}Page-${p}: ${h}`,"data-gtm-event-type":`${r}-${p}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${p}${y?`_${i.loading?"loading":"done"}`:""}`})})})}return null};const fw={title:66,text:3e3,secondaryText:1e3,partner:25},Co=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:a="Carousel",className:i="",handleCardClick:s,setFocus:o=!1})=>{var $,w,k,O,j;const l=ue.useIntl(),u=C.useContext(Kt),c=u&&typeof u.id=="string",h=C.useRef(null),[p,m]=C.useState({data:null,isLoading:!0}),{data:g,isLoading:f}=p,D=C.useCallback(()=>{n(t,c).then(z=>{m(()=>({data:z,isLoading:!1}))}).catch(()=>m(z=>({...z,isLoading:!1})))},[e]);if(C.useEffect(()=>{D()},[]),f||!g)return d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});s&&!r&&(r={text:l.formatMessage({id:`card_cta_${t.contentType}`}),onClick:s});const{contentType:y}=g;if(!y||!ja[y])return d.jsx(wt,{element:"li",className:"card-wrapper"});const{basePath:x="",className:A,length:_,gtmEvent:E}=ja[y];let F=g.slug?`${x}${g.slug}`:!1;g.slug&&(g.slug.slice(0,4)==="http"||g.slug.slice(0,2)==="//"||g.slug.slice(0,6)==="mailto"||g.slug.slice(0,3)==="tel")&&(F=g.slug);const T=z=>{F&&(z.preventDefault(),z.stopPropagation(),window.location.href=F)},I={...fw,..._};let R={className:"card"},M={};return F&&(M={href:F,className:"gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${E}-click`,"data-testid":"link"},g.openInNewTab&&(M.target="_blank"),R={onClick:T,className:"card gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${E}-click`}),o&&(R={...R,tabIndex:"0"},($=h==null?void 0:h.current)==null||$.focus(),(w=h==null?void 0:h.current)==null||w.scrollIntoView({behavior:"smooth"})),d.jsx("li",{className:Y("card-wrapper text-medium",A,i,{"has-link":F,"no-link":!F,"has-image":g.banner}),"data-testid":`${y}-card`,children:d.jsxs("div",{...R,ref:h,children:[d.jsx(Ic,{className:"card-label",contentType:y,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),y==="communityPage"&&(g==null?void 0:g.createdAt)&&Sh(g==null?void 0:g.createdAt,60)&&d.jsx(hn,{size:"small",variant:"information","data-testid":"new-community",children:l.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&d.jsx(hn,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?l.formatMessage({id:"card_ended"}):Oc(g.startDate)}),g.banner?d.jsxs("p",{className:"img",children:[g.registered&&d.jsx(hn,{size:"small",variant:"registered",children:l.formatMessage({id:"card_registered"})}),d.jsx(er,{image:{...g.banner,description:""}})]}):A==="people"?d.jsx(sn,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&d.jsx(zs,{contributors:{data:g.contributors},styling:{size:"small",showGap:A!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(y)?l.formatMessage({id:`card_contributors_${y}`}):void 0,"data-testid":"contributors"}),g.partner&&d.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?l.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):Hn(g.partner[0],I.partner)}),["title","text","secondaryText"].map(z=>{const H=g[z];if(!H)return null;const te=Bc(z),J={key:z,className:te,"data-testid":te},v={wrapper:"p",forceWrapper:!0,forceInline:!0},W=Hn(H,I[z]);return["title","text"].includes(z)&&F?(v.wrapper="a",d.jsx("p",{...J,children:d.jsx(Pt,{options:v,...M,children:W})})):d.jsx(Pt,{options:v,...J,children:W})}),(u==null?void 0:u.id)&&(g==null?void 0:g.members)&&d.jsxs("span",{className:"member-information",children:[((k=g==null?void 0:g.members)==null?void 0:k.isMember)&&d.jsx(hn,{size:"small",variant:"registered",icon:((O=g==null?void 0:g.members)==null?void 0:O.memberType)==="owner"?"user":"tick",children:l.formatMessage({id:`card_member_type_${(j=g==null?void 0:g.members)==null?void 0:j.memberType}`})}),d.jsx("br",{}),d.jsx("span",{className:"label member-count",children:l.formatMessage({id:"card_member_count"},{count:g==null?void 0:g.members.count})})]}),d.jsx(cw,{type:A||"",data:g}),d.jsx(dw,{data:g,cta:r,link:F||"",gtmContext:a})]})})};const Hf=({cards:e,cardTypes:t,className:n="",...r})=>d.jsx("ul",{className:Y("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return d.jsx(Co,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),hw=(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},mw=({id:e,title:t})=>{const n=ue.useIntl();if(!t||!t.text)return null;const{text:r,element:a="h2",variant:i="default",size:s="medium",link:o}=t;return C.createElement(a,{className:Y("title",i,s,{"highlighted-title":i==="highlighted"}),children:d.jsxs(d.Fragment,{children:[r,o&&d.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const $i={fourCards:1024,threeCards:769,twoCards:480};let ta=null;const pw=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=ue.useIntl(),[u,c]=C.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=u,[m,g]=C.useState({currentPage:0,loadedPages:[0]}),{currentPage:f,loadedPages:D}=m,[y,x]=C.useState(""),A=t.length,_=Math.ceil(A/h),E=C.useRef(null),F=Jn(!0,!0,E==null?void 0:E.current);C.useEffect(()=>{let w=1;F&&(F>=$i.fourCards?w=4:F>=$i.threeCards?w=3:F>=$i.twoCards&&(w=2),w>A&&(w=A)),c(k=>({...k,cardsPerPage:w,isLoading:!1}))},[F,A]);const T=(w="next")=>{let k=f;if(typeof w=="string")if(w==="next")if(f<_-1)k=f+1;else return;else if(f>0)k=f-1;else return;else k=w;g(j=>({...j,currentPage:k,loadedPages:[...new Set([...D,k])]}));const O=()=>{const j=k*u.cardsPerPage,z=j+u.cardsPerPage;return t.slice(j,z).length};x(l.formatMessage({id:"carousel_pagination_aria_live"},{direction:w,count:O()}))},I=w=>{ta=w.touches[0].clientX},R=w=>{if(ta===null)return;const k=w.touches[0].clientX,O=ta-k;O>5?T("next"):O<-5&&T("previous"),ta=null},M={"--width":`${F||0}px`,"--total-cards":A,"--cards-per-page":h,"--page":f};if(p)return d.jsx($s,{layout:`carousel${a?"-with-title":""}`});const $=(w,k)=>{var j;let O=null;return(j=w==null?void 0:w.sys)!=null&&j.id?O=`card-${w.sys.id}`:w!=null&&w.slug?O=`card-${w.slug}`:[n[k],w.contentType].includes("customCard")&&(O=`card-${window.btoa(`${w.title} ${w.createdAt}`)}-${k}`),O};return d.jsxs("section",{ref:E,className:Y("carousel-wrapper",i),"data-testid":"carousel",children:[d.jsx(mw,{id:e,title:a}),d.jsx("ul",{className:"carousel",onTouchStart:I,onTouchMove:R,style:M,"data-testid":"carousel-list",children:t.map((w,k)=>{let O=$(w,k);return O&&hw(k,h,f,D)?d.jsx(Co,{id:O,card:{...w,contentType:n[k]},buildCardData:r,gtmContext:s,...o},O):(O=O||`${e}-card-${k}`,d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},O))})}),_<=1?null:d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[d.jsx("li",{className:"arrow previous",children:d.jsx(ke,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:w=>{w.preventDefault(),w.stopPropagation(),T("previous")},screenreaderText:l.formatMessage({id:"carousel_pagination_previous"}),disabled:f<=0})}),[...Array(_)].map((w,k)=>d.jsx("li",{"data-testid":"carousel-controls-button",children:d.jsx("button",{className:Y("page-indicator",{selected:k===f}),onClick:O=>{O.preventDefault(),O.stopPropagation(),T(k)},children:d.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:"carousel_pagination_page"},{number:k+1,total:_})})})},`page-indicator-${k}`)),d.jsx("li",{className:"arrow next",children:d.jsx(ke,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:w=>{w.preventDefault(),w.stopPropagation(),T("next")},screenreaderText:l.formatMessage({id:"carousel_pagination_next"}),disabled:f>=_-1})})]}),d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})]})},gw=({carousels:e=[],isLoading:t,title:n,className:r="",...a})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const c=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?d.jsxs(C.Fragment,{children:[d.jsx($s,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:d.jsx(tn,{})]},`placeholder-${c}`):d.jsxs(C.Fragment,{children:[d.jsx(pw,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:d.jsx(tn,{})]},`carousel-${c}`)});const dr="joinCommunityButton",xo=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=C.useContext(Kt),l=o&&typeof o.id=="string",u=r||!l,[c,h]=C.useState(e),[p,m]=C.useState(e?"joined":"notJoined");C.useEffect(()=>{p==="joining"?m("joined"):p==="leaving"&&m("notJoined")},[c]);const g={},f={};return c&&p!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${dr}_leave`}),g["aria-label"]=s.formatMessage({id:`${dr}_member_aria`}),f["aria-hidden"]="true"),d.jsx(ke,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&p!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${dr}_closed_tooltip`}):"",onClick:async D=>{if(u)return;D.currentTarget.blur(),m(c?"leaving":"joining");const y=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${dr}_aria_live`},{action:c?"leaving":"joining"})}});document.dispatchEvent(y);const x=c?i:a;typeof x=="function"&&setTimeout(async()=>{await x()},500),h(!c)},className:Y("join-community-button",p,{active:p==="joining"}),disabled:u,"data-testid":"join-button",...g,children:d.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${dr}${["joining","leaving"].includes(p)?`_${p}`:c?"_member":n?"_short":""}`})})})};const Li="communityDetails_",vw=({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=ue.useIntl(),u=5,c=a||i.length,h=i.length?i:Array(u).fill({}),p=`/communities/${r}/members`===window.location.pathname,m=t||n,g=!n&&!t;return d.jsxs("div",{className:Y("community-details",e),children:[m&&d.jsxs("div",{className:"member-details",children:[d.jsxs("div",{className:"top",children:[d.jsxs("h4",{children:[l.formatMessage({id:`${Li}members`}),d.jsx("span",{className:"count",children:c})]}),!p&&d.jsx("p",{className:"text-small",children:d.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${Li}viewAll`})})})]}),d.jsx(zs,{contributors:{total:a,data:h},styling:{size:"medium",showGap:!0,showPlaceholders:c===0},cutoff:u})]}),d.jsx(xo,{isMember:t,isOpen:n,disabled:g,functions:{...o}}),t&&d.jsx(ke,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${Li}invite`})})]})};const bw=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Me,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),d.jsx("ul",{className:Y("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),d.jsxs("li",{children:[s&&d.jsx(Me,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),d.jsx(_n,{href:s?void 0:i,...l,children:Hn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const yw=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=ue.useIntl(),s=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,l]=C.useState(t?["all"]:[]),u=(c,h)=>{let p=[];o.includes(c)?p=o.filter(m=>m!==c):c==="all"?p=["all"]:n?p=[...o.filter(m=>m!=="all"),c]:p=[c],l(m=>(r&&typeof r=="function"&&r({current:p,previous:m}),p)),h&&typeof h=="function"&&h()};return d.jsx("ul",{className:Y("filters",a),children:s.map(({id:c,text:h,disabled:p=!1,callback:m=()=>{}})=>{let g={};return p&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),d.jsx("li",{children:d.jsx("button",{className:Y(c,{selected:o.includes(c)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(c,m)},...g,children:h})},c)})})},Dw=(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 na="languageSwitcher_",Cw=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=ue.useIntl(),{updateLanguage:c=()=>{}}=C.useContext(bo),[h,p]=C.useState(e);if(C.useEffect(()=>{e!==h&&p(e)},[e]),!r||!Object.values(r).some(D=>D&&D.post_name))return null;const g=Object.keys(r),f=h!==e;return d.jsxs("div",{className:Y("language-switcher text-small",s,l),children:[d.jsxs("nav",{children:[s!=="short"&&d.jsx("p",{children:o||u.formatMessage({id:`${na}label`})}),d.jsx("ul",{children:g.map(D=>{var A;if(!ga[D])return null;const y=(A=r[D])==null?void 0:A.post_name;let x={className:D};if(h===D)x["aria-label"]=u.formatMessage({id:`${na}selected`},{language:ga[D]});else{const _=Dw(D,y,i);x={...x,href:typeof _=="string"?_:_.url,onClick:E=>{p(D),c(D),typeof a<"u"&&(E.preventDefault(),E.stopPropagation(),a(D,typeof _=="string"?_:_.urlForRouter))}}}return d.jsx("li",{children:d.jsx(_n,{...x,fallbackElement:"span",children:ga[D]})},D)})}),s!=="short"&&!f&&d.jsx("p",{children:u.formatMessage({id:`${na}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&d.jsx("small",{children:u.formatMessage({id:`${na}disclaimer`},{email:Nn.support,link:D=>{const y=`mailto:${D}`;return d.jsx("a",{href:y,children:D})}})})]})};const zi=ue.createIntl({locale:"en",messages:Xn}),Rr=({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:zi.formatMessage({id:"loadMore_button"}),endOfFeed:zi.formatMessage({id:"loadMore_endOfFeed"}),error:zi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,h]=C.useState(""),p=async m=>{if(!n)try{await t(m)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:d.jsx("footer",{className:Y("load-more",l),children:!c&&e?d.jsx(ke,{variant:r,size:a,styling:i,icon:s,onClick:p,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?d.jsx("p",{children:o.endOfFeed}):c&&d.jsx("p",{className:"error",children:o.error})})};const wo=({variant:e="default",version:t="default",className:n="",...r})=>d.jsx("p",{className:"logo-wrapper",children:d.jsx("a",{href:"/home/",className:Y("logo",e,t,n),...r,children:d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"apolitical"})})})});let ra=!1;const Uf=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=ue.useIntl(),i=C.useRef(null),[s,o]=C.useState(!1),l=u=>{i.current&&u.target instanceof HTMLElement&&!i.current.contains(u.target)&&o(!1)};return C.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),C.createElement(e,{ref:i,className:Y("more-menu text-medium",r),children:d.jsxs(d.Fragment,{children:[d.jsx(ke,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:a.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),d.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:h,icon:p,...m},g)=>{const f={...m,onClick:D=>{o(!1),typeof c=="function"&&c(D)},onFocus:()=>{ra&&(clearTimeout(ra),ra=!1)},onBlur:()=>{ra=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),d.jsx("li",{className:"more-menu-list-item",children:d.jsx(ke,{variant:"tertiary",size:"medium",icon:p?{icon:p,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},xw=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const ww=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],Vf=({activeLink:e})=>{const t=ue.useIntl(),n=C.useContext(Kt),r=n&&typeof n.id=="string";return d.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[ww.map(({key:a,href:i})=>{const s=xw(i,e),o={};return s&&(o["aria-current"]="page"),d.jsx("li",{className:Y(a,{active:s}),children:d.jsx("a",{href:i,"data-gtm-event-type":`${a}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...o,children:t.formatMessage({id:`navigationMenu_links_${a}`})})},a)}),r&&d.jsx("li",{className:"profile","data-testid":"profile-link",children:d.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[d.jsx(sn,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),d.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},fr=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Ew=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${fr(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(`${fr(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(`${fr(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
157
+ */function ec(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 tc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ec(Object(n),!0).forEach(function(r){bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ec(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bx(e,t,n){return t=Dx(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yx(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 Dx(e){var t=yx(e,"string");return typeof t=="symbol"?t:String(t)}var nc={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()}},Cx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},xx=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},xr=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},wx=function(t){return xr(t)&&!t.shiftKey},Ex=function(t){return xr(t)&&t.shiftKey},rc=function(t){return setTimeout(t,0)},ac=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},lr=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},ea=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},kx=[],_x=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||kx,i=tc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:wx,isKeyBackward:Ex},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(E,B,T){return E&&E[B]!==void 0?E[B]:i[T||B]},u=function(E,B){var T=typeof(B==null?void 0:B.composedPath)=="function"?B.composedPath():void 0;return s.containerGroups.findIndex(function(M){var R=M.container,W=M.tabbableNodes;return R.contains(E)||(T==null?void 0:T.includes(R))||W.find(function(X){return X===E})})},c=function(E){var B=i[E];if(typeof B=="function"){for(var T=arguments.length,M=new Array(T>1?T-1:0),R=1;R<T;R++)M[R-1]=arguments[R];B=B.apply(void 0,M)}if(B===!0&&(B=void 0),!B){if(B===void 0||B===!1)return B;throw new Error("`".concat(E,"` was specified but was not a node, or did not return a node"))}var W=B;if(typeof B=="string"&&(W=r.querySelector(B),!W))throw new Error("`".concat(E,"` as selector refers to no known node"));return W},h=function(){var E=c("initialFocus");if(E===!1)return!1;if(E===void 0||!ga(E,i.tabbableOptions))if(u(r.activeElement)>=0)E=r.activeElement;else{var B=s.tabbableGroups[0],T=B&&B.firstTabbableNode;E=T||c("fallbackFocus")}if(!E)throw new Error("Your focus-trap needs to have at least one focusable element");return E},p=function(){if(s.containerGroups=s.containers.map(function(E){var B=Of(E,i.tabbableOptions),T=Pf(E,i.tabbableOptions),M=B.length>0?B[0]:void 0,R=B.length>0?B[B.length-1]:void 0,W=T.find(function(D){return dn(D)}),X=T.slice().reverse().find(function(D){return dn(D)}),G=!!B.find(function(D){return Jt(D)>0});return{container:E,tabbableNodes:B,focusableNodes:T,posTabIndexesFound:G,firstTabbableNode:M,lastTabbableNode:R,firstDomTabbableNode:W,lastDomTabbableNode:X,nextTabbableNode:function(H){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,_=B.indexOf(H);return _<0?te?T.slice(T.indexOf(H)+1).find(function(j){return dn(j)}):T.slice(0,T.indexOf(H)).reverse().find(function(j){return dn(j)}):B[_+(te?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(E){return E.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(E){return E.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function I(E){var B=E.activeElement;if(B)return B.shadowRoot&&B.shadowRoot.activeElement!==null?I(B.shadowRoot):B},g=function I(E){if(E!==!1&&E!==m(document)){if(!E||!E.focus){I(h());return}E.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=E,Cx(E)&&E.select()}},f=function(E){var B=c("setReturnFocus",E);return B||(B===!1?!1:E)},b=function(E){var B=E.target,T=E.event,M=E.isBackward,R=M===void 0?!1:M;B=B||ea(T),p();var W=null;if(s.tabbableGroups.length>0){var X=u(B,T),G=X>=0?s.containerGroups[X]:void 0;if(X<0)R?W=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:W=s.tabbableGroups[0].firstTabbableNode;else if(R){var D=ac(s.tabbableGroups,function(L){var U=L.firstTabbableNode;return B===U});if(D<0&&(G.container===B||ga(B,i.tabbableOptions)&&!dn(B,i.tabbableOptions)&&!G.nextTabbableNode(B,!1))&&(D=X),D>=0){var H=D===0?s.tabbableGroups.length-1:D-1,te=s.tabbableGroups[H];W=Jt(B)>=0?te.lastTabbableNode:te.lastDomTabbableNode}else xr(T)||(W=G.nextTabbableNode(B,!1))}else{var _=ac(s.tabbableGroups,function(L){var U=L.lastTabbableNode;return B===U});if(_<0&&(G.container===B||ga(B,i.tabbableOptions)&&!dn(B,i.tabbableOptions)&&!G.nextTabbableNode(B))&&(_=X),_>=0){var j=_===s.tabbableGroups.length-1?0:_+1,q=s.tabbableGroups[j];W=Jt(B)>=0?q.firstTabbableNode:q.firstDomTabbableNode}else xr(T)||(W=G.nextTabbableNode(B))}}else W=c("fallbackFocus");return W},y=function(E){var B=ea(E);if(!(u(B,E)>=0)){if(lr(i.clickOutsideDeactivates,E)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}lr(i.allowOutsideClick,E)||E.preventDefault()}},x=function(E){var B=ea(E),T=u(B,E)>=0;if(T||B instanceof Document)T&&(s.mostRecentlyFocusedNode=B);else{E.stopImmediatePropagation();var M,R=!0;if(s.mostRecentlyFocusedNode)if(Jt(s.mostRecentlyFocusedNode)>0){var W=u(s.mostRecentlyFocusedNode),X=s.containerGroups[W].tabbableNodes;if(X.length>0){var G=X.findIndex(function(D){return D===s.mostRecentlyFocusedNode});G>=0&&(i.isKeyForward(s.recentNavEvent)?G+1<X.length&&(M=X[G+1],R=!1):G-1>=0&&(M=X[G-1],R=!1))}}else s.containerGroups.some(function(D){return D.tabbableNodes.some(function(H){return Jt(H)>0})})||(R=!1);else R=!1;R&&(M=b({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(M||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},A=function(E){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=E;var T=b({event:E,isBackward:B});T&&(xr(E)&&E.preventDefault(),g(T))},k=function(E){if(xx(E)&&lr(i.escapeDeactivates,E)!==!1){E.preventDefault(),o.deactivate();return}(i.isKeyForward(E)||i.isKeyBackward(E))&&A(E,i.isKeyBackward(E))},w=function(E){var B=ea(E);u(B,E)>=0||lr(i.clickOutsideDeactivates,E)||lr(i.allowOutsideClick,E)||(E.preventDefault(),E.stopImmediatePropagation())},F=function(){if(s.active)return nc.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?rc(function(){g(h())}):g(h()),r.addEventListener("focusin",x,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",k,{capture:!0,passive:!1}),o},S=function(){if(s.active)return r.removeEventListener("focusin",x,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",k,!0),o},z=function(E){var B=E.some(function(T){var M=Array.from(T.removedNodes);return M.some(function(R){return R===s.mostRecentlyFocusedNode})});B&&g(h())},N=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(z):void 0,$=function(){N&&(N.disconnect(),s.active&&!s.paused&&s.containers.map(function(E){N.observe(E,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(E){if(s.active)return this;var B=l(E,"onActivate"),T=l(E,"onPostActivate"),M=l(E,"checkCanFocusTrap");M||p(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,B==null||B();var R=function(){M&&p(),F(),$(),T==null||T()};return M?(M(s.containers.concat()).then(R,R),this):(R(),this)},deactivate:function(E){if(!s.active)return this;var B=tc({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},E);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,$(),nc.deactivateTrap(a,o);var T=l(B,"onDeactivate"),M=l(B,"onPostDeactivate"),R=l(B,"checkCanReturnFocus"),W=l(B,"returnFocus","returnFocusOnDeactivate");T==null||T();var X=function(){rc(function(){W&&g(f(s.nodeFocusedBeforeActivation)),M==null||M()})};return W&&R?(R(f(s.nodeFocusedBeforeActivation)).then(X,X),this):(X(),this)},pause:function(E){if(s.paused||!s.active)return this;var B=l(E,"onPause"),T=l(E,"onPostPause");return s.paused=!0,B==null||B(),S(),$(),T==null||T(),this},unpause:function(E){if(!s.paused||!s.active)return this;var B=l(E,"onUnpause"),T=l(E,"onPostUnpause");return s.paused=!1,B==null||B(),p(),F(),$(),T==null||T(),this},updateContainerElements:function(E){var B=[].concat(E).filter(Boolean);return s.containers=B.map(function(T){return typeof T=="string"?r.querySelector(T):T}),s.active&&p(),$(),this}},o.updateContainerElements(t),o};const Bx=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:_x},Symbol.toStringTag,{value:"Module"})),Ax=yc(Bx),Fx=yc(vx);function Gn(e){"@babel/helpers - typeof";return Gn=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},Gn(e)}function Tx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ic(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,Nf(r.key),r)}}function Sx(e,t,n){return t&&ic(e.prototype,t),n&&ic(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jx(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&&js(e,t)}function js(e,t){return js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},js(e,t)}function Ox(e){var t=Nx();return function(){var r=ja(e),a;if(t){var i=ja(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Px(this,a)}}function Px(e,t){if(t&&(Gn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pr(e)}function pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nx(){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 ja(e){return ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ja(e)}function Rx(e,t,n){return t=Nf(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nf(e){var t=Mx(e,"string");return Gn(t)==="symbol"?t:String(t)}function Mx(e,t){if(Gn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ta=C,ve=tx,Ix=Ax,$x=Ix.createFocusTrap,Lx=Fx,zx=Lx.isFocusable,vo=function(e){jx(n,e);var t=Ox(n);function n(r){var a;Tx(this,n),a=t.call(this,r),Rx(pr(a),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];u=u.apply(void 0,h)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var m=u;if(typeof u=="string"){var g;if(m=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!m)throw new Error("`".concat(o,"` as selector refers to no known node"))}return m}),a.handleDeactivate=a.handleDeactivate.bind(pr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(pr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(pr(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 Sx(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&&!zx(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),a.originalOptions.onPostDeactivate&&a.originalOptions.onPostDeactivate.call(null),a.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(i,i):i()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var a=this.focusTrapElements.some(Boolean);a&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(a){if(this.focusTrap){a.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var i=!a.active&&this.props.active,s=a.active&&!this.props.active,o=!a.paused&&this.props.paused,l=a.paused&&!this.props.paused;if(i&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else a.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var a=this,i=this.props.children?ta.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===ta.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=c||[u]},o=ta.cloneElement(i,{ref:s});return o}return null}}]),n}(ta.Component),cr=typeof Element>"u"?Function:Element;vo.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(cr),ve.string,ve.bool,ve.func]),fallbackFocus:ve.oneOfType([ve.instanceOf(cr),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(cr),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(cr)),children:ve.oneOfType([ve.element,ve.instanceOf(cr)])};vo.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:$x};var qx=vo;const Wx=wn(qx),Rf=({showDevTools:e=!0,children:t})=>{const n=new Ve.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return d.jsxs(Ve.QueryClientProvider,{client:n,children:[t,e&&d.jsx(yh.ReactQueryDevtools,{initialIsOpen:!1})]})};var Hx=C.createContext({client:oa});function Ux(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,i=C.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(oa.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),oa.init(r,a)),oa)},[n,r]);return C.createElement(Hx.Provider,{value:{client:i}},t)}const Mf=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?d.jsx(Ux,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):d.jsx(d.Fragment,{children:e}),If=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...Mh[r],...n||{}};return d.jsx(ue.IntlProvider,{locale:r,messages:a,children:e})},bo=C.createContext({}),va={en:"English",es:"Español",fr:"Français",pt:"Português"},Kt=C.createContext({isLoading:!0});function Qa(){return C.useContext(Kt)}const $f=({children:e,user:t})=>d.jsx(Kt.Provider,{value:t,children:e}),yo=C.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),Lf=()=>C.useContext(yo),zf=({children:e})=>{const[t,n]=C.useState([]);C.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=C.useCallback(i=>{n(s=>[...s,i])},[]),a=C.useCallback(i=>{n(s=>s.filter(o=>o!==i))},[]);return d.jsx(yo.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},Vx=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=C.useState({isLoading:!0}),s=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[o,l]=C.useState(s),u=c=>{localStorage.setItem("language",c),l(c)};return C.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Pc(5e3)}).catch(c=>{c.message===Tc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1})})},[]),d.jsx(bo.Provider,{value:{language:o,updateLanguage:u},children:d.jsx(If,{locale:o,messages:n==null?void 0:n.messages,children:d.jsx(Os.CookiesProvider,{children:d.jsx($f,{user:a,children:d.jsx(zf,{children:d.jsx(Rf,{showDevTools:r,children:d.jsx(Mf,{user:a,children:t})})})})})})})};const Do=({element:e="section",children:t,className:n,...r})=>C.createElement(e,{className:Y("modal",n),children:typeof t=="string"?d.jsx("p",{children:t}):t,...r});const Rr=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:a=()=>{},onClose:i=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:h="Modal"})=>{const p=ue.useIntl(),{registerOverlay:m,unregisterOverlay:g}=Lf(),[f,b]=C.useState(t),y=k=>{k.key==="Escape"&&x(!1)};C.useEffect(()=>(window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}));const x=k=>{b(k),k?(a(),m(e)):(i(),g(e))};C.useEffect(()=>(x(t),()=>{f&&g(e)}),[t]);const A=r?{"--max-width":`${r/16}rem`}:{};return d.jsx("div",{className:Y("overlay",{open:f}),role:"dialog",children:d.jsx(Do,{id:e,className:Y("overlay-modal",c,{"has-max-width":r}),hidden:!f,style:A,children:t&&d.jsx(Wx,{children:d.jsxs("div",{className:"overlay-content",children:[d.jsxs("div",{className:"top",children:[o&&d.jsx("h2",{className:"modal-title",children:o}),d.jsx(_e,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>x(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&d.jsx(tn,{}),l,u&&d.jsxs("div",{className:"bottom",children:[d.jsx(tn,{}),d.jsx(kn,{buttons:u})]}),s&&d.jsx(kr,{className:"error",children:s})]})})})})},qf=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const Kx=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const c=ue.useIntl();return r||(r=c.formatMessage({id:"inviteModal_formTitle"})),a||(a=c.formatMessage({id:"inviteModal_formLabel"})),i||(i=c.formatMessage({id:"inviteModal_cta"})),d.jsx(Rr,{title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:Y("invite-modal",e,{success:!!n}),children:d.jsx(wf,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const Zx=({members:e})=>{const[t,n]=C.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return d.jsxs(d.Fragment,{children:[d.jsx(sn,{name:i,src:l}),d.jsx("p",{children:i}),d.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return d.jsxs("div",{className:"directory-wrapper",children:[d.jsx("ul",{className:"directory",children:e.map(a=>d.jsx("li",{children:d.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),d.jsx(Rr,{isOpen:t!==!1,children:t===!1?"":d.jsxs(d.Fragment,{children:[r(t),d.jsx(Vn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const Yx=({author:e,authorCite:t,content:n,member:r,className:a=""})=>d.jsxs("blockquote",{className:Y("testimonial-block",a),children:[d.jsx(Pt,{className:"testimonial",children:n}),r?d.jsx(tr,{member:r,styling:{size:"large"}}):d.jsxs(d.Fragment,{children:[e&&d.jsx("p",{className:Y("author",{"text-small":!a.includes("new")}),children:e}),t&&d.jsx("p",{className:Y("author-cite",{"text-small":!a.includes("new")}),children:d.jsx("cite",{children:t})})]})]}),Gx=C.memo(Yx);const Qx=({items:e=[],selector:t="",className:n=""})=>{const r=ue.useIntl(),[a,i]=C.useState(e);return C.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,c)=>{s+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));i(l)},[]),a&&a.length>0&&d.jsxs(Nt,{variant:"subtle",className:Y("table-of-contents",n),children:[d.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),d.jsx("nav",{children:d.jsx("ul",{children:a.map(({id:s,text:o})=>d.jsx("li",{children:d.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const Ja=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=ue.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=c=>{const h=c/60,p=Math.floor(h),m=(h-p)*60,g=Math.round(m),f=`${i.formatMessage({id:`${s}hours`},{time:p})}${p>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${p>0?`${i.formatMessage({id:`${s}hours_short`},{time:p})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:c,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:c}),u=i.formatMessage({id:`${s}range_aria`},{early:u,late:h})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),d.jsx("span",{className:Y("time-to-complete",a),"aria-label":u,children:l})};const Jx=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",d.jsx(er,{...n,className:Y("banner",e),image:{...t,aspect:"banner"}})):null;const ln=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return d.jsx("section",{className:Y("full-width-section",t,{[a]:a!=="default"}),...r,children:e})};const Xx=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),d.jsx(ln,{className:Y("download-section",n),children:d.jsxs("div",{className:"content-default",children:[C.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),d.jsx(kn,{buttons:r})]})})};function Wf({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const ew=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=ue.useIntl();return d.jsxs("div",{className:Y("edit-section-placeholder",{"has-icon":!!e}),style:jc(e),children:[d.jsx("p",{children:t||s({id:"edit_section_placeholder_description"})}),a&&d.jsx(_e,{href:r,variant:"secondary",size:"small",onClick:()=>Wf({href:r,setShowModal:i}),children:n||s({id:"edit_section_placeholder_cta"})})]})},tw=({children:e,className:t="",formProps:n,href:r,title:a,modalTitle:i,placeholder:s,showDivider:o=!0})=>{const[l,u]=C.useState(!1),c=typeof r=="string"||!!n,h=()=>u(!1);return d.jsxs("section",{className:Y("edit-section",t),children:[n&&d.jsx(Rr,{title:i||`Edit ${a}`,isOpen:l,showDivider:!1,showIcon:!1,functions:{onClose:h},className:Y("edit-section-modal"),children:d.jsx(nr,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async p=>{var m,g;(m=n==null?void 0:n.functions)!=null&&m.onSuccess&&await((g=n==null?void 0:n.functions)==null?void 0:g.onSuccess(p)),u(!1)},onCancel:h}})}),d.jsxs("div",{className:"edit-section-header",children:[d.jsx("h2",{className:"edit-section-header-title",children:a}),c&&d.jsx(_e,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Wf({href:r,setShowModal:u}),children:"Edit"})]}),e||d.jsx(ew,{...s,href:r,setShowModal:u,showEditButton:c}),o&&d.jsx(tn,{})]})};const nw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return d.jsxs("div",{className:Y("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&C.createElement(s.element,{className:Y("title",s.className)},s.text),t&&d.jsx("p",{children:t}),d.jsx("ul",{className:Y({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:c,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const f=d.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:h});return d.jsxs("li",{children:[d.jsx("p",{className:"img-wrapper",children:p?d.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&d.jsx("small",{children:m})]},window.btoa(`${c.url}_${g}`))})})]})};const rw=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],aw=({className:e="",content:t,image:n,variant:r,spacing:a="normal",styling:i,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,f;const u={imageFullWidth:!0,...i};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},p={};c.forEach(b=>{if(!t[b]){p[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){p[b]=t[b];const{text:y,element:x}=t[b];if(x&&rw.includes(x.toLowerCase()))return;p[b]={text:y,element:h[b]};return}p[b]={text:t[b],element:h[b]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const y=document.getElementById(o.link.substring(1));y&&y.scrollIntoView({behavior:"smooth"})}),d.jsx(ln,{className:Y("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&a==="normal"&&p.eyebrow&&p.title}),children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"content-wrapper",children:[c.map(b=>{if(p[b]&&typeof p[b]=="object"){const{text:y,element:x=""}=p[b];return b==="text"?d.jsx(Vn,{overrideType:"text-only",className:"text",children:y},b):C.createElement(x,{key:b,className:b},y)}return null}),l,m&&d.jsx(_e,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:Y({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&d.jsx(er,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},iw=C.memo(aw);const sw=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),d.jsx(ln,{className:Y("custom-content-banner",t,r,{"has-image":e}),style:a,children:d.jsx("div",{className:"content-slim",children:n})})};const ow=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?d.jsx(Vn,{children:n}):n;return d.jsxs(ln,{className:Y("highlight-section",t),children:[r&&d.jsx("div",{className:Y("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:d.jsx(er,{image:{...r,description:""}})}),d.jsx("div",{className:Y("highlight-container highlight-content-wrapper",{"no-image":!r}),children:d.jsx("div",{className:Y("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:d.jsx("div",{className:"content-default",children:a})})})]})},uw=C.memo(ow);const lw=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:d.jsxs("aside",{className:Y("marketing-block",e),children:[n&&d.jsx("p",{className:"title",children:n}),r&&d.jsx("p",{children:r}),t&&d.jsx(_e,{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})]}),cw=({type:e,data:t})=>{const n=ue.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const h=a&&rs(a);return d.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&d.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})]})]})}if(c&&!i||s)return d.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Rs(c)});if(o)return d.jsx(hn,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&rs(u);return d.jsxs("ul",{className:"details",children:[l&&d.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&d.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})})]})}return null},Oa={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"}},dw=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const a=ue.useIntl(),[i,s]=C.useState({loading:!1,registered:e.registered||!1});C.useEffect(()=>{e.registered&&s(y=>({...y,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:c,slug:h}=e,p=e.contentType;let m="";if((f=Oa[p])!=null&&f.gtmEvent&&(m=Oa[p].gtmEvent),l&&u)return n?d.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(p==="people")return n?d.jsx(_e,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(p)&&c!=="premium"){const y=i.loading||i.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),x=async A=>{if(A.preventDefault(),A.stopPropagation(),!(y||!t||!t.onClick)){s(k=>({...k,loading:!0}));try{const k=await t.onClick(e);s(k==="success"?()=>({registered:!0,loading:!1}):w=>({...w,loading:!1}))}catch{s(w=>({...w,loading:!1}))}}};return d.jsx("p",{className:Y("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:d.jsx(_e,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:y,"data-gtm-event-context":`${r}Page-${p}: ${h}`,"data-gtm-event-type":`${r}-${p}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${p}${y?`_${i.loading?"loading":"done"}`:""}`})})})}return null};const fw={title:66,text:3e3,secondaryText:1e3,partner:25},Co=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:a="Carousel",className:i="",handleCardClick:s,setFocus:o=!1})=>{var I,E,B,T,M;const l=ue.useIntl(),u=C.useContext(Kt),c=u&&typeof u.id=="string",h=C.useRef(null),[p,m]=C.useState({data:null,isLoading:!0}),{data:g,isLoading:f}=p,b=C.useCallback(()=>{n(t,c).then(R=>{m(()=>({data:R,isLoading:!1}))}).catch(()=>m(R=>({...R,isLoading:!1})))},[e]);if(C.useEffect(()=>{b()},[]),f||!g)return d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});s&&!r&&(r={text:l.formatMessage({id:`card_cta_${t.contentType}`}),onClick:s});const{contentType:y}=g;if(!y||!Oa[y])return d.jsx(wt,{element:"li",className:"card-wrapper"});const{basePath:x="",className:A,length:k,gtmEvent:w}=Oa[y];let F=g.slug?`${x}${g.slug}`:!1;g.slug&&(g.slug.slice(0,4)==="http"||g.slug.slice(0,2)==="//"||g.slug.slice(0,6)==="mailto"||g.slug.slice(0,3)==="tel")&&(F=g.slug);const S=R=>{F&&(R.preventDefault(),R.stopPropagation(),window.location.href=F)},z={...fw,...k};let N={className:"card"},$={};return F&&($={href:F,className:"gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${w}-click`,"data-testid":"link"},g.openInNewTab&&($.target="_blank"),N={onClick:S,className:"card gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${w}-click`}),o&&(N={...N,tabIndex:"0"},(I=h==null?void 0:h.current)==null||I.focus(),(E=h==null?void 0:h.current)==null||E.scrollIntoView({behavior:"smooth"})),d.jsx("li",{className:Y("card-wrapper text-medium",A,i,{"has-link":F,"no-link":!F,"has-image":g.banner}),"data-testid":`${y}-card`,children:d.jsxs("div",{...N,ref:h,children:[d.jsx(Ic,{className:"card-label",contentType:y,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),y==="communityPage"&&(g==null?void 0:g.createdAt)&&Sh(g==null?void 0:g.createdAt,60)&&d.jsx(hn,{size:"small",variant:"information","data-testid":"new-community",children:l.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&d.jsx(hn,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?l.formatMessage({id:"card_ended"}):Oc(g.startDate)}),g.banner?d.jsxs("p",{className:"img",children:[g.registered&&d.jsx(hn,{size:"small",variant:"registered",children:l.formatMessage({id:"card_registered"})}),d.jsx(er,{image:{...g.banner,description:""}})]}):A==="people"?d.jsx(sn,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&d.jsx(zs,{contributors:{data:g.contributors},styling:{size:"small",showGap:A!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(y)?l.formatMessage({id:`card_contributors_${y}`}):void 0,"data-testid":"contributors"}),g.partner&&d.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?l.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):Hn(g.partner[0],z.partner)}),["title","text","secondaryText"].map(R=>{const W=g[R];if(!W)return null;const X=Bc(R),G={key:R,className:X,"data-testid":X},D={wrapper:"p",forceWrapper:!0,forceInline:!0},H=Hn(W,z[R]);return["title","text"].includes(R)&&F?(D.wrapper="a",d.jsx("p",{...G,children:d.jsx(Pt,{options:D,...$,children:H})})):d.jsx(Pt,{options:D,...G,children:H})}),(u==null?void 0:u.id)&&(g==null?void 0:g.members)&&d.jsxs("span",{className:"member-information",children:[((B=g==null?void 0:g.members)==null?void 0:B.isMember)&&d.jsx(hn,{size:"small",variant:"registered",icon:((T=g==null?void 0:g.members)==null?void 0:T.memberType)==="owner"?"user":"tick",children:l.formatMessage({id:`card_member_type_${(M=g==null?void 0:g.members)==null?void 0:M.memberType}`})}),d.jsx("br",{}),d.jsx("span",{className:"label member-count",children:l.formatMessage({id:"card_member_count"},{count:g==null?void 0:g.members.count})})]}),d.jsx(cw,{type:A||"",data:g}),d.jsx(dw,{data:g,cta:r,link:F||"",gtmContext:a})]})})};const Hf=({cards:e,cardTypes:t,className:n="",...r})=>d.jsx("ul",{className:Y("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return d.jsx(Co,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),hw=(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},mw=({id:e,title:t})=>{const n=ue.useIntl();if(!t||!t.text)return null;const{text:r,element:a="h2",variant:i="default",size:s="medium",link:o}=t;return C.createElement(a,{className:Y("title",i,s,{"highlighted-title":i==="highlighted"}),children:d.jsxs(d.Fragment,{children:[r,o&&d.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const Li={fourCards:1024,threeCards:769,twoCards:480};let na=null;const pw=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=ue.useIntl(),[u,c]=C.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=u,[m,g]=C.useState({currentPage:0,loadedPages:[0]}),{currentPage:f,loadedPages:b}=m,[y,x]=C.useState(""),A=t.length,k=Math.ceil(A/h),w=C.useRef(null),F=Jn(!0,!0,w==null?void 0:w.current);C.useEffect(()=>{let E=1;F&&(F>=Li.fourCards?E=4:F>=Li.threeCards?E=3:F>=Li.twoCards&&(E=2),E>A&&(E=A)),c(B=>({...B,cardsPerPage:E,isLoading:!1}))},[F,A]);const S=(E="next")=>{let B=f;if(typeof E=="string")if(E==="next")if(f<k-1)B=f+1;else return;else if(f>0)B=f-1;else return;else B=E;g(M=>({...M,currentPage:B,loadedPages:[...new Set([...b,B])]}));const T=()=>{const M=B*u.cardsPerPage,R=M+u.cardsPerPage;return t.slice(M,R).length};x(l.formatMessage({id:"carousel_pagination_aria_live"},{direction:E,count:T()}))},z=E=>{na=E.touches[0].clientX},N=E=>{if(na===null)return;const B=E.touches[0].clientX,T=na-B;T>5?S("next"):T<-5&&S("previous"),na=null},$={"--width":`${F||0}px`,"--total-cards":A,"--cards-per-page":h,"--page":f};if(p)return d.jsx($s,{layout:`carousel${a?"-with-title":""}`});const I=(E,B)=>{var M;let T=null;return(M=E==null?void 0:E.sys)!=null&&M.id?T=`card-${E.sys.id}`:E!=null&&E.slug?T=`card-${E.slug}`:[n[B],E.contentType].includes("customCard")&&(T=`card-${window.btoa(`${E.title} ${E.createdAt}`)}-${B}`),T};return d.jsxs("section",{ref:w,className:Y("carousel-wrapper",i),"data-testid":"carousel",children:[d.jsx(mw,{id:e,title:a}),d.jsx("ul",{className:"carousel",onTouchStart:z,onTouchMove:N,style:$,"data-testid":"carousel-list",children:t.map((E,B)=>{let T=I(E,B);return T&&hw(B,h,f,b)?d.jsx(Co,{id:T,card:{...E,contentType:n[B]},buildCardData:r,gtmContext:s,...o},T):(T=T||`${e}-card-${B}`,d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},T))})}),k<=1?null:d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[d.jsx("li",{className:"arrow previous",children:d.jsx(_e,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:E=>{E.preventDefault(),E.stopPropagation(),S("previous")},screenreaderText:l.formatMessage({id:"carousel_pagination_previous"}),disabled:f<=0})}),[...Array(k)].map((E,B)=>d.jsx("li",{"data-testid":"carousel-controls-button",children:d.jsx("button",{className:Y("page-indicator",{selected:B===f}),onClick:T=>{T.preventDefault(),T.stopPropagation(),S(B)},children:d.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:"carousel_pagination_page"},{number:B+1,total:k})})})},`page-indicator-${B}`)),d.jsx("li",{className:"arrow next",children:d.jsx(_e,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:E=>{E.preventDefault(),E.stopPropagation(),S("next")},screenreaderText:l.formatMessage({id:"carousel_pagination_next"}),disabled:f>=k-1})})]}),d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})]})},gw=({carousels:e=[],isLoading:t,title:n,className:r="",...a})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const c=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?d.jsxs(C.Fragment,{children:[d.jsx($s,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:d.jsx(tn,{})]},`placeholder-${c}`):d.jsxs(C.Fragment,{children:[d.jsx(pw,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:d.jsx(tn,{})]},`carousel-${c}`)});const dr="joinCommunityButton",xo=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=C.useContext(Kt),l=o&&typeof o.id=="string",u=r||!l,[c,h]=C.useState(e),[p,m]=C.useState(e?"joined":"notJoined");C.useEffect(()=>{p==="joining"?m("joined"):p==="leaving"&&m("notJoined")},[c]);const g={},f={};return c&&p!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${dr}_leave`}),g["aria-label"]=s.formatMessage({id:`${dr}_member_aria`}),f["aria-hidden"]="true"),d.jsx(_e,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&p!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${dr}_closed_tooltip`}):"",onClick:async b=>{if(u)return;b.currentTarget.blur(),m(c?"leaving":"joining");const y=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${dr}_aria_live`},{action:c?"leaving":"joining"})}});document.dispatchEvent(y);const x=c?i:a;typeof x=="function"&&setTimeout(async()=>{await x()},500),h(!c)},className:Y("join-community-button",p,{active:p==="joining"}),disabled:u,"data-testid":"join-button",...g,children:d.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${dr}${["joining","leaving"].includes(p)?`_${p}`:c?"_member":n?"_short":""}`})})})};const zi="communityDetails_",vw=({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=ue.useIntl(),u=5,c=a||i.length,h=i.length?i:Array(u).fill({}),p=`/communities/${r}/members`===window.location.pathname,m=t||n,g=!n&&!t;return d.jsxs("div",{className:Y("community-details",e),children:[m&&d.jsxs("div",{className:"member-details",children:[d.jsxs("div",{className:"top",children:[d.jsxs("h4",{children:[l.formatMessage({id:`${zi}members`}),d.jsx("span",{className:"count",children:c})]}),!p&&d.jsx("p",{className:"text-small",children:d.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${zi}viewAll`})})})]}),d.jsx(zs,{contributors:{total:a,data:h},styling:{size:"medium",showGap:!0,showPlaceholders:c===0},cutoff:u})]}),d.jsx(xo,{isMember:t,isOpen:n,disabled:g,functions:{...o}}),t&&d.jsx(_e,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${zi}invite`})})]})};const bw=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Me,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),d.jsx("ul",{className:Y("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),d.jsxs("li",{children:[s&&d.jsx(Me,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),d.jsx(_n,{href:s?void 0:i,...l,children:Hn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const yw=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=ue.useIntl(),s=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,l]=C.useState(t?["all"]:[]),u=(c,h)=>{let p=[];o.includes(c)?p=o.filter(m=>m!==c):c==="all"?p=["all"]:n?p=[...o.filter(m=>m!=="all"),c]:p=[c],l(m=>(r&&typeof r=="function"&&r({current:p,previous:m}),p)),h&&typeof h=="function"&&h()};return d.jsx("ul",{className:Y("filters",a),children:s.map(({id:c,text:h,disabled:p=!1,callback:m=()=>{}})=>{let g={};return p&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),d.jsx("li",{children:d.jsx("button",{className:Y(c,{selected:o.includes(c)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(c,m)},...g,children:h})},c)})})},Dw=(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_",Cw=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=ue.useIntl(),{updateLanguage:c=()=>{}}=C.useContext(bo),[h,p]=C.useState(e);if(C.useEffect(()=>{e!==h&&p(e)},[e]),!r||!Object.values(r).some(b=>b&&b.post_name))return null;const g=Object.keys(r),f=h!==e;return d.jsxs("div",{className:Y("language-switcher text-small",s,l),children:[d.jsxs("nav",{children:[s!=="short"&&d.jsx("p",{children:o||u.formatMessage({id:`${ra}label`})}),d.jsx("ul",{children:g.map(b=>{var A;if(!va[b])return null;const y=(A=r[b])==null?void 0:A.post_name;let x={className:b};if(h===b)x["aria-label"]=u.formatMessage({id:`${ra}selected`},{language:va[b]});else{const k=Dw(b,y,i);x={...x,href:typeof k=="string"?k:k.url,onClick:w=>{p(b),c(b),typeof a<"u"&&(w.preventDefault(),w.stopPropagation(),a(b,typeof k=="string"?k:k.urlForRouter))}}}return d.jsx("li",{children:d.jsx(_n,{...x,fallbackElement:"span",children:va[b]})},b)})}),s!=="short"&&!f&&d.jsx("p",{children:u.formatMessage({id:`${ra}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&d.jsx("small",{children:u.formatMessage({id:`${ra}disclaimer`},{email:Nn.support,link:b=>{const y=`mailto:${b}`;return d.jsx("a",{href:y,children:b})}})})]})};const qi=ue.createIntl({locale:"en",messages:Xn}),Mr=({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:qi.formatMessage({id:"loadMore_button"}),endOfFeed:qi.formatMessage({id:"loadMore_endOfFeed"}),error:qi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,h]=C.useState(""),p=async m=>{if(!n)try{await t(m)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:d.jsx("footer",{className:Y("load-more",l),children:!c&&e?d.jsx(_e,{variant:r,size:a,styling:i,icon:s,onClick:p,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?d.jsx("p",{children:o.endOfFeed}):c&&d.jsx("p",{className:"error",children:o.error})})};const wo=({variant:e="default",version:t="default",className:n="",...r})=>d.jsx("p",{className:"logo-wrapper",children:d.jsx("a",{href:"/home/",className:Y("logo",e,t,n),...r,children:d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"apolitical"})})})});let aa=!1;const Uf=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=ue.useIntl(),i=C.useRef(null),[s,o]=C.useState(!1),l=u=>{i.current&&u.target instanceof HTMLElement&&!i.current.contains(u.target)&&o(!1)};return C.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),C.createElement(e,{ref:i,className:Y("more-menu text-medium",r),children:d.jsxs(d.Fragment,{children:[d.jsx(_e,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:a.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),d.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:h,icon:p,...m},g)=>{const f={...m,onClick:b=>{o(!1),typeof c=="function"&&c(b)},onFocus:()=>{aa&&(clearTimeout(aa),aa=!1)},onBlur:()=>{aa=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),d.jsx("li",{className:"more-menu-list-item",children:d.jsx(_e,{variant:"tertiary",size:"medium",icon:p?{icon:p,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},xw=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const ww=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],Vf=({activeLink:e})=>{const t=ue.useIntl(),n=C.useContext(Kt),r=n&&typeof n.id=="string";return d.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[ww.map(({key:a,href:i})=>{const s=xw(i,e),o={};return s&&(o["aria-current"]="page"),d.jsx("li",{className:Y(a,{active:s}),children:d.jsx("a",{href:i,"data-gtm-event-type":`${a}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...o,children:t.formatMessage({id:`navigationMenu_links_${a}`})})},a)}),r&&d.jsx("li",{className:"profile","data-testid":"profile-link",children:d.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[d.jsx(sn,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),d.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},fr=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Ew=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${fr(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(`${fr(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(`${fr(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
158
158
 
159
- ${fr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:fr(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,a)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(a))}];const kw="shareLinks_",_w=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:a="large",variant:i="default",className:s=""})=>{const o=ue.useIntl(),l=Ew({title:e,link:t,referrer:n});return d.jsxs("aside",{className:Y("share-links",a,i,s),children:[d.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),d.jsx("ul",{children:l.map(({key:u,icon:c,url:h,shouldRender:p=!0,onClick:m})=>{if(typeof p=="function"&&!p())return null;const g={};return m&&(g.onClick=f=>m(f,h)),d.jsx("li",{children:d.jsx(ke,{size:a,variant:"tertiary",icon:{icon:c||u},href:h,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${kw}link_${u}`}),...g})},u)})})]})};const Bw=({tabs:e,className:t="",preventLocationChange:n})=>{var p;const r=(m,g,f)=>(m||(m=`panel-${window.btoa(g)}-${f}`),m);let a=e.findIndex(m=>m.current===!0);if(a<0&&(a=0),window.location.hash){const m=window.location.hash.replace("#","");if(e.find(f=>f.id===m)){for(let f=0;f<e.length;f++)if(r(e[f].id,e[f].text,f)===m){a=f;break}}}const[i,s]=C.useState((p=e[a])!=null&&p.id?e[a].id:r(e[a].id,e[a].text,a)),[o,l]=C.useState(""),u=(m,g)=>{switch(m.key){case"ArrowLeft":case"ArrowRight":{m.preventDefault();let f=g;m.key==="ArrowLeft"?g>0?f=g-1:f=e.length-1:m.key==="ArrowRight"&&(g<e.length-1?f=g+1:f=0);const D=r(e[f].id,e[f].text,f),y=document.getElementById(`tab-${D}`);y==null||y.focus(),l(D);break}case"Enter":s(o),window.location.hash=`#${o}`;break}};C.useEffect(()=>{if(e[a].hasCarousel){const m=new CustomEvent("hiddenSectionVisible",{detail:{id:i}});window.dispatchEvent(m)}},[i]);const c=[],h=[];return e.forEach(({id:m,text:g,content:f,href:D,hasCarousel:y},x)=>{m=r(m,g,x);const A=i===m,_={};D||(_["aria-controls"]=m,_.onClick=E=>{E.preventDefault(),E.stopPropagation(),s(m),!n&&(window.location.hash=`#${m}`)},h.push(d.jsx("section",{id:m,hidden:!A,role:"tabpanel","aria-labelledby":`tab-${m}`,"aria-live":A?"assertive":"off",children:typeof f=="string"?d.jsx("p",{children:f}):f},`section-${m}`))),c.push(d.jsx("li",{"data-testid":"navigation-tab",children:d.jsx("a",{href:D||`#${m}`,id:`tab-${m}`,"aria-controls":m,className:Y({selected:A}),role:"tab",tabIndex:A?0:-1,"aria-selected":A,onKeyDown:E=>u(E,x),..._,children:g})},`tab-${m}`))}),d.jsxs("div",{className:Y("tabs-wrapper",t),children:[d.jsx("ul",{className:"tabs",role:"tablist",children:c}),d.jsx("div",{className:"tab-content",children:h})]})};const Aw={"2-1":901,"1-3":769,"1-1":769},Kf=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:a})=>{const i=Jn(!0);let s=a;return C.Children.count(a)===1&&(s=C.Children.toArray(a)[0],s.props&&(s=s.props.children)),d.jsx("section",{className:Y("columns",`layout-${e}`,r,{"has-containers":n}),children:C.Children.map(s,(o,l)=>t!==!1&&l===t&&i&&i<Aw[e]?null:o)})};let qi;const Wi="contactFooter_",Fw=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=C.useRef(null),[r,a]=C.useState(0),[i,s]=C.useState(!1),o=()=>{n.current&&a(n.current.clientHeight)},l=()=>{i||(s(!0),clearTimeout(qi),qi=setTimeout(()=>{o(),s(!1)},500))};return C.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(qi),window.removeEventListener("resize",l)}),[]),d.jsx(ln,{id:"contactForm",className:"contact-footer",children:d.jsxs("div",{className:"inner-wrapper",children:[d.jsx("h2",{children:d.jsx(ue.FormattedMessage,{id:`${Wi}title`})}),d.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[d.jsxs("aside",{children:[d.jsx("p",{children:d.jsx(ue.FormattedMessage,{id:`${Wi}text`})}),d.jsx(_n,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:d.jsx(ue.FormattedMessage,{id:`${Wi}email`})})]}),d.jsx(xf,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Tw=({activeLink:e,...t})=>d.jsx(ln,{children:d.jsx(Kf,{layout:"1-3",children:d.jsxs(d.Fragment,{children:[d.jsx(Vf,{activeLink:e}),d.jsx(qc,{...t})]})})});const Hi="cookieBanner_",Ui=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Vi=new Date(Date.now()+12*30*24*60*60*1e3),Zf=()=>{const e=ue.useIntl(),[t,n,r]=Os.useCookies(Ui),[a,i]=C.useState(!t["apol-cookie-banner"]),s=()=>{Ui.forEach(c=>{n(c,!0,{path:"/",expires:Vi,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Vi}),Ui.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Vi});return}r(c)}),i(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${Hi}buttons_${c.id}`})})}),d.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[d.jsx("h6",{children:e.formatMessage({id:`${Hi}title`})}),d.jsx("p",{children:e.formatMessage({id:`${Hi}text`})}),d.jsx(kn,{buttons:u})]})},zt={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","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-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:Nn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Nn["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:Nn.support,gtmType:"concierge-email-click"},business:{email:Nn.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 zn="footer_",Oa="SiteFooter",sc=({group:e})=>{const t=zt[e].order||[];let n=!1;return"text"in zt[e]&&(n=zt[e].text),d.jsxs(C.Fragment,{children:[d.jsx("p",{className:"pre-title",children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}`})}),Array.isArray(t)&&t.length>0&&d.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:a,gtmType:i}=zt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),d.jsx("li",{children:d.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":i,...s,children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&d.jsx("dl",{className:"text-medium",children:n.order.map(r=>d.jsxs(C.Fragment,{children:[d.jsx("dt",{children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}`})}),d.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&d.jsx("address",{children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}_address`,values:{br:d.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&d.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Eo=()=>d.jsx("div",{id:"footer",children:d.jsxs("div",{className:"wrapper",children:[d.jsx($a,{element:"hr"}),d.jsx(wo,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":"logo-homepage-link"}),d.jsx("footer",{children:["platform","community","company","contact"].map(e=>d.jsxs("div",{className:"group",children:[d.jsx(sc,{group:e}),Object.keys(zt[e]).includes("child")&&d.jsx(sc,{group:zt[e].child})]},e))}),d.jsx("hr",{}),d.jsxs("div",{className:"sub-footer",children:[d.jsx("ul",{children:Array.isArray(zt.social.order)&&zt.social.order.map(e=>{const t=zt.social[e];return d.jsx("li",{className:e,children:d.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":"social-click",children:d.jsx("span",{className:"hidden",children:d.jsx(ue.FormattedMessage,{id:`${zn}social_${e}`})})})},e)})}),d.jsx("small",{children:d.jsx(ue.FormattedMessage,{id:`${zn}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),Ne={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==="account"&&t===!1&&n.navigation===!0)return;const i=Date.now();if(!a&&!t&&Ne.handlerCalled[e]&&i-Ne.handlerCalled[e]<500)return;Ne.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"navigation":o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation > li.parent"));break;case"search":o=document.querySelector("#header .toggle-search-button");break;case"account":o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const a=bc(e[r],t);if(!(typeof a>"u")&&(!n||a[t]&&a[t].includes(n)||a.value&&a.value.includes(n)||a.toString().includes(n)))return e[r]}return e[0].children?Ne.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"navigation":if(n){const u=Ne.findFirstChild(t.current.children,"attributes.aria-controls","navigation");s=Ne.findFirstChild(u.children,"href")}else s=Ne.findFirstChild(t.current.children,"href");break;case"account":if(o=Ne.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=Ne.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(Ne.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ne.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ne.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ne.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},jr={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"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:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},Pa=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=ue.useIntl(),o=bc(jr,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=i===null?l?o.doTrack:!0:i,c=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let p=!1;if(o.href){let x=o.gtmType||`${e}-click`;if(x.includes(".")){const A=x.split("."),_=A[A.length-2];x=`${_==="topics"?`${_}-`:""}${A[A.length-1]}`}p={href:o.href},u&&(p={...p,className:"gtm-trackable","data-gtm-event-type":x,"data-gtm-event-context":"HeaderButtons"}),c&&(p={...p,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const m=o.order&&o.order[0]&&o[o.order[0]],g=m&&o[o.order[0]].order,f=p&&window.location.pathname===o.href;let D={},y={};if(f&&(D={...D,"aria-current":"page"}),m){const x=o.menuId||e,A={onClick:_=>Ne.events.onClick(_,{id:x,callback:a,isOpen:r[x]}),onFocus:()=>Ne.events.onFocus({id:x}),onBlur:()=>Ne.events.onBlur({id:x,callback:a}),onMouseLeave:()=>Ne.events.onBlur({id:x,callback:a}),onMouseEnter:()=>Ne.events.onMouseEnter({id:x,callback:a})};n&&(g&&(D={...A,onKeyPress:_=>{_.key==="Enter"&&Ne.events.onClick(_,{id:x,callback:a,isOpen:r[x]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[x],"aria-controls":x}),y={hidden:x in r?!r[x]:!0}),g||(y={...y,...A})}return d.jsxs("li",{className:Y({[o.className]:o.className,"has-submenu":m,parent:g,active:f}),...D,children:[p?C.createElement(c?ke:"a",p,s.formatMessage({id:h})):s.formatMessage({id:h}),o.order&&d.jsx("ul",{...y,children:o.order.map(x=>{if(!o[x])return null;const A={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[x].order?d.jsxs("li",{className:Y({[o[x].className]:o[x].className}),children:[s.formatMessage({id:`${h}_${x}`}),d.jsx("ul",{children:o[x].order.map(_=>d.jsx(Pa,{id:`${e}.${x}.${_}`,...A},_))})]},x):d.jsx(Pa,{id:`${e}.${x}`,...A},x)})})]},e)};const Sw={height:67,height_desktop:83},ko=({showNavigation:e=!0})=>{const t=ue.useIntl(),n=C.useContext(Kt),r=Jn(!0,!0),a=n&&typeof n.id=="string",i=C.useMemo(()=>Ne.getIsDesktopVersion(a,r),[a,r]),[s,o]=C.useReducer(Or,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:c}=s,h=C.useRef(s);C.useEffect(()=>{h.current=s},[s]),Ec({scrollPosition:Sw[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const f=h.current.menus;!i&&f.navigation||Ne.shouldChangeHeaderIsVisible(!0,f,o)},scrollDown:()=>{const f=h.current.menus;!i&&f.navigation||Ne.shouldChangeHeaderIsVisible(!1,f,o)}}});const p=(f,D,y=!1)=>{Ne.handleMenus({id:f,value:D,menus:h.current.menus,dispatch:o,forceHandle:y})},m=C.useRef(null),g=f=>{f.key==="Escape"&&["navigation","search","account"].forEach(D=>{h.current.menus[D]&&p(D,!1,!0)})};return C.useEffect(()=>{var f;return(f=document.getElementById("header"))==null||f.addEventListener("keydown",g),()=>{var D;(D=document.getElementById("header"))==null||D.removeEventListener("keydown",g)}},[]),Un(()=>{u.navigation&&Ne.autoFocus({menu:"navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u.navigation]),Un(()=>{u.account&&Ne.autoFocus({menu:"account",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u.account]),n&&n.isLoading?null:d.jsxs(d.Fragment,{children:[d.jsxs("nav",{id:"header",className:Y({"logged-in":a,"logged-out":!a,visible:l}),children:[d.jsx(Me,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),d.jsx(wo,{variant:"monochrome"}),e&&d.jsxs(d.Fragment,{children:[!i.navigation&&d.jsx("button",{className:"menu-button gtm-trackable",onClick:f=>{f.preventDefault(),f.stopPropagation(),p("navigation",!u.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u.navigation,"aria-controls":"navigation",children:d.jsx(Me,{children:t.formatMessage({id:`header_menu_${u.navigation?"hide":"show"}`})})}),d.jsx("ul",{ref:m,id:"navigation",hidden:i.navigation||u.account?!1:!u.navigation,"data-showing":!i.navigation&&u.account?"account":"default",children:jr.order.map(f=>d.jsx(Pa,{id:f,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{navigation:u.navigation,account:u.account},callback:p},f))}),!i.search&&d.jsx("button",{className:"search toggle-search-button",onClick:f=>{f.preventDefault(),f.stopPropagation(),p("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:d.jsx(Me,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),d.jsx(Ef,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),a?d.jsxs("button",{className:"account-button",onClick:f=>Ne.events.onClick(f,{id:"account",callback:p,isOpen:u.account}),onMouseEnter:()=>Ne.events.onMouseEnter({id:"account",callback:p}),onMouseLeave:()=>Ne.events.onBlur({id:"account",callback:p}),"aria-haspopup":"true","aria-expanded":u.account,"aria-controls":"navigation",children:[d.jsx(Me,{children:t.formatMessage({id:`header_account_${u.account?"hide":"show"}`})}),d.jsx(sn,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):d.jsx("ul",{className:"sign-in-buttons",children:jr.buttons.order.map(f=>d.jsx(Pa,{id:`buttons.${f}`},f))})]})]}),d.jsx("hr",{id:"content-of-page"}),d.jsx("div",{className:Y("overlay",{open:u.navigation||u.account||!i.search&&u.search})})]})};const jw=()=>{const e=ue.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(ko,{}),d.jsx("div",{id:"content",children:d.jsx(an,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),d.jsx(Eo,{})]})},Yf=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:a={},styling:i={},className:s="",locale:o="en"})=>{const{navigation:l=!0,footer:u=!0}=a,{background:c="default",variant:h="default",circle:p="default",modal:m="default"}=i,g=Cc(),[f,D]=C.useState(""),y=F=>{const{detail:{message:T}}=F;D(T)};C.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",y),()=>{document.removeEventListener("ariaLive",y)}),[g]);const x=oa(e,{locale:o}),A=oa(t,{locale:o}),_=oa(n,{locale:o}),E={};return c!=="default"&&(E[c]=!0),h!=="default"&&(E[h]=!0),p!=="default"&&(E[p]=!0),d.jsx(Ch.ErrorBoundary,{onError:r,fallback:d.jsx(jw,{}),children:d.jsxs(C.Suspense,{fallback:null,children:[d.jsxs("div",{id:"wrapper",className:Y(s,E,{"has-footer":u}),children:[d.jsx(ko,{showNavigation:l}),d.jsxs("main",{id:"content-wrapper",children:[A&&d.jsx("div",{className:Y("additional-content prepended",{"large-modal":m==="large"}),children:A}),C.createElement(c==="bold"?Do:"div",{id:"content",children:x,className:Y({"large-modal":m==="large"})})]}),_&&d.jsx("div",{className:"additional-content appended",children:_}),u&&d.jsx(Eo,{}),d.jsx(Zf,{})]}),f&&d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},oc={default:"tags_",headerTopics:"header_topics_topics_"},Ki={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"},Ow={getTagDetails:e=>{if(e.includes("topic_")){if(e=Ki.topic[e.replace("topic_","")],e){const t=jr.topics.topics[e].href;return t?{id:e,href:t,text:`${oc.headerTopics}${e}`}:null}return null}return Ki[e]?(e=Ki[e],{id:e,text:`${oc.default}${e}`}):null}};const Pw=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=ue.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=Ow.getTagDetails(u);c&&l.push(c)}),l.length<1?null:d.jsx("ul",{className:Y("tags text-small",t,a,{"one-line":n}),children:l.map(u=>{const c=o.formatMessage({id:u.text});return d.jsx("li",{children:u.href&&r?d.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":i,"data-gtm-event-context":s,children:c}):c},u.id)})})};const Nw=({members:{data:e=[],total:t=e.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:a="member",gtmType:i="member-click",className:s=""})=>{const o=ue.useIntl();return e.length===0?null:d.jsxs("div",{className:Y("members-list",s),children:[d.jsxs("h1",{children:[o.formatMessage({id:"membersList"}),d.jsx("span",{className:"count",children:t})]}),d.jsx("ul",{children:e.map((l,u)=>d.jsxs("li",{children:[d.jsx(tr,{member:l,gtmContext:a,gtmType:i}),l.isAdmin&&d.jsx(hn,{children:o.formatMessage({id:"membersList_admin"})})]},u))}),n&&d.jsx(Rr,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:a})]})};const Rw=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:a=!0},graph:i,styling:s={},className:o=""})=>{const l=ue.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=s;return C.createElement(e,{className:Y("course-progression",o,{"highlight-percentage":c,"has-circle-graph":i==="circle"}),children:d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>d.jsx("strong",{children:h}),number:u})}),u<100&&a&&d.jsx(Qa,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),d.jsx(Is,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const Gf=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>C.createElement(e,{className:Y("lesson-name",a),"data-number":`${t}.${n}`,children:r});const Qf=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=ue.useIntl(),o=La(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):Fc(a||"");return d.jsxs("small",{className:Y("content-type",{[e]:e!=="default"}),children:[d.jsx("span",{className:Y("type",n),children:o})," ",t>0&&!r&&d.jsx(Qa,{time:t})," ",i?d.jsx("span",{className:"additional",children:i}):null]})};const Mw=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:c})=>{const h=ue.useIntl(),p="courseStructure_",m=u.toLowerCase().includes("course conclusion");return d.jsxs(za,{className:"course-structure",label:d.jsxs(d.Fragment,{children:[d.jsxs("small",{children:[h.formatMessage({id:`${p}section${m?"_end":""}`},{number:i})," ",!r&&s>=0&&d.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${p}time_completed`}):d.jsx(Qa,{time:s,appendedText:a?h.formatMessage({id:`${p}time_left`}):""})})]}),d.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[d.jsx("p",{children:n}),d.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:f,contentType:D,icon:y,image:x,isIntroduction:A,optional:_,slug:E,subsectionId:F,title:T,type:I})=>{const R=a&&t||A,M={};return x&&(M.style={"--image":`url(${x})`}),d.jsx("li",{className:Y({article:D===hr.ARTICLE,discussion:D===hr.DISCUSSION,quiz:D===hr.QUIZ,completed:g&&D===hr.ARTICLE,locked:!R}),...M,children:d.jsx(_n,{href:R?`/microcourses/en/${o}/${E}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${Ac(T)}`,gtmType:"article-click",children:d.jsxs(d.Fragment,{children:[d.jsx(Gf,{sectionId:i,subsectionId:F,title:T,className:"course-title"})," ",d.jsx(Qf,{completionTime:f,icon:y,optional:_,type:I,children:c&&c[E]&&d.jsx("span",{className:"quiz-score",children:`${c[E]}%`})})]})})},E)})})]})};const Iw=({isComplete:e=!1,onClick:t,...n})=>{const r=ue.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),d.jsx(ke,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:Y("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})};let aa=null;const it="discussion_form_",Ja=({id:e,content:t={type:"response",slugs:{}},userHasPermissions:n=!0,meta:r={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1,showSuccessMessage:!0},placeholder:a,maxLength:i=0,forceShow:s={cancel:!1,error:!1},functions:o={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},listMembers:()=>Promise.resolve([]),props:{create:{projectNames:["questions-answers"]}}},data:l={},gtmContext:u="DiscussionForm"})=>{var $,w,k;const c=ue.useIntl(),h=C.useContext(Kt),[p,m]=C.useState(""),[g,f]=C.useState(r.isEditing&&r.isEditing.text||""),[D,y]=C.useState(s.error||!1),[x,A]=C.useState(!1);if(r.isLoading)return d.jsx(wt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const _=O=>{f(O);let j;!h||!h.id?j=kt(c.formatMessage,`${it}error_loggedOut`,t.type,"action"):n?i>0&&O.length>=i&&(j=`${it}error_tooLong`):j=kt(c.formatMessage,`${it}error_noPermission`,t.type,"action"),j?y(j):D&&y(!1)};let E=`${t.type}-form`;if(t.type==="response"||t.type==="reply"){const O=(($=t.slugs)==null?void 0:$.reply)||((w=t.slugs)==null?void 0:w.answer)||((k=t.slugs)==null?void 0:k.question)||"";O&&(E=`${E}-${O.slice(-15)}`)}e&&(E=`${e}-${E}`);const F=async O=>{var z;if(O.preventDefault(),O.stopPropagation(),!h||!h.id||!n||I)return;aa&&clearTimeout(aa),A("submitting");const j=window.location.pathname;try{let H;switch(t.type){case"post":H=await o.create({content:g});break;case"question":H=await o.create({title:g,authorId:h&&h.id,...(z=o.props)==null?void 0:z.create});break;case"response":H=await o.create({questionSlug:t.slugs.question},{body:g,authorId:h&&h.id,contentPath:j});break;case"reply":H=await o.create({questionSlug:t.slugs.question,answerSlug:t.slugs.answer},{body:g,authorId:h&&h.id,contentPath:j});break;default:break}await jh(1e3),o.callback&&await o.callback(H),aa=setTimeout(()=>{f(""),A("submitted"),m(kt(c.formatMessage,`${it}success`,t.type,"action"));const te=new Event("discussionFormSubmitted");document.dispatchEvent(te),T()},500)}catch(H){const te=H;let J=`${it}error`;te!=null&&te.message.includes("entry already exists")&&(J=kt(c.formatMessage,`${it}error_alreadyExists`,t.type,"action")),te!=null&&te.message.includes("429")?J=kt(c.formatMessage,`${it}error_tooMany`,t.type,"action"):te!=null&&te.message.includes("400")&&(J=`${it}error`),y(J),T()}},T=()=>{aa=setTimeout(()=>{y(!1),A(!1),m("")},5e3)},I=!g||!Lh(g),R=x==="submitting",M=[];return(r.isEditing&&!R||s.cancel)&&M.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:o.handleCancel,className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`cancel-${t.type}-click`,disabled:!s.cancel&&(!h||!h.id||!g),children:c.formatMessage({id:`${it}cancel`})}),M.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:O=>{if(r.isEditing){A("submitting"),o.handleSaveEdit&&o.handleSaveEdit(g);return}F(O)},className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`${r.isEditing?"save":"submit"}-${t.type}-click`,"data-testid":"save-button",disabled:!h||!h.id||!n||I||R||r.isEditing&&g===r.isEditing.text,children:c.formatMessage({id:`${it}${R?r.isEditing?"saving":"posting":r.isEditing?"save":"post"}`})}),d.jsxs(d.Fragment,{children:[d.jsxs("form",{id:E,className:Y("discussion-card discussion-form",{"no-styling":r.isInWrapper&&r.isEditing}),"data-testid":`discussion-${t.type}-form`,children:[(r==null?void 0:r.showTitle)&&!r.isEditing&&["question"].includes(t.type)&&d.jsx("h2",{children:kt(c.formatMessage,`${it}title`,t.type,"action")}),d.jsx(tr,{member:h||"community",gtmContext:u,gtmType:"profile-click"}),d.jsx(Me,{element:"label",showOnFocus:!1,htmlFor:`${E}-input`,children:kt(c.formatMessage,`${it}label`,t.type,"action")}),d.jsx(Cf,{id:`${E}-input`,value:x==="submitting"&&!D?"":g,placeholder:a||kt(c.formatMessage,`${it}placeholder`,t.type,"action"),maxLength:i,functions:{onChange:_,listMembers:o.listMembers},data:l,autoFocus:!!r.isEditing,"aria-invalid":!!D,"aria-errormessage":"error-message"}),d.jsx("small",{children:kt(c.formatMessage,`${it}explainer`,t.type,"action",{a:O=>d.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:O})})}),d.jsx(kn,{buttons:M}),x==="submitted"&&r.showSuccessMessage&&d.jsx(Er,{className:"success","data-testid":"success",children:kt(c.formatMessage,`${it}success`,t.type,"action")}),D&&d.jsx(Er,{id:"error-message",className:"error","data-testid":"error",children:s.error?s.error:typeof D=="string"?D.includes(" ")?D:c.formatMessage({id:D},{action:c.formatMessage({id:`discussion_action_${t.type}`}),maxLength:i}):D})]}),p&&d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:p})]})},_o=({form:e,membershipRequiredToPost:{isMember:t,required:n,join:r,leave:a,notMemberStateText:i}})=>{if(n&&!t)return d.jsx(an,{text:i,button:{breakpoints:{mobile:!0,901:!1},component:d.jsx(xo,{isShort:!0,functions:{join:r,leave:a}})}});const{content:s,functions:o,meta:l,...u}=e;return d.jsx(Ja,{content:{type:(s==null?void 0:s.type)||"reply",slugs:(s==null?void 0:s.slugs)||{}},functions:{...o,create:(o==null?void 0:o.create)||(()=>{})},meta:{...l,isEditing:(l==null?void 0:l.isEditing)||!1,showSuccessMessage:!1},...u,id:`add-post-${u.id||""}`})},$w={showForm:!1},Xa=C.createContext($w),Jf=({children:e})=>{const[t,n]=C.useState({showForm:!1});return d.jsx(Xa.Provider,{value:{...t,updateConversation:n},children:e})},Lw=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),zw=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);const Na=({icon:e,...t})=>d.jsx(ke,{className:"discussion-button",variant:"tertiary",icon:e,...t});let wr=!1;const Zi=()=>{wr!==!1&&(clearTimeout(wr),wr=!1)},Yi=5;let Gi=null;const Xf=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,functions:{createLike:o=()=>{},deleteLike:l=()=>{}}={}})=>{const u=ue.useIntl(),c={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0},[h,p]=C.useReducer(Or,c),{numberOfLikes:m,userLikedContent:g,ignoreInteractions:f,showLikers:D,tabbableLink:y}=h;C.useEffect(()=>{p([{type:"userLikedContent",value:a}])},[a]);const x=C.useMemo(()=>zw(n,Yi),[n]),A=T=>{if(T.preventDefault(),T.stopPropagation(),p([{type:"showLikers",value:!1}]),wr)return Zi(),!1;if(Zi(),f||!s)return!1;wr=setTimeout(_,350)},_=async()=>{if(Zi(),f||!s)return!1;let T=g?m-1:m+1;T<0&&(T=0),p([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:T},{type:"userLikedContent",value:!g}]);try{if(i&&i.slugs){const I=Lw(i.slugs);g?await l(I):await o({...I,payload:{contentPath:window.location.pathname}})}}catch{p([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{p([{type:"ignoreInteractions",value:!1}])}},E=()=>{Gi=setTimeout(()=>{p([{type:"showLikers",value:!1}])},500)},F=()=>{Gi&&clearTimeout(Gi)};return C.createElement(e,{className:"likes-wrapper",onKeyDown:T=>{T.key==="Escape"&&p([{type:"showLikers",value:!1}])},onMouseEnter:()=>{F(),p([{type:"showLikers",value:!0}])},onMouseLeave:()=>{E()}},d.jsxs(d.Fragment,{children:[d.jsx(Na,{className:Y("discussion-button text-medium action-button",{"show-spinner":f,"is-liked":g,disabled:!s}),icon:{icon:g?"heart":"heart_empty",animate:"bounce"},disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${i.type}-click`,onClick:A,screenreaderText:s?u.formatMessage({id:`discussion_likes_${g?"unlike":"like"}`},{action:u.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":g,children:d.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:u.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})})}),n&&d.jsxs(d.Fragment,{children:[d.jsx(Me,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{F()},onBlur:()=>E,onClick:T=>{var R;T.preventDefault(),T.stopPropagation(),F(),p([{type:"showLikers",value:!0}]);const I=(R=T.currentTarget.nextSibling)==null?void 0:R.childNodes[0];if(I){const M=I.querySelector("li:first-child a");M&&(p([{type:"tabbableLink",value:0}]),setTimeout(()=>{M.focus()},100))}},onKeyDown:T=>{T.key==="Escape"&&(T.preventDefault(),T.stopPropagation(),E())},"aria-expanded":D,"aria-controls":`likes-tooltip-${i.slug}`,children:d.jsx(Me,{showOnFocus:!1,children:u.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),d.jsx(En,{id:`likes-tooltip-${i.slug}`,isOpen:D,isLoading:n.length===0,children:n.length&&d.jsxs("ul",{children:[x.map((T,I)=>{if(typeof T=="string"||!T.name)return null;const R={};return y!==I&&(R.tabIndex=-1),d.jsx("li",{"data-index":I,children:d.jsx(_n,{href:T.id?`/profiles/${T.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:M=>M==null?void 0:M.stopPropagation(),onFocus:()=>F(),onKeyDown:M=>{var j,z,H,te;if(!M||!["ArrowUp","ArrowDown"].includes(M.key||""))return;M.stopPropagation(),M.preventDefault();const $=M.key==="ArrowUp"?"up":"down",w=(j=M.currentTarget)==null?void 0:j.parentElement;let k=w==null?void 0:w.nextElementSibling;if($==="up"){const J=w==null?void 0:w.previousElementSibling;J?k=J:(k=(z=w==null?void 0:w.parentElement)==null?void 0:z.lastElementChild,(k==null?void 0:k.getAttribute("data-index"))==="-1"&&(k=k==null?void 0:k.previousElementSibling))}else(!k||(k==null?void 0:k.getAttribute("data-index"))==="-1")&&(k=(H=w==null?void 0:w.parentElement)==null?void 0:H.firstElementChild);if(!k)return;const O=(k==null?void 0:k.getAttribute("data-index"))||"0";p([{type:"tabbableLink",value:O}]),(te=k==null?void 0:k.querySelector("a"))==null||te.focus()},...R,children:T.name})},T.id||window.btoa(T.name))}),t>Yi&&d.jsx("li",{"data-index":"-1",children:u.formatMessage({id:"discussion_likes_more"},{number:t-Yi})})]})})]})]}))},uc=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},Qi=({children:e,class:t,...n})=>{const r={...n,class:Y("subtle",t)};return d.jsx("blockquote",{...r,children:e})},qw=280,Ww=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?Hn(e,qw):e;return a=a.trim(),n?await Nc({text:a,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):a};const Hw=3e3,Uw=({url:e})=>{const t=ue.useIntl(),[n,r]=C.useState({isOpen:!1,isCopied:!1});return d.jsxs("li",{children:[d.jsx(En,{className:Y("tooltip-share-link",{"tooltip-share-link-copied":n.isCopied}),isOpen:n.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:n.isCopied?t.formatMessage({id:"discussion_share_copy_link_success"}):t.formatMessage({id:"discussion_share_copy_link"})}),d.jsx(Na,{icon:{icon:"link_chain"},onMouseOver:()=>r({...n,isOpen:!0}),onFocus:()=>r({...n,isOpen:!0}),onMouseOut:()=>r({isOpen:!1,isCopied:!1}),onBlur:()=>r({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{r({isOpen:!0,isCopied:!0}),setTimeout(()=>{r({isOpen:!1,isCopied:!1})},Hw)})}})]})},Lt="discussion_",Vw=195,Mr=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:a,forceHide:i={actionBar:!1,comments:!1,likes:!1},functions:s,links:o={},className:l,gtmContext:u="DiscussionAnswer",children:c,isTruncated:h=!1,styling:{showShareLinkButton:p=!1}={},setFocus:m=!1})=>{var he,xe,Ae,Fe,Ke,We,He,Qe;const g=ue.useIntl(),f=C.useContext(Kt),D=C.useContext(Xa),{createContent:y=async()=>{},deleteContent:x=async()=>{},updateContent:A=async()=>{}}=s.content||{},{createLike:_=()=>{},deleteLike:E=()=>{}}=s.likes||{},{openComments:F=()=>{}}=s.comments||{},{listMembers:T=()=>Promise.resolve([])}=s.mentions||{},{author:I,canLike:R,createdAt:M,id:$,likes:w=0,userLiked:k,comments:O=0,mentions:j}=t,z=f&&f.id&&typeof I!="string"&&I.id&&I.id===f.id||!1,H=typeof R=="boolean"?R:!0,te=z&&(!t.createdAt||Th(t.createdAt,10,"seconds")),J=C.useRef(null),[v,W]=C.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:""}),[ee,B]=C.useState(!1),[S,q]=C.useState(te?"highlighted":"default"),[L,U]=C.useState("");C.useEffect(()=>{const me=J.current;if(!(!me||S==="default"))return document.addEventListener("discussionFormSubmitted",ne),me.addEventListener("transitionend",re),()=>{document.removeEventListener("discussionFormSubmitted",ne),me.removeEventListener("transitionend",re)}},[]),C.useEffect(()=>{W({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),C.useEffect(()=>{(async()=>{const Te=await Ww(v.body,h,j,T);W({...v,postBody:Te})})()},[v.body,j]);const ne=()=>{setTimeout(()=>{q("fading")},1e3)},re=({propertyName:me})=>{me==="background-color"&&q(Te=>(Te==="default"&&(document.removeEventListener("discussionFormSubmitted",ne),J.current&&J.current.removeEventListener("transitionend",re)),Te==="fading"?"default":Te))};if(r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||v.postBody==="")return d.jsx(wt,{className:"discussion-card discussion-post"});const ae=async me=>{me||(me=""),U("");try{if(!vc(me,v.body)){const Te=t.type==="question"?{title:me}:{body:me};await A(uc(t.slugs),Te)}W({...v,body:me,isEditing:!1,didEdit:!0})}catch{U(`${Lt}form_error`)}},fe=()=>{D&&D.updateConversation&&D.updateConversation({showForm:!0}),setTimeout(()=>{var se,pe,ge;const Te=`reply-form-${(t.type==="answer"?t.slug:((se=t.slugs)==null?void 0:se.reply)||((pe=t.slugs)==null?void 0:pe.answer)||((ge=t.slugs)==null?void 0:ge.question)||"").toLowerCase().slice(-15)}`,$e=document.getElementById(Te),K=document.getElementById(`${Te}-input`);K&&K.focus(),$e&&$e.scrollIntoView({behavior:"smooth"})},0)},X=async()=>{B(!1);try{await x(uc(t.slugs))}catch{U("delete-error")}},be=[{text:g.formatMessage({id:`${Lt}moreMenu_report`}),onClick:me=>{me.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(g.formatMessage({id:`${Lt}report_subject`}))}&body=${encodeURI(g.formatMessage({id:`${Lt}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&&z&&be.push({text:g.formatMessage({id:`${Lt}moreMenu_edit`}),onClick:()=>W({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`edit-${t.type}-click`},{text:g.formatMessage({id:`${Lt}moreMenu_delete`}),onClick:me=>{me.preventDefault(),me.stopPropagation(),B(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`delete-${t.type}-click`,...qf(`delete-${t.slug}-modal`,ee)}),m&&((he=J==null?void 0:J.current)==null||he.focus(),(xe=J==null?void 0:J.current)==null||xe.scrollIntoView({behavior:"smooth"})),C.createElement(e,{className:Y("discussion-post",l,{[S]:!l||!l.includes("highlighted-text-box"),"has-link":o.post&&!v.isEditing}),ref:J,tabIndex:m?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${u}-post-click`,onClick:me=>{!o.post||v.isEditing||(me.preventDefault(),me.stopPropagation(),window.location.href=o.post)},children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{id:$||t.slug,className:Y("discussion-card",t.type,{editing:v.isEditing,"has-link":o.post&&!v.isEditing}),children:[!v.isEditing&&d.jsx(tr,{member:I,additionalContent:{createdAt:M,didEdit:v.didEdit},className:typeof I!="string"&&I.id===a?"highlighted":"",gtmContext:u,gtmType:"profile-click"}),v.isEditing?d.jsx(Ja,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:L!==""&&L!=="delete-error"?g.formatMessage({id:L},{action:g.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:y,handleSaveEdit:ae,handleCancel:()=>{U(""),W({...v,isEditing:!1})},listMembers:T},gtmContext:`${u}Form`,data:{mentions:t.mentions}}):o.post?d.jsxs("a",{href:o.post,children:[(t==null?void 0:t.title)&&d.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),v.postBody.length>Vw?d.jsx(zc,{text:v.postBody,markdownOptions:{overrides:{a:ss,blockquote:{component:Qi}}}}):d.jsx(Vn,{options:{overrides:{a:ss,blockquote:{component:Qi}}},children:v.postBody})]}):d.jsx(Vn,{options:{wrapper:t.type==="question"?"h1":C.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:Qi}}},children:v.postBody}),!v.isEditing&&!(i!=null&&i.actionBar)&&d.jsxs("ul",{className:Y("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!i.likes&&d.jsx(Xf,{element:"li",likes:w,isShort:!1,userLiked:k,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:H,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:_,deleteLike:E}}),!i.comments&&(["question","post"].includes(t.type)||o.comments)&&d.jsx("li",{children:d.jsx(Na,{onClick:me=>{me.preventDefault(),me.stopPropagation(),o.comments&&(window.location.href=o.comments),typeof F=="function"&&F()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":u,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:g.formatMessage({id:`${Lt}comments_screenReader`},{count:O}),children:g.formatMessage({id:`${Lt}comments`},{count:O})})}),(t.type==="answer"||t.type==="reply")&&d.jsx("li",{children:d.jsx(Na,{styling:{muted:!0},onClick:fe,icon:{icon:"speech-bubble_square"},children:g.formatMessage({id:`${Lt}reply`})})}),p&&d.jsx(Uw,{url:(Ae=t.slugs)!=null&&Ae.reply?`${window.location.origin}${(Fe=t.slugs)==null?void 0:Fe.question}/${(Ke=t.slugs)==null?void 0:Ke.answer}#${(We=t.slugs)==null?void 0:We.reply}`:`${window.location.origin}${(He=t.slugs)==null?void 0:He.question}/${(Qe=t.slugs)==null?void 0:Qe.answer}`}),d.jsx(Uf,{element:"li",id:`more-${t.slug}`,options:be})]})]}),c,d.jsx(Nr,{id:`delete-${t.slug}-modal`,isOpen:ee,functions:{onOpen:()=>{},onClose:()=>B(!1)},forceShow:{error:L==="delete-error"?g.formatMessage({id:"discussion_delete_error"},{action:g.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:g.formatMessage({id:"discussion_delete_title"},{action:g.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>B(!1),children:g.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:X,children:g.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:d.jsx(ue.FormattedMessage,{id:"discussion_delete_text",values:{p:me=>d.jsx("p",{children:me}),action:g.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Ji="discussion_responses_",eh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ue.useIntl();return t=parseInt(t),d.jsxs("div",{className:"responses-heading",children:[d.jsx("h4",{children:r.formatMessage({id:`${Ji}title`},{action:r.formatMessage({id:`${Ji}${e}`}),count:t})}),!n&&t===0&&d.jsx("p",{children:kt(r.formatMessage,`${Ji}empty`,e,e)})]})};const th=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=ue.useIntl(),s=C.useContext(Xa),o=oa(a,{element:"li"});return d.jsxs("div",{className:Y("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&d.jsx("ul",{className:"thread",children:o}),!e&&d.jsx(Rr,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:i.formatMessage({id:"discussion_thread_loadMore"}),error:i.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&d.jsx(Ja,{...r})]})},Kw="post",Zw="reply",nh="00000000-0000-0000-0000-000000000000";function Bo({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function Ao({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return e.setQueryData(t,r),a}return n}function Yw(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function Gw(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function rh(e){const{id:t="",name:n="",organization:r="",jobTitle:a="",image:i={}}=e,{thumbnail:s=""}=i;return{id:t,data:{name:n,organization:r,jobTitle:a,thumbnail:s}}}function Qw({content:e}){return{content:e,id:nh,time:new Date().toISOString(),verb:Kw}}function lc({activity:e,user:t}){return{...e,actor:rh(t),...Yw()}}function Ra({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 ah({activity:e,user:t}){var n,r,a;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((a=e.own_reactions)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}function Jw({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:nh,kind:Zw,parent:t||""}}function cc({reply:e,user:t}){const n=rh(t);return{...e,user_id:n.id,user:n,...Gw()}}function dc({reply:e,reaction:t}){var n,r,a;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((a=e.own_children)==null?void 0:a.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function Xw({reply:e,user:t}){var n,r,a;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_children={...e.own_children||{},like:(((a=e.own_children)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}const ih=e=>{const t=new CustomEvent("discussionPostAdded",{detail:e});document.dispatchEvent(t)};let fc,Xi=0;const sh=()=>{C.useEffect(()=>(document.addEventListener("discussionPostAdded",e),()=>{document.removeEventListener("discussionPostAdded",e)}),[]);const e=t=>{const n=t.detail;if(!n)return;clearTimeout(fc);const r=document.getElementById(n);if(r){r.scrollIntoView({behavior:"smooth",block:"start"}),Xi=0;return}Xi++,!(Xi>10)&&(fc=setTimeout(()=>{e(t)},50))}},Qn=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}),rn=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}),oh=Object.freeze({actor:`SU:${Qn.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),eE=Object.freeze({actor:`SU:${rn.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),tE=Object.freeze({actor:`SU:${Qn.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),nE=Object.freeze({actor:`SU:${rn.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:oh.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:rn.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:rn.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:rn.id,user:{id:rn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:oh.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:Qn.id,user:{id:Qn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:eE.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:rn.id,user:{id:rn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:tE.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Qn.id,user:{id:Qn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:nE.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function rE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ve.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=lc({activity:Qw(o),user:i});return hc(u,l)}),onError:n,onSuccess:(o,l,u)=>{const c=lc({activity:o,user:i});r.setQueryData(a,hc(c,u,!0)),setTimeout(()=>{ih(c.id)},0)}});return s}function aE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=Ma(a,s);return o&&(o.content=i),s}),onError:n});return r}function iE({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ve.useQueryClient(),l=Ga(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Bo(u),mutate:Ao(u)},user:l,...u},h=rE({...c,mutationFn:e}),p=aE({...c,mutationFn:t}),m=sE({...c,mutationFn:n}),g=uE({...c,mutationFn:a}),f=lE({...c,mutationFn:i}),{activities:D,...y}=oE({queryKey:s,queryFn:r});return{activities:D,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...y}}function sE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ve.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Ma(s,o);return l&&Ra({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Ma(o,l);u&&Ra({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function oE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ve.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:null},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{activities:dE(n),error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function uE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>cE(a,i)),onError:n});return r}function lE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ve.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Ma(i,s);return o&&ah({activity:o,user:r}),s}),onError:n});return a}function hc(e,t,n=!1){return t?(n?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t):{pages:[{next:"",results:[e]}],pageParams:[""]}}function Ma(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function cE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function dE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,{results:r})=>[...n,...r],[]))||[]}const fE=({basePath:e,parentId:t,isMember:n,functions:{activities:r,mentions:a,join:i,leave:s}})=>{const o=ue.useIntl(),{activities:l,error:u,fetchNextPage:c,hasNextPage:h,isLoading:p,mutations:{create:m,edit:g,remove:f,like:D,unlike:y}}=iE({queryKey:[e,t,"activities"],queryFns:r}),[x,A]=C.useState(null),_=()=>{A(l.length),c()};return sh(),u?d.jsx(an,{variant:"error",text:u.message}):d.jsxs("section",{children:[d.jsx(_o,{form:{content:{type:"post",slugs:{}},functions:{create:m,listMembers:a.listMembers},meta:{isEditing:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:i,leave:s,notMemberStateText:o.formatMessage({id:"community_joinToPost"})}}),l==null?void 0:l.map((E,F)=>{var H,te,J,v,W,ee,B,S;const{id:T,own_reactions:I,latest_reactions:R,reaction_counts:M,mentioned_users:$}=E,w=(((H=R==null?void 0:R.like)==null?void 0:H.length)||0)>0,k=(((te=I==null?void 0:I.like)==null?void 0:te.length)||0)>0,O=k?I==null?void 0:I.like[0].id:"",j=w?(J=R==null?void 0:R.like)==null?void 0:J.map(q=>{var L,U,ne;return{id:(L=q==null?void 0:q.user)==null?void 0:L.id,name:(ne=(U=q==null?void 0:q.user)==null?void 0:U.data)==null?void 0:ne.name}}):!1,z=E==null?void 0:E.actor;return d.jsx(C.Fragment,{children:d.jsx(Mr,{content:{type:"post",title:E==null?void 0:E.title,body:E==null?void 0:E.content,canLike:n,createdAt:(E==null?void 0:E.time)||"",slugs:{question:`${e}/${t}`,answer:T},slug:T,author:{id:z==null?void 0:z.id,name:(v=z==null?void 0:z.data)==null?void 0:v.name,organization:(W=z==null?void 0:z.data)==null?void 0:W.organization,jobTitle:(ee=z==null?void 0:z.data)==null?void 0:ee.jobTitle,location:(B=z==null?void 0:z.data)==null?void 0:B.location,image:{thumbnail:((S=z==null?void 0:z.data)==null?void 0:S.thumbnail)||void 0}},userLiked:k,likes:(M==null?void 0:M.like)||0,comments:(M==null?void 0:M.reply)||0,peopleWhoLiked:j,mentions:$},links:{post:`${e}/${t}/${T}`,comments:`${e}/${t}/${T}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>f({activityId:T}),updateContent:(q,{body:L})=>g({activityId:T,content:L})},likes:{createLike:()=>D({activityId:T}),deleteLike:()=>y({activityId:T,reactionId:O})},comments:{openComments:()=>null},mentions:a},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:F===x})},T)}),!p&&d.jsx(Rr,{hasNextPage:h,loadNextPage:_,icon:{icon:"arrow-down",position:"right"},messages:{button:o.formatMessage({id:"loadMore_button"}),error:o.formatMessage({id:"loadMore_error"})}})]})},hE={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function mE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ve.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=cc({reply:Jw(o),user:i});return mc(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=cc({reply:o,user:i});r.setQueryData(a,mc(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{ih(c.id)},0)}});return s}function pE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=Ia(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function uh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ve.useQueryClient(),l=Ga(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Bo(u),mutate:Ao(u)},user:l,...u},h=mE({...c,mutationFn:e}),p=pE({...c,mutationFn:t}),m=gE({...c,mutationFn:n}),g=bE({...c,mutationFn:a}),f=yE({...c,mutationFn:i}),{replies:D,...y}=vE({queryKey:s,queryFn:r});return{replies:D,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...y}}function gE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ve.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Ia(s,o);return l&&dc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Ia(o,l);u&&dc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function vE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ve.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:u=>(u==null?void 0:u.next)||null}),o=EE(n),l=`${o.length||0}${i?"+":""}`;return{replies:o,repliesCount:l,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function bE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>wE(a,i)),onError:n});return r}function yE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ve.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=Ia(i,s);return o&&Xw({reply:o,user:r}),s}),onError:n});return a}function DE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function CE(e,t,n){const r=t.pages.length-1,a=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[a]=e:t.pages[r].results.push(e),t}function xE(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function mc(e,t,n){return t?n!=null&&n.append?CE(e,t,n):xE(e,t,n):DE(e)}function Ia(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function wE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function EE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const kE=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:i})=>{const s=ue.useIntl(),o=3,{replies:l,fetchNextPage:u,hasNextPage:c,isLoading:h,mutations:{create:p,edit:m,like:g,remove:f,unlike:D},user:y}=uh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:_=>i.list({..._,reactionId:r})}});Ps([h]);const[x,A]=C.useState(!0);return d.jsxs(d.Fragment,{children:[(l==null?void 0:l.length)>=o&&d.jsx(ke,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${x?"up_left":"down_right"}`,position:"left"},onClick:()=>A(!x),children:s.formatMessage({id:`discussion_thread_${x?"hide":"show"}`},{count:l==null?void 0:l.length})}),x&&d.jsx(th,{loadMore:{isLoading:h,hasNextPage:c,loadNextPage:()=>u()},form:{content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(_,{body:E})=>p({activityId:n,replyId:r,content:E}),listMembers:i.listMembers},meta:{isEditing:!1,showSuccessMessage:!1}},children:l&&l.length>0?l==null?void 0:l.map(_=>{var te,J,v,W,ee,B,S,q,L,U,ne,re;const{id:E,own_children:F,latest_children:T,children_counts:I,data:{mentioned_users:R}}=_,$=(((te=F==null?void 0:F.like)==null?void 0:te.length)||0)>0?(J=F==null?void 0:F.like)==null?void 0:J.find(ae=>{var fe;return((fe=ae==null?void 0:ae.user)==null?void 0:fe.id)===(y==null?void 0:y.id)}):!1,w=$?$==null?void 0:$.id:"",k=!!$,j=(((v=T==null?void 0:T.like)==null?void 0:v.length)||0)>0?(W=T==null?void 0:T.like)==null?void 0:W.map(ae=>{var fe,X,be;return{id:(fe=ae==null?void 0:ae.user)==null?void 0:fe.id,name:(be=(X=ae==null?void 0:ae.user)==null?void 0:X.data)==null?void 0:be.name}}):!1,z=_==null?void 0:_.user,H=typeof _.data.content=="string"?(ee=_==null?void 0:_.data)==null?void 0:ee.content:((S=(B=_==null?void 0:_.data)==null?void 0:B.content)==null?void 0:S.text)||"";return d.jsx(Mr,{content:{id:E,type:"reply",body:H,canLike:a,createdAt:_==null?void 0:_.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:_==null?void 0:_.parent},slug:"",author:{id:z==null?void 0:z.id,name:(q=z.data)==null?void 0:q.name,organization:(L=z.data)==null?void 0:L.organization,jobTitle:(U=z.data)==null?void 0:U.jobTitle,location:(ne=z.data)==null?void 0:ne.location,image:{thumbnail:((re=z.data)==null?void 0:re.thumbnail)||void 0}},userLiked:k,likes:(I==null?void 0:I.like)||0,peopleWhoLiked:j,mentions:R},functions:{content:{createContent:()=>null,deleteContent:()=>f({replyId:E}),updateContent:(ae,{body:fe})=>m({replyId:E,content:fe})},likes:{createLike:()=>g({replyId:E}),deleteLike:()=>D({replyId:E,reactionId:w})},comments:{},mentions:{listMembers:i.listMembers}},styling:{showShareLinkButton:!0}},E)}):null})]})};const lh=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:a,mentions:i,join:s,leave:o}})=>{const l=ue.useIntl(),{replies:u,repliesCount:c,fetchNextPage:h,hasNextPage:p,isLoading:m,mutations:{create:g,edit:f,like:D,remove:y,unlike:x},user:A}=uh({queryKey:[e,t,n,"replies"],queryFns:a}),_=()=>{F(u.length),h()},[E,F]=C.useState(null);return Ps([m]),sh(),d.jsxs("section",{className:"replies-feed",children:[d.jsx(eh,{type:"comment",responses:c,isLoading:m}),d.jsx(_o,{form:{content:{type:"reply",slugs:{}},functions:{create:(T,{body:I})=>g({activityId:n,content:I}),...i},meta:{isEditing:!1,showSuccessMessage:!1},placeholder:l.formatMessage({id:"discussion_responses_placeholder"})},membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:l.formatMessage({id:"community_joinToPost"})}}),u==null?void 0:u.map((T,I)=>{var ee,B,S,q,L,U,ne,re,ae,fe,X,be;const{id:R,own_children:M,latest_children:$,children_counts:w,data:{mentioned_users:k}}=T,j=(((ee=M==null?void 0:M.like)==null?void 0:ee.length)||0)>0?(B=M==null?void 0:M.like)==null?void 0:B.find(he=>{var xe;return((xe=he==null?void 0:he.user)==null?void 0:xe.id)===(A==null?void 0:A.id)}):!1,z=j?j==null?void 0:j.id:"",H=!!j,J=(((S=$==null?void 0:$.like)==null?void 0:S.length)||0)>0?(q=$==null?void 0:$.like)==null?void 0:q.map(he=>{var xe,Ae,Fe;return{id:(xe=he==null?void 0:he.user)==null?void 0:xe.id,name:(Fe=(Ae=he==null?void 0:he.user)==null?void 0:Ae.data)==null?void 0:Fe.name}}):!1,v=T==null?void 0:T.user,W=typeof T.data.content=="string"?(L=T==null?void 0:T.data)==null?void 0:L.content:((ne=(U=T==null?void 0:T.data)==null?void 0:U.content)==null?void 0:ne.text)||"";return d.jsx(Jf,{children:d.jsx(Mr,{content:{id:R,type:"reply",body:W,canLike:r,createdAt:T==null?void 0:T.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:R},slug:R,author:{id:v==null?void 0:v.id,name:(re=v.data)==null?void 0:re.name,organization:(ae=v.data)==null?void 0:ae.organization,jobTitle:(fe=v.data)==null?void 0:fe.jobTitle,location:(X=v.data)==null?void 0:X.location,image:{thumbnail:((be=v.data)==null?void 0:be.thumbnail)||void 0}},userLiked:H,likes:(w==null?void 0:w.like)||0,peopleWhoLiked:J,mentions:k},functions:{content:{createContent:()=>null,deleteContent:()=>y({replyId:R}),updateContent:(he,{body:xe})=>f({replyId:R,content:xe})},likes:{createLike:()=>D({replyId:R}),deleteLike:()=>x({replyId:R,reactionId:z})},comments:{},mentions:i},children:d.jsx(kE,{basePath:e,parentId:t,activityId:n,replyId:R,isMember:r,functions:{...a,...i}}),styling:{showShareLinkButton:!0},setFocus:I===E},R)},R)}),!m&&d.jsx(Rr,{hasNextPage:p,loadNextPage:_,icon:{icon:"arrow-down",position:"right"},messages:{button:l.formatMessage({id:"loadMore_button"}),error:l.formatMessage({id:"loadMore_error"})}})]})};function _E({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({content:a})=>t(i=>(i&&(i.content=a),i)),onError:n});return r}function BE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=Ve.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function AE({queryFns:{read:e,edit:t,like:n,unlike:r},queryKey:a}){const i=Ve.useQueryClient(),s=Ga(),o={queryClient:i,queryKey:a},l={mutationHandlers:{error:Bo(o),mutate:Ao(o)},user:s,...o},u=_E({...l,mutationFn:t}),c=FE({...l,mutationFn:n}),h=TE({...l,mutationFn:r}),{activity:p,...m}=BE({queryKey:a,queryFn:e});return{activity:p,mutations:{edit:u,like:c,unlike:h},user:s,...m}}function FE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ve.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ra({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ra({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function TE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ve.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&ah({activity:s,user:r}),s)),onError:n});return a}const SE=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{activities:{remove:a,...i},reactions:s,mentions:o,join:l,leave:u}})=>{var R,M,$,w,k,O,j,z,H,te;const c=ue.useIntl(),{activity:h,error:p,isLoading:m,mutations:{edit:g,like:f,unlike:D}}=AE({queryFns:i,queryKey:[e,t,n]});if(m)return d.jsx(wt,{style:{height:"400px"}});if(p||!h)return d.jsx(an,{variant:"error",text:c.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:y,latest_reactions:x,mentioned_users:A}=h,_=(((R=x==null?void 0:x.like)==null?void 0:R.length)||0)>0,E=(((M=y==null?void 0:y.like)==null?void 0:M.length)||0)>0,F=E?y==null?void 0:y.like[0].id:"",T=_?($=x==null?void 0:x.like)==null?void 0:$.map(J=>{var v,W,ee;return{id:(v=J==null?void 0:J.user)==null?void 0:v.id,name:(ee=(W=J==null?void 0:J.user)==null?void 0:W.data)==null?void 0:ee.name}}):!1,I=h==null?void 0:h.actor;return d.jsxs("section",{className:"activity-section",children:[d.jsx(Mr,{className:"highlighted-text-box subtle",content:{id:n,type:"post",body:h==null?void 0:h.content,canLike:r,createdAt:(h==null?void 0:h.time)||"",slugs:{question:`${e}/${t}`,answer:h==null?void 0:h.id},slug:n,author:{id:I.id,name:(w=I.data)==null?void 0:w.name,organization:(k=I.data)==null?void 0:k.organization,jobTitle:(O=I.data)==null?void 0:O.jobTitle,location:(j=I.data)==null?void 0:j.location,image:{thumbnail:((z=I.data)==null?void 0:z.thumbnail)||void 0}},userLiked:E,likes:((H=h==null?void 0:h.reaction_counts)==null?void 0:H.like)||0,comments:((te=h==null?void 0:h.reaction_counts)==null?void 0:te.reply)||0,peopleWhoLiked:T,mentions:A},originalAuthorId:I==null?void 0:I.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(J,{body:v})=>g({content:v})},likes:{createLike:()=>f({activityId:n}),deleteLike:()=>D({activityId:n,reactionId:F})},comments:{openComments:()=>{}},mentions:o},styling:{showShareLinkButton:!0}},n),d.jsx(lh,{basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:s,mentions:o,join:l,leave:u}})]})},jE=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),pc=[{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 ia="notFoundError_",OE=()=>{const e=ue.useIntl(),t=[];return pc.forEach((n,r)=>{n.title=e.formatMessage({id:`${ia}post_${r+1}`}),t.push("solutionArticle")}),d.jsxs(Yf,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:d.jsxs(ln,{children:[d.jsx(Hf,{cards:pc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),d.jsx(ke,{href:"/solution-articles/",children:e.formatMessage({id:`${ia}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[d.jsx("h1",{children:e.formatMessage({id:`${ia}title`})}),d.jsx("p",{children:e.formatMessage({id:`${ia}text`})})]})};exports.ASSETS_BUCKET=Wt;exports.ActivitiesFeed=fE;exports.ActivitySection=SE;exports.AddPost=_o;exports.Banner=Jx;exports.BannerSection=iw;exports.Breadcrumbs=bw;exports.Buckets=Vh;exports.Button=ke;exports.ButtonWrapper=kn;exports.COURSE_CONTENT_TYPES=hr;exports.CacheProvider=Rf;exports.Card=Co;exports.CardBlock=Hf;exports.Carousel=gw;exports.CharacterLimit=qs;exports.CollapsibleSection=za;exports.Columns=Kf;exports.CommunityDetails=vw;exports.ContactFooter=Fw;exports.ContactForm=xf;exports.ContentTypeLabel=Ic;exports.Contributors=zs;exports.ConversationContext=Xa;exports.CookieBanner=Zf;exports.CourseProgression=Rw;exports.CourseStructure=Mw;exports.CustomContentBanner=sw;exports.Directory=Zx;exports.DiscussionConversation=Jf;exports.DiscussionForm=Ja;exports.DiscussionLikes=Xf;exports.DiscussionPost=Mr;exports.DiscussionThread=th;exports.Divider=tn;exports.DownloadSection=Xx;exports.EMAILS=Nn;exports.EditSection=tw;exports.EmailHelperTextBox=Vc;exports.EmptyStateBox=an;exports.Filters=yw;exports.FlagsProvider=Mf;exports.Footer=Eo;exports.Form=nr;exports.Formatting=Z;exports.FullWidthSection=ln;exports.GET_STREAM_USER_PREFIX=ts;exports.GlobalProviders=Vx;exports.Header=ko;exports.HelperTextBox=Lc;exports.HiddenFromScreenReaders=$a;exports.HideShowTextBox=zc;exports.HighlightSection=uw;exports.HighlightedTextBox=Nt;exports.INVALID_TOKEN=Tc;exports.IconBulletedList=Yh;exports.ImageContainer=Wh;exports.IntlProvider=If;exports.InviteForm=wf;exports.InviteModal=Kx;exports.JoinButton=xo;exports.LanguageContext=bo;exports.LanguageSwitcher=Cw;exports.LessonName=Gf;exports.LessonType=Qf;exports.Link=_n;exports.LoadMore=Rr;exports.LoadingBlock=sm;exports.LoadingPlaceholder=wt;exports.LoadingState=$s;exports.Logo=wo;exports.LogoSection=nw;exports.MENTION_REGEX=Sc;exports.MarkCompleteButton=Iw;exports.MarkdownText=Vn;exports.MarketingBlock=lw;exports.Marks=Ot;exports.Member=tr;exports.MembersList=Nw;exports.Modal=Do;exports.MoreMenu=Uf;exports.NUMBER_OF_COUNTRIES=Fh;exports.NUMBER_OF_USERS=Ah;exports.NavigationMenu=Vf;exports.NotFoundError=OE;exports.Overlay=Nr;exports.OverlayContext=yo;exports.OverlayProvider=zf;exports.PageHeading=qc;exports.PageLayout=Yf;exports.PasswordForm=LC;exports.PasswordRules=Qc;exports.Pill=hn;exports.Popover=Mc;exports.Portal=Ms;exports.ProfileImageChange=$C;exports.ProfilePicture=sn;exports.ProgressBar=Is;exports.ProgressTracker=Hh;exports.Rating=ym;exports.RepliesFeed=lh;exports.ResponsesHeading=eh;exports.ResponsiveImage=er;exports.ReturnToNavButton=Uh;exports.RichTextEditor=Cf;exports.SearchForm=Ef;exports.ShareLinks=_w;exports.SignupForm=VC;exports.Span=ss;exports.StatusBanner=Er;exports.TableOfContents=Qx;exports.Tabs=Bw;exports.Tags=Pw;exports.TestimonialBlock=Gx;exports.TimeToComplete=Qa;exports.Toggle=IC;exports.Tooltip=En;exports.TopLevelPage=Tw;exports.UUID_V4_REGEX=ns;exports.UserContext=Kt;exports.UserProvider=$f;exports.VisuallyHidden=Me;exports.addAriaProps=qf;exports.basicReducer=Or;exports.camelCaseToDashCase=Bc;exports.checkIntlPathExists=La;exports.generateConditions=ma;exports.generateCssIcon=jc;exports.getCharacterLimitProps=Uc;exports.getLongDate=Rs;exports.getMember=Ls;exports.getShortDate=Oc;exports.getValueLength=qa;exports.headerData=jr;exports.mapGetStreamData=jE;exports.pageReady=Pc;exports.passwordValidator=as;exports.repliesFeedMock=hE;exports.supportedLanguages=ga;exports.toCamelCase=Ac;exports.toCapitalisedCase=Bh;exports.toSentenceCase=Fc;exports.useCurrentPath=Cc;exports.useEffectAfterMount=Un;exports.useElementWidth=Jn;exports.useOverlay=Lf;exports.useScrollListener=Ec;exports.useScrollToHash=Ps;exports.useTooltips=Ns;exports.useUser=Ga;
159
+ ${fr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:fr(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,a)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(a))}];const kw="shareLinks_",_w=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:a="large",variant:i="default",className:s=""})=>{const o=ue.useIntl(),l=Ew({title:e,link:t,referrer:n});return d.jsxs("aside",{className:Y("share-links",a,i,s),children:[d.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),d.jsx("ul",{children:l.map(({key:u,icon:c,url:h,shouldRender:p=!0,onClick:m})=>{if(typeof p=="function"&&!p())return null;const g={};return m&&(g.onClick=f=>m(f,h)),d.jsx("li",{children:d.jsx(_e,{size:a,variant:"tertiary",icon:{icon:c||u},href:h,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${kw}link_${u}`}),...g})},u)})})]})};const Bw=({tabs:e,className:t="",preventLocationChange:n})=>{var p;const r=(m,g,f)=>(m||(m=`panel-${window.btoa(g)}-${f}`),m);let a=e.findIndex(m=>m.current===!0);if(a<0&&(a=0),window.location.hash){const m=window.location.hash.replace("#","");if(e.find(f=>f.id===m)){for(let f=0;f<e.length;f++)if(r(e[f].id,e[f].text,f)===m){a=f;break}}}const[i,s]=C.useState((p=e[a])!=null&&p.id?e[a].id:r(e[a].id,e[a].text,a)),[o,l]=C.useState(""),u=(m,g)=>{switch(m.key){case"ArrowLeft":case"ArrowRight":{m.preventDefault();let f=g;m.key==="ArrowLeft"?g>0?f=g-1:f=e.length-1:m.key==="ArrowRight"&&(g<e.length-1?f=g+1:f=0);const b=r(e[f].id,e[f].text,f),y=document.getElementById(`tab-${b}`);y==null||y.focus(),l(b);break}case"Enter":s(o),window.location.hash=`#${o}`;break}};C.useEffect(()=>{if(e[a].hasCarousel){const m=new CustomEvent("hiddenSectionVisible",{detail:{id:i}});window.dispatchEvent(m)}},[i]);const c=[],h=[];return e.forEach(({id:m,text:g,content:f,href:b,hasCarousel:y},x)=>{m=r(m,g,x);const A=i===m,k={};b||(k["aria-controls"]=m,k.onClick=w=>{w.preventDefault(),w.stopPropagation(),s(m),!n&&(window.location.hash=`#${m}`)},h.push(d.jsx("section",{id:m,hidden:!A,role:"tabpanel","aria-labelledby":`tab-${m}`,"aria-live":A?"assertive":"off",children:typeof f=="string"?d.jsx("p",{children:f}):f},`section-${m}`))),c.push(d.jsx("li",{"data-testid":"navigation-tab",children:d.jsx("a",{href:b||`#${m}`,id:`tab-${m}`,"aria-controls":m,className:Y({selected:A}),role:"tab",tabIndex:A?0:-1,"aria-selected":A,onKeyDown:w=>u(w,x),...k,children:g})},`tab-${m}`))}),d.jsxs("div",{className:Y("tabs-wrapper",t),children:[d.jsx("ul",{className:"tabs",role:"tablist",children:c}),d.jsx("div",{className:"tab-content",children:h})]})};const Aw={"2-1":901,"1-3":769,"1-1":769},Kf=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:a})=>{const i=Jn(!0);let s=a;return C.Children.count(a)===1&&(s=C.Children.toArray(a)[0],s.props&&(s=s.props.children)),d.jsx("section",{className:Y("columns",`layout-${e}`,r,{"has-containers":n}),children:C.Children.map(s,(o,l)=>t!==!1&&l===t&&i&&i<Aw[e]?null:o)})};let Wi;const Hi="contactFooter_",Fw=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=C.useRef(null),[r,a]=C.useState(0),[i,s]=C.useState(!1),o=()=>{n.current&&a(n.current.clientHeight)},l=()=>{i||(s(!0),clearTimeout(Wi),Wi=setTimeout(()=>{o(),s(!1)},500))};return C.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Wi),window.removeEventListener("resize",l)}),[]),d.jsx(ln,{id:"contactForm",className:"contact-footer",children:d.jsxs("div",{className:"inner-wrapper",children:[d.jsx("h2",{children:d.jsx(ue.FormattedMessage,{id:`${Hi}title`})}),d.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[d.jsxs("aside",{children:[d.jsx("p",{children:d.jsx(ue.FormattedMessage,{id:`${Hi}text`})}),d.jsx(_n,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:d.jsx(ue.FormattedMessage,{id:`${Hi}email`})})]}),d.jsx(xf,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Tw=({activeLink:e,...t})=>d.jsx(ln,{children:d.jsx(Kf,{layout:"1-3",children:d.jsxs(d.Fragment,{children:[d.jsx(Vf,{activeLink:e}),d.jsx(qc,{...t})]})})});const Ui="cookieBanner_",Vi=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Ki=new Date(Date.now()+12*30*24*60*60*1e3),Zf=()=>{const e=ue.useIntl(),[t,n,r]=Os.useCookies(Vi),[a,i]=C.useState(!t["apol-cookie-banner"]),s=()=>{Vi.forEach(c=>{n(c,!0,{path:"/",expires:Ki,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Ki}),Vi.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Ki});return}r(c)}),i(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${Ui}buttons_${c.id}`})})}),d.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[d.jsx("h6",{children:e.formatMessage({id:`${Ui}title`})}),d.jsx("p",{children:e.formatMessage({id:`${Ui}text`})}),d.jsx(kn,{buttons:u})]})},zt={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","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-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:Nn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Nn["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:Nn.support,gtmType:"concierge-email-click"},business:{email:Nn.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 zn="footer_",Pa="SiteFooter",sc=({group:e})=>{const t=zt[e].order||[];let n=!1;return"text"in zt[e]&&(n=zt[e].text),d.jsxs(C.Fragment,{children:[d.jsx("p",{className:"pre-title",children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}`})}),Array.isArray(t)&&t.length>0&&d.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:a,gtmType:i}=zt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),d.jsx("li",{children:d.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":Pa,"data-gtm-event-type":i,...s,children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&d.jsx("dl",{className:"text-medium",children:n.order.map(r=>d.jsxs(C.Fragment,{children:[d.jsx("dt",{children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}`})}),d.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&d.jsx("address",{children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}_address`,values:{br:d.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&d.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Pa,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Eo=()=>d.jsx("div",{id:"footer",children:d.jsxs("div",{className:"wrapper",children:[d.jsx(La,{element:"hr"}),d.jsx(wo,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Pa,"data-gtm-event-type":"logo-homepage-link"}),d.jsx("footer",{children:["platform","community","company","contact"].map(e=>d.jsxs("div",{className:"group",children:[d.jsx(sc,{group:e}),Object.keys(zt[e]).includes("child")&&d.jsx(sc,{group:zt[e].child})]},e))}),d.jsx("hr",{}),d.jsxs("div",{className:"sub-footer",children:[d.jsx("ul",{children:Array.isArray(zt.social.order)&&zt.social.order.map(e=>{const t=zt.social[e];return d.jsx("li",{className:e,children:d.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Pa,"data-gtm-event-type":"social-click",children:d.jsx("span",{className:"hidden",children:d.jsx(ue.FormattedMessage,{id:`${zn}social_${e}`})})})},e)})}),d.jsx("small",{children:d.jsx(ue.FormattedMessage,{id:`${zn}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),Ne={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==="account"&&t===!1&&n.navigation===!0)return;const i=Date.now();if(!a&&!t&&Ne.handlerCalled[e]&&i-Ne.handlerCalled[e]<500)return;Ne.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"navigation":o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation > li.parent"));break;case"search":o=document.querySelector("#header .toggle-search-button");break;case"account":o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const a=bc(e[r],t);if(!(typeof a>"u")&&(!n||a[t]&&a[t].includes(n)||a.value&&a.value.includes(n)||a.toString().includes(n)))return e[r]}return e[0].children?Ne.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"navigation":if(n){const u=Ne.findFirstChild(t.current.children,"attributes.aria-controls","navigation");s=Ne.findFirstChild(u.children,"href")}else s=Ne.findFirstChild(t.current.children,"href");break;case"account":if(o=Ne.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=Ne.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(Ne.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ne.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ne.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ne.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Or={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"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:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},Na=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=ue.useIntl(),o=bc(Or,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=i===null?l?o.doTrack:!0:i,c=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let p=!1;if(o.href){let x=o.gtmType||`${e}-click`;if(x.includes(".")){const A=x.split("."),k=A[A.length-2];x=`${k==="topics"?`${k}-`:""}${A[A.length-1]}`}p={href:o.href},u&&(p={...p,className:"gtm-trackable","data-gtm-event-type":x,"data-gtm-event-context":"HeaderButtons"}),c&&(p={...p,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const m=o.order&&o.order[0]&&o[o.order[0]],g=m&&o[o.order[0]].order,f=p&&window.location.pathname===o.href;let b={},y={};if(f&&(b={...b,"aria-current":"page"}),m){const x=o.menuId||e,A={onClick:k=>Ne.events.onClick(k,{id:x,callback:a,isOpen:r[x]}),onFocus:()=>Ne.events.onFocus({id:x}),onBlur:()=>Ne.events.onBlur({id:x,callback:a}),onMouseLeave:()=>Ne.events.onBlur({id:x,callback:a}),onMouseEnter:()=>Ne.events.onMouseEnter({id:x,callback:a})};n&&(g&&(b={...A,onKeyPress:k=>{k.key==="Enter"&&Ne.events.onClick(k,{id:x,callback:a,isOpen:r[x]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[x],"aria-controls":x}),y={hidden:x in r?!r[x]:!0}),g||(y={...y,...A})}return d.jsxs("li",{className:Y({[o.className]:o.className,"has-submenu":m,parent:g,active:f}),...b,children:[p?C.createElement(c?_e:"a",p,s.formatMessage({id:h})):s.formatMessage({id:h}),o.order&&d.jsx("ul",{...y,children:o.order.map(x=>{if(!o[x])return null;const A={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[x].order?d.jsxs("li",{className:Y({[o[x].className]:o[x].className}),children:[s.formatMessage({id:`${h}_${x}`}),d.jsx("ul",{children:o[x].order.map(k=>d.jsx(Na,{id:`${e}.${x}.${k}`,...A},k))})]},x):d.jsx(Na,{id:`${e}.${x}`,...A},x)})})]},e)};const Sw={height:67,height_desktop:83},ko=({showNavigation:e=!0})=>{const t=ue.useIntl(),n=C.useContext(Kt),r=Jn(!0,!0),a=n&&typeof n.id=="string",i=C.useMemo(()=>Ne.getIsDesktopVersion(a,r),[a,r]),[s,o]=C.useReducer(Pr,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:c}=s,h=C.useRef(s);C.useEffect(()=>{h.current=s},[s]),Ec({scrollPosition:Sw[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const f=h.current.menus;!i&&f.navigation||Ne.shouldChangeHeaderIsVisible(!0,f,o)},scrollDown:()=>{const f=h.current.menus;!i&&f.navigation||Ne.shouldChangeHeaderIsVisible(!1,f,o)}}});const p=(f,b,y=!1)=>{Ne.handleMenus({id:f,value:b,menus:h.current.menus,dispatch:o,forceHandle:y})},m=C.useRef(null),g=f=>{f.key==="Escape"&&["navigation","search","account"].forEach(b=>{h.current.menus[b]&&p(b,!1,!0)})};return C.useEffect(()=>{var f;return(f=document.getElementById("header"))==null||f.addEventListener("keydown",g),()=>{var b;(b=document.getElementById("header"))==null||b.removeEventListener("keydown",g)}},[]),Un(()=>{u.navigation&&Ne.autoFocus({menu:"navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u.navigation]),Un(()=>{u.account&&Ne.autoFocus({menu:"account",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u.account]),n&&n.isLoading?null:d.jsxs(d.Fragment,{children:[d.jsxs("nav",{id:"header",className:Y({"logged-in":a,"logged-out":!a,visible:l}),children:[d.jsx(Me,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),d.jsx(wo,{variant:"monochrome"}),e&&d.jsxs(d.Fragment,{children:[!i.navigation&&d.jsx("button",{className:"menu-button gtm-trackable",onClick:f=>{f.preventDefault(),f.stopPropagation(),p("navigation",!u.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u.navigation,"aria-controls":"navigation",children:d.jsx(Me,{children:t.formatMessage({id:`header_menu_${u.navigation?"hide":"show"}`})})}),d.jsx("ul",{ref:m,id:"navigation",hidden:i.navigation||u.account?!1:!u.navigation,"data-showing":!i.navigation&&u.account?"account":"default",children:Or.order.map(f=>d.jsx(Na,{id:f,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{navigation:u.navigation,account:u.account},callback:p},f))}),!i.search&&d.jsx("button",{className:"search toggle-search-button",onClick:f=>{f.preventDefault(),f.stopPropagation(),p("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:d.jsx(Me,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),d.jsx(Ef,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),a?d.jsxs("button",{className:"account-button",onClick:f=>Ne.events.onClick(f,{id:"account",callback:p,isOpen:u.account}),onMouseEnter:()=>Ne.events.onMouseEnter({id:"account",callback:p}),onMouseLeave:()=>Ne.events.onBlur({id:"account",callback:p}),"aria-haspopup":"true","aria-expanded":u.account,"aria-controls":"navigation",children:[d.jsx(Me,{children:t.formatMessage({id:`header_account_${u.account?"hide":"show"}`})}),d.jsx(sn,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):d.jsx("ul",{className:"sign-in-buttons",children:Or.buttons.order.map(f=>d.jsx(Na,{id:`buttons.${f}`},f))})]})]}),d.jsx("hr",{id:"content-of-page"}),d.jsx("div",{className:Y("overlay",{open:u.navigation||u.account||!i.search&&u.search})})]})};const jw=()=>{const e=ue.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(ko,{}),d.jsx("div",{id:"content",children:d.jsx(an,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),d.jsx(Eo,{})]})},Yf=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:a={},styling:i={},className:s="",locale:o="en"})=>{const{navigation:l=!0,footer:u=!0}=a,{background:c="default",variant:h="default",circle:p="default",modal:m="default"}=i,g=Cc(),[f,b]=C.useState(""),y=F=>{const{detail:{message:S}}=F;b(S)};C.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",y),()=>{document.removeEventListener("ariaLive",y)}),[g]);const x=ua(e,{locale:o}),A=ua(t,{locale:o}),k=ua(n,{locale:o}),w={};return c!=="default"&&(w[c]=!0),h!=="default"&&(w[h]=!0),p!=="default"&&(w[p]=!0),d.jsx(Ch.ErrorBoundary,{onError:r,fallback:d.jsx(jw,{}),children:d.jsxs(C.Suspense,{fallback:null,children:[d.jsxs("div",{id:"wrapper",className:Y(s,w,{"has-footer":u}),children:[d.jsx(ko,{showNavigation:l}),d.jsxs("main",{id:"content-wrapper",children:[A&&d.jsx("div",{className:Y("additional-content prepended",{"large-modal":m==="large"}),children:A}),C.createElement(c==="bold"?Do:"div",{id:"content",children:x,className:Y({"large-modal":m==="large"})})]}),k&&d.jsx("div",{className:"additional-content appended",children:k}),u&&d.jsx(Eo,{}),d.jsx(Zf,{})]}),f&&d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},oc={default:"tags_",headerTopics:"header_topics_topics_"},Zi={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"},Ow={getTagDetails:e=>{if(e.includes("topic_")){if(e=Zi.topic[e.replace("topic_","")],e){const t=Or.topics.topics[e].href;return t?{id:e,href:t,text:`${oc.headerTopics}${e}`}:null}return null}return Zi[e]?(e=Zi[e],{id:e,text:`${oc.default}${e}`}):null}};const Pw=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=ue.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=Ow.getTagDetails(u);c&&l.push(c)}),l.length<1?null:d.jsx("ul",{className:Y("tags text-small",t,a,{"one-line":n}),children:l.map(u=>{const c=o.formatMessage({id:u.text});return d.jsx("li",{children:u.href&&r?d.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":i,"data-gtm-event-context":s,children:c}):c},u.id)})})};const Nw=({members:{data:e=[],total:t=e.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:a="member",gtmType:i="member-click",className:s=""})=>{const o=ue.useIntl();return e.length===0?null:d.jsxs("div",{className:Y("members-list",s),children:[d.jsxs("h1",{children:[o.formatMessage({id:"membersList"}),d.jsx("span",{className:"count",children:t})]}),d.jsx("ul",{children:e.map((l,u)=>d.jsxs("li",{children:[d.jsx(tr,{member:l,gtmContext:a,gtmType:i}),l.isAdmin&&d.jsx(hn,{children:o.formatMessage({id:"membersList_admin"})})]},u))}),n&&d.jsx(Mr,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:a})]})};const Rw=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:a=!0},graph:i,styling:s={},className:o=""})=>{const l=ue.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=s;return C.createElement(e,{className:Y("course-progression",o,{"highlight-percentage":c,"has-circle-graph":i==="circle"}),children:d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>d.jsx("strong",{children:h}),number:u})}),u<100&&a&&d.jsx(Ja,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),d.jsx(Is,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const Gf=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>C.createElement(e,{className:Y("lesson-name",a),"data-number":`${t}.${n}`,children:r});const Qf=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=ue.useIntl(),o=za(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):Fc(a||"");return d.jsxs("small",{className:Y("content-type",{[e]:e!=="default"}),children:[d.jsx("span",{className:Y("type",n),children:o})," ",t>0&&!r&&d.jsx(Ja,{time:t})," ",i?d.jsx("span",{className:"additional",children:i}):null]})};const Mw=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:c})=>{const h=ue.useIntl(),p="courseStructure_",m=u.toLowerCase().includes("course conclusion");return d.jsxs(qa,{className:"course-structure",label:d.jsxs(d.Fragment,{children:[d.jsxs("small",{children:[h.formatMessage({id:`${p}section${m?"_end":""}`},{number:i})," ",!r&&s>=0&&d.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${p}time_completed`}):d.jsx(Ja,{time:s,appendedText:a?h.formatMessage({id:`${p}time_left`}):""})})]}),d.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[d.jsx("p",{children:n}),d.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:f,contentType:b,icon:y,image:x,isIntroduction:A,optional:k,slug:w,subsectionId:F,title:S,type:z})=>{const N=a&&t||A,$={};return x&&($.style={"--image":`url(${x})`}),d.jsx("li",{className:Y({article:b===hr.ARTICLE,discussion:b===hr.DISCUSSION,quiz:b===hr.QUIZ,completed:g&&b===hr.ARTICLE,locked:!N}),...$,children:d.jsx(_n,{href:N?`/microcourses/en/${o}/${w}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${Ac(S)}`,gtmType:"article-click",children:d.jsxs(d.Fragment,{children:[d.jsx(Gf,{sectionId:i,subsectionId:F,title:S,className:"course-title"})," ",d.jsx(Qf,{completionTime:f,icon:y,optional:k,type:z,children:c&&c[w]&&d.jsx("span",{className:"quiz-score",children:`${c[w]}%`})})]})})},w)})})]})};const Iw=({isComplete:e=!1,onClick:t,...n})=>{const r=ue.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),d.jsx(_e,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:Y("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})};let ia=null;const it="discussion_form_",Xa=({id:e,content:t={type:"response",slugs:{}},userHasPermissions:n=!0,meta:r={isLoading:!1,isInWrapper:!1,isAutoFocused:!1,isEditing:!1,isPrepopulated:!1,showTitle:!1,showSuccessMessage:!0},placeholder:a,maxLength:i=0,forceShow:s={cancel:!1,error:!1},functions:o={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},listMembers:()=>Promise.resolve([]),props:{create:{projectNames:["questions-answers"]}}},data:l={},gtmContext:u="DiscussionForm"})=>{var I,E,B;const c=ue.useIntl(),h=C.useContext(Kt),[p,m]=C.useState(""),[g,f]=C.useState(r.isEditing&&r.isEditing.text||(r==null?void 0:r.isPrepopulated)&&r.isPrepopulated.text||""),[b,y]=C.useState(s.error||!1),[x,A]=C.useState(!1);if(C.useEffect(()=>{!(r!=null&&r.isEditing)&&(r!=null&&r.isPrepopulated)&&(r==null?void 0:r.isPrepopulated)!==g&&f((r==null?void 0:r.isPrepopulated.text)||"")},[r==null?void 0:r.isPrepopulated]),r.isLoading)return d.jsx(wt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const k=T=>{f(T);let M;!h||!h.id?M=kt(c.formatMessage,`${it}error_loggedOut`,t.type,"action"):n?i>0&&T.length>=i&&(M=`${it}error_tooLong`):M=kt(c.formatMessage,`${it}error_noPermission`,t.type,"action"),M?y(M):b&&y(!1)};let w=`${t.type}-form`;if(t.type==="response"||t.type==="reply"){const T=((I=t.slugs)==null?void 0:I.reply)||((E=t.slugs)==null?void 0:E.answer)||((B=t.slugs)==null?void 0:B.question)||"";T&&(w=`${w}-${T.slice(-15)}`)}e&&(w=`${e}-${w}`);const F=async T=>{var R;if(T.preventDefault(),T.stopPropagation(),!h||!h.id||!n||z)return;ia&&clearTimeout(ia),A("submitting");const M=window.location.pathname;try{let W;switch(t.type){case"post":W=await o.create({content:g});break;case"question":W=await o.create({title:g,authorId:h&&h.id,...(R=o.props)==null?void 0:R.create});break;case"response":W=await o.create({questionSlug:t.slugs.question},{body:g,authorId:h&&h.id,contentPath:M});break;case"reply":W=await o.create({questionSlug:t.slugs.question,answerSlug:t.slugs.answer},{body:g,authorId:h&&h.id,contentPath:M});break;default:break}await jh(1e3),o.callback&&await o.callback(W),ia=setTimeout(()=>{f(""),A("submitted"),m(kt(c.formatMessage,`${it}success`,t.type,"action"));const X=new Event("discussionFormSubmitted");document.dispatchEvent(X),S()},500)}catch(W){const X=W;let G=`${it}error`;X!=null&&X.message.includes("entry already exists")&&(G=kt(c.formatMessage,`${it}error_alreadyExists`,t.type,"action")),X!=null&&X.message.includes("429")?G=kt(c.formatMessage,`${it}error_tooMany`,t.type,"action"):X!=null&&X.message.includes("400")&&(G=`${it}error`),y(G),S()}},S=()=>{ia=setTimeout(()=>{y(!1),A(!1),m("")},5e3)},z=!g||!Lh(g),N=x==="submitting",$=[];return(r.isEditing&&!N||s.cancel)&&$.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:o.handleCancel,className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`cancel-${t.type}-click`,disabled:!s.cancel&&(!h||!h.id||!g),children:c.formatMessage({id:`${it}cancel`})}),$.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:T=>{if(r.isEditing){A("submitting"),o.handleSaveEdit&&o.handleSaveEdit(g);return}F(T)},className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`${r.isEditing?"save":"submit"}-${t.type}-click`,"data-testid":"save-button",disabled:!h||!h.id||!n||z||N||r.isEditing&&g===r.isEditing.text,children:c.formatMessage({id:`${it}${N?r.isEditing?"saving":"posting":r.isEditing?"save":"post"}`})}),d.jsxs(d.Fragment,{children:[d.jsxs("form",{id:w,className:Y("discussion-card discussion-form",{"no-styling":r.isInWrapper&&r.isEditing}),"data-testid":`discussion-${t.type}-form`,children:[(r==null?void 0:r.showTitle)&&!r.isEditing&&["question"].includes(t.type)&&d.jsx("h2",{children:kt(c.formatMessage,`${it}title`,t.type,"action")}),d.jsx(tr,{member:h||"community",gtmContext:u,gtmType:"profile-click"}),d.jsx(Me,{element:"label",showOnFocus:!1,htmlFor:`${w}-input`,children:kt(c.formatMessage,`${it}label`,t.type,"action")}),d.jsx(Cf,{id:`${w}-input`,value:x==="submitting"&&!b?"":g,placeholder:a||kt(c.formatMessage,`${it}placeholder`,t.type,"action"),maxLength:i,functions:{onChange:k,listMembers:o.listMembers},data:l,autoFocus:(r==null?void 0:r.isEditing)!==!1||(r==null?void 0:r.isAutoFocused),"aria-invalid":!!b,"aria-errormessage":"error-message"}),d.jsx("small",{children:kt(c.formatMessage,`${it}explainer`,t.type,"action",{a:T=>d.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:T})})}),d.jsx(kn,{buttons:$}),x==="submitted"&&r.showSuccessMessage&&d.jsx(kr,{className:"success","data-testid":"success",children:kt(c.formatMessage,`${it}success`,t.type,"action")}),b&&d.jsx(kr,{id:"error-message",className:"error","data-testid":"error",children:s.error?s.error:typeof b=="string"?b.includes(" ")?b:c.formatMessage({id:b},{action:c.formatMessage({id:`discussion_action_${t.type}`}),maxLength:i}):b})]}),p&&d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:p})]})},_o=({form:e,membershipRequiredToPost:{isMember:t,required:n,join:r,leave:a,notMemberStateText:i}})=>{if(n&&!t)return d.jsx(an,{text:i,button:{breakpoints:{mobile:!0,901:!1},component:d.jsx(xo,{isShort:!0,functions:{join:r,leave:a}})}});const{content:s,functions:o,meta:l,...u}=e;return d.jsx(Xa,{content:{type:(s==null?void 0:s.type)||"reply",slugs:(s==null?void 0:s.slugs)||{}},functions:{...o,create:(o==null?void 0:o.create)||(()=>{})},meta:{...l,isEditing:(l==null?void 0:l.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1},...u,id:`add-post-${u.id||""}`})},$w={showForm:!1},ei=C.createContext($w),Jf=({children:e})=>{const[t,n]=C.useState({showForm:!1});return d.jsx(ei.Provider,{value:{...t,updateConversation:n},children:e})},Lw=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),zw=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);const Ra=({icon:e,...t})=>d.jsx(_e,{className:"discussion-button",variant:"tertiary",icon:e,...t});let wr=!1;const Yi=()=>{wr!==!1&&(clearTimeout(wr),wr=!1)},Gi=5;let Qi=null;const Xf=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,functions:{createLike:o=()=>{},deleteLike:l=()=>{}}={}})=>{const u=ue.useIntl(),c={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0},[h,p]=C.useReducer(Pr,c),{numberOfLikes:m,userLikedContent:g,ignoreInteractions:f,showLikers:b,tabbableLink:y}=h;C.useEffect(()=>{p([{type:"userLikedContent",value:a}])},[a]);const x=C.useMemo(()=>zw(n,Gi),[n]),A=S=>{if(S.preventDefault(),S.stopPropagation(),p([{type:"showLikers",value:!1}]),wr)return Yi(),!1;if(Yi(),f||!s)return!1;wr=setTimeout(k,350)},k=async()=>{if(Yi(),f||!s)return!1;let S=g?m-1:m+1;S<0&&(S=0),p([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!g}]);try{if(i&&i.slugs){const z=Lw(i.slugs);g?await l(z):await o({...z,payload:{contentPath:window.location.pathname}})}}catch{p([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{p([{type:"ignoreInteractions",value:!1}])}},w=()=>{Qi=setTimeout(()=>{p([{type:"showLikers",value:!1}])},500)},F=()=>{Qi&&clearTimeout(Qi)};return C.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&p([{type:"showLikers",value:!1}])},onMouseEnter:()=>{F(),p([{type:"showLikers",value:!0}])},onMouseLeave:()=>{w()}},d.jsxs(d.Fragment,{children:[d.jsx(Ra,{className:Y("discussion-button text-medium action-button",{"show-spinner":f,"is-liked":g,disabled:!s}),icon:{icon:g?"heart":"heart_empty",animate:"bounce"},disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${i.type}-click`,onClick:A,screenreaderText:s?u.formatMessage({id:`discussion_likes_${g?"unlike":"like"}`},{action:u.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":g,children:d.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:u.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})})}),n&&d.jsxs(d.Fragment,{children:[d.jsx(Me,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{F()},onBlur:()=>w,onClick:S=>{var N;S.preventDefault(),S.stopPropagation(),F(),p([{type:"showLikers",value:!0}]);const z=(N=S.currentTarget.nextSibling)==null?void 0:N.childNodes[0];if(z){const $=z.querySelector("li:first-child a");$&&(p([{type:"tabbableLink",value:0}]),setTimeout(()=>{$.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),w())},"aria-expanded":b,"aria-controls":`likes-tooltip-${i.slug}`,children:d.jsx(Me,{showOnFocus:!1,children:u.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),d.jsx(En,{id:`likes-tooltip-${i.slug}`,isOpen:b,isLoading:n.length===0,children:n.length&&d.jsxs("ul",{children:[x.map((S,z)=>{if(typeof S=="string"||!S.name)return null;const N={};return y!==z&&(N.tabIndex=-1),d.jsx("li",{"data-index":z,children:d.jsx(_n,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:$=>$==null?void 0:$.stopPropagation(),onFocus:()=>F(),onKeyDown:$=>{var M,R,W,X;if(!$||!["ArrowUp","ArrowDown"].includes($.key||""))return;$.stopPropagation(),$.preventDefault();const I=$.key==="ArrowUp"?"up":"down",E=(M=$.currentTarget)==null?void 0:M.parentElement;let B=E==null?void 0:E.nextElementSibling;if(I==="up"){const G=E==null?void 0:E.previousElementSibling;G?B=G:(B=(R=E==null?void 0:E.parentElement)==null?void 0:R.lastElementChild,(B==null?void 0:B.getAttribute("data-index"))==="-1"&&(B=B==null?void 0:B.previousElementSibling))}else(!B||(B==null?void 0:B.getAttribute("data-index"))==="-1")&&(B=(W=E==null?void 0:E.parentElement)==null?void 0:W.firstElementChild);if(!B)return;const T=(B==null?void 0:B.getAttribute("data-index"))||"0";p([{type:"tabbableLink",value:T}]),(X=B==null?void 0:B.querySelector("a"))==null||X.focus()},...N,children:S.name})},S.id||window.btoa(S.name))}),t>Gi&&d.jsx("li",{"data-index":"-1",children:u.formatMessage({id:"discussion_likes_more"},{number:t-Gi})})]})})]})]}))},uc=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},Ji=({children:e,class:t,...n})=>{const r={...n,class:Y("subtle",t)};return d.jsx("blockquote",{...r,children:e})},qw=280,Ww=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?Hn(e,qw):e;return a=a.trim(),n?await Nc({text:a,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):a};const Hw=3e3,Uw=({url:e})=>{const t=ue.useIntl(),[n,r]=C.useState({isOpen:!1,isCopied:!1});return d.jsxs("li",{children:[d.jsx(En,{className:Y("tooltip-share-link",{"tooltip-share-link-copied":n.isCopied}),isOpen:n.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:n.isCopied?t.formatMessage({id:"discussion_share_copy_link_success"}):t.formatMessage({id:"discussion_share_copy_link"})}),d.jsx(Ra,{icon:{icon:"link_chain"},onMouseOver:()=>r({...n,isOpen:!0}),onFocus:()=>r({...n,isOpen:!0}),onMouseOut:()=>r({isOpen:!1,isCopied:!1}),onBlur:()=>r({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{r({isOpen:!0,isCopied:!0}),setTimeout(()=>{r({isOpen:!1,isCopied:!1})},Hw)})}})]})},Lt="discussion_",Vw=195,Ir=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:a,forceHide:i={actionBar:!1,comments:!1,likes:!1},functions:s,links:o={},className:l,gtmContext:u="DiscussionAnswer",children:c,isTruncated:h=!1,styling:{showShareLinkButton:p=!1}={},setFocus:m=!1})=>{var me,xe,Fe,Te,Ke,We,He,Qe;const g=ue.useIntl(),f=C.useContext(Kt),b=C.useContext(ei),{createContent:y=async()=>{},deleteContent:x=async()=>{},updateContent:A=async()=>{}}=s.content||{},{createLike:k=()=>{},deleteLike:w=()=>{}}=s.likes||{},{openComments:F=()=>{}}=s.comments||{},{listMembers:S=()=>Promise.resolve([])}=s.mentions||{},{author:z,canLike:N,createdAt:$,id:I,likes:E=0,userLiked:B,comments:T=0,mentions:M}=t,R=f&&f.id&&typeof z!="string"&&z.id&&z.id===f.id||!1,W=typeof N=="boolean"?N:!0,X=R&&(!t.createdAt||Th(t.createdAt,10,"seconds")),G=C.useRef(null),[D,H]=C.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:""}),[te,_]=C.useState(!1),[j,q]=C.useState(X?"highlighted":"default"),[L,U]=C.useState("");C.useEffect(()=>{const he=G.current;if(!(!he||j==="default"))return document.addEventListener("discussionFormSubmitted",ne),he.addEventListener("transitionend",re),()=>{document.removeEventListener("discussionFormSubmitted",ne),he.removeEventListener("transitionend",re)}},[]),C.useEffect(()=>{H({...D,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),C.useEffect(()=>{(async()=>{const ke=await Ww(D.body,h,M,S);H({...D,postBody:ke})})()},[D.body,M]);const ne=()=>{setTimeout(()=>{q("fading")},1e3)},re=({propertyName:he})=>{he==="background-color"&&q(ke=>(ke==="default"&&(document.removeEventListener("discussionFormSubmitted",ne),G.current&&G.current.removeEventListener("transitionend",re)),ke==="fading"?"default":ke))};if(r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||D.postBody==="")return d.jsx(wt,{className:"discussion-card discussion-post"});const ae=async he=>{he||(he=""),U("");try{if(!vc(he,D.body)){const ke=t.type==="question"?{title:he}:{body:he};await A(uc(t.slugs),ke)}H({...D,body:he,isEditing:!1,didEdit:!0})}catch{U(`${Lt}form_error`)}},fe=()=>{if(b&&b.updateConversation){const he={showForm:!0},ke=t.author;ke&&ke.id&&(he.prepopulateForm=`@{{${ke.id}}}`,he.mentionData={id:ke.id,name:ke.name}),b.updateConversation(he)}setTimeout(()=>{var se,pe,ge;const ke=`reply-form-${(t.type==="answer"?t.slug:((se=t.slugs)==null?void 0:se.reply)||((pe=t.slugs)==null?void 0:pe.answer)||((ge=t.slugs)==null?void 0:ge.question)||"").toLowerCase().slice(-15)}`,$e=document.getElementById(ke),K=document.getElementById(`${ke}-input`);K&&K.focus(),$e&&$e.scrollIntoView({behavior:"smooth"})},0)},ee=async()=>{_(!1);try{await x(uc(t.slugs))}catch{U("delete-error")}},be=[{text:g.formatMessage({id:`${Lt}moreMenu_report`}),onClick:he=>{he.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(g.formatMessage({id:`${Lt}report_subject`}))}&body=${encodeURI(g.formatMessage({id:`${Lt}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&&R&&be.push({text:g.formatMessage({id:`${Lt}moreMenu_edit`}),onClick:()=>H({...D,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`edit-${t.type}-click`},{text:g.formatMessage({id:`${Lt}moreMenu_delete`}),onClick:he=>{he.preventDefault(),he.stopPropagation(),_(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`delete-${t.type}-click`,...qf(`delete-${t.slug}-modal`,te)}),m&&((me=G==null?void 0:G.current)==null||me.focus(),(xe=G==null?void 0:G.current)==null||xe.scrollIntoView({behavior:"smooth"})),C.createElement(e,{className:Y("discussion-post",l,{[j]:!l||!l.includes("highlighted-text-box"),"has-link":o.post&&!D.isEditing}),ref:G,tabIndex:m?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${u}-post-click`,onClick:he=>{!o.post||D.isEditing||(he.preventDefault(),he.stopPropagation(),window.location.href=o.post)},children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{id:I||t.slug,className:Y("discussion-card",t.type,{editing:D.isEditing,"has-link":o.post&&!D.isEditing}),children:[!D.isEditing&&d.jsx(tr,{member:z,additionalContent:{createdAt:$,didEdit:D.didEdit},className:typeof z!="string"&&z.id===a?"highlighted":"",gtmContext:u,gtmType:"profile-click"}),D.isEditing?d.jsx(Xa,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:D.body},isPrepopulated:!1},maxLength:t.type==="question"?250:5e4,forceShow:{error:L!==""&&L!=="delete-error"?g.formatMessage({id:L},{action:g.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:y,handleSaveEdit:ae,handleCancel:()=>{U(""),H({...D,isEditing:!1})},listMembers:S},gtmContext:`${u}Form`,data:{mentions:t.mentions}}):o.post?d.jsxs("a",{href:o.post,children:[(t==null?void 0:t.title)&&d.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),D.postBody.length>Vw?d.jsx(zc,{text:D.postBody,markdownOptions:{overrides:{a:ss,blockquote:{component:Ji}}}}):d.jsx(Vn,{options:{overrides:{a:ss,blockquote:{component:Ji}}},children:D.postBody})]}):d.jsx(Vn,{options:{wrapper:t.type==="question"?"h1":C.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:Ji}}},children:D.postBody}),!D.isEditing&&!(i!=null&&i.actionBar)&&d.jsxs("ul",{className:Y("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!i.likes&&d.jsx(Xf,{element:"li",likes:E,isShort:!1,userLiked:B,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:W,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:k,deleteLike:w}}),!i.comments&&(["question","post"].includes(t.type)||o.comments)&&d.jsx("li",{children:d.jsx(Ra,{onClick:he=>{he.preventDefault(),he.stopPropagation(),o.comments&&(window.location.href=o.comments),typeof F=="function"&&F()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":u,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:g.formatMessage({id:`${Lt}comments_screenReader`},{count:T}),children:g.formatMessage({id:`${Lt}comments`},{count:T})})}),(t.type==="answer"||t.type==="reply")&&d.jsx("li",{children:d.jsx(Ra,{styling:{muted:!0},onClick:fe,icon:{icon:"speech-bubble_square"},children:g.formatMessage({id:`${Lt}reply`})})}),p&&d.jsx(Uw,{url:(Fe=t.slugs)!=null&&Fe.reply?`${window.location.origin}${(Te=t.slugs)==null?void 0:Te.question}/${(Ke=t.slugs)==null?void 0:Ke.answer}#${(We=t.slugs)==null?void 0:We.reply}`:`${window.location.origin}${(He=t.slugs)==null?void 0:He.question}/${(Qe=t.slugs)==null?void 0:Qe.answer}`}),d.jsx(Uf,{element:"li",id:`more-${t.slug}`,options:be})]})]}),c,d.jsx(Rr,{id:`delete-${t.slug}-modal`,isOpen:te,functions:{onOpen:()=>{},onClose:()=>_(!1)},forceShow:{error:L==="delete-error"?g.formatMessage({id:"discussion_delete_error"},{action:g.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:g.formatMessage({id:"discussion_delete_title"},{action:g.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>_(!1),children:g.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:ee,children:g.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:d.jsx(ue.FormattedMessage,{id:"discussion_delete_text",values:{p:he=>d.jsx("p",{children:he}),action:g.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Xi="discussion_responses_",eh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ue.useIntl();return t=parseInt(t),d.jsxs("div",{className:"responses-heading",children:[d.jsx("h4",{children:r.formatMessage({id:`${Xi}title`},{action:r.formatMessage({id:`${Xi}${e}`}),count:t})}),!n&&t===0&&d.jsx("p",{children:kt(r.formatMessage,`${Xi}empty`,e,e)})]})};const th=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=ue.useIntl(),s=C.useContext(ei),o=ua(a,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return d.jsxs("div",{className:Y("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&d.jsx("ul",{className:"thread",children:o}),!e&&d.jsx(Mr,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:i.formatMessage({id:"discussion_thread_loadMore"}),error:i.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&d.jsx(Xa,{...r})]})},Kw="post",Zw="reply",nh="00000000-0000-0000-0000-000000000000";function Bo({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function Ao({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return e.setQueryData(t,r),a}return n}function Yw(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function Gw(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function rh(e){const{id:t="",name:n="",organization:r="",jobTitle:a="",image:i={}}=e,{thumbnail:s=""}=i;return{id:t,data:{name:n,organization:r,jobTitle:a,thumbnail:s}}}function Qw({content:e}){return{content:e,id:nh,time:new Date().toISOString(),verb:Kw}}function lc({activity:e,user:t}){return{...e,actor:rh(t),...Yw()}}function Ma({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 ah({activity:e,user:t}){var n,r,a;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((a=e.own_reactions)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}function Jw({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:nh,kind:Zw,parent:t||""}}function cc({reply:e,user:t}){const n=rh(t);return{...e,user_id:n.id,user:n,...Gw()}}function dc({reply:e,reaction:t}){var n,r,a;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((a=e.own_children)==null?void 0:a.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function Xw({reply:e,user:t}){var n,r,a;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_children={...e.own_children||{},like:(((a=e.own_children)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}const ih=e=>{const t=new CustomEvent("discussionPostAdded",{detail:e});document.dispatchEvent(t)};let fc,es=0;const sh=()=>{C.useEffect(()=>(document.addEventListener("discussionPostAdded",e),()=>{document.removeEventListener("discussionPostAdded",e)}),[]);const e=t=>{const n=t.detail;if(!n)return;clearTimeout(fc);const r=document.getElementById(n);if(r){r.scrollIntoView({behavior:"smooth",block:"start"}),es=0;return}es++,!(es>10)&&(fc=setTimeout(()=>{e(t)},50))}},Qn=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}),rn=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}),oh=Object.freeze({actor:`SU:${Qn.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),eE=Object.freeze({actor:`SU:${rn.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),tE=Object.freeze({actor:`SU:${Qn.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),nE=Object.freeze({actor:`SU:${rn.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:oh.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:rn.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:rn.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:rn.id,user:{id:rn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:oh.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:Qn.id,user:{id:Qn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:eE.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:rn.id,user:{id:rn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:tE.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Qn.id,user:{id:Qn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:nE.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function rE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ve.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=lc({activity:Qw(o),user:i});return hc(u,l)}),onError:n,onSuccess:(o,l,u)=>{const c=lc({activity:o,user:i});r.setQueryData(a,hc(c,u,!0)),setTimeout(()=>{ih(c.id)},0)}});return s}function aE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=Ia(a,s);return o&&(o.content=i),s}),onError:n});return r}function iE({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ve.useQueryClient(),l=Qa(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Bo(u),mutate:Ao(u)},user:l,...u},h=rE({...c,mutationFn:e}),p=aE({...c,mutationFn:t}),m=sE({...c,mutationFn:n}),g=uE({...c,mutationFn:a}),f=lE({...c,mutationFn:i}),{activities:b,...y}=oE({queryKey:s,queryFn:r});return{activities:b,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...y}}function sE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ve.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Ia(s,o);return l&&Ma({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Ia(o,l);u&&Ma({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function oE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ve.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:null},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{activities:dE(n),error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function uE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>cE(a,i)),onError:n});return r}function lE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ve.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Ia(i,s);return o&&ah({activity:o,user:r}),s}),onError:n});return a}function hc(e,t,n=!1){return t?(n?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t):{pages:[{next:"",results:[e]}],pageParams:[""]}}function Ia(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function cE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function dE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,{results:r})=>[...n,...r],[]))||[]}const fE=({basePath:e,parentId:t,isMember:n,functions:{activities:r,mentions:a,join:i,leave:s}})=>{const o=ue.useIntl(),{activities:l,error:u,fetchNextPage:c,hasNextPage:h,isLoading:p,mutations:{create:m,edit:g,remove:f,like:b,unlike:y}}=iE({queryKey:[e,t,"activities"],queryFns:r}),[x,A]=C.useState(null),k=()=>{A(l.length),c()};return sh(),u?d.jsx(an,{variant:"error",text:u.message}):d.jsxs("section",{children:[d.jsx(_o,{form:{content:{type:"post",slugs:{}},functions:{create:m,listMembers:a.listMembers},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:i,leave:s,notMemberStateText:o.formatMessage({id:"community_joinToPost"})}}),l==null?void 0:l.map((w,F)=>{var W,X,G,D,H,te,_,j;const{id:S,own_reactions:z,latest_reactions:N,reaction_counts:$,mentioned_users:I}=w,E=(((W=N==null?void 0:N.like)==null?void 0:W.length)||0)>0,B=(((X=z==null?void 0:z.like)==null?void 0:X.length)||0)>0,T=B?z==null?void 0:z.like[0].id:"",M=E?(G=N==null?void 0:N.like)==null?void 0:G.map(q=>{var L,U,ne;return{id:(L=q==null?void 0:q.user)==null?void 0:L.id,name:(ne=(U=q==null?void 0:q.user)==null?void 0:U.data)==null?void 0:ne.name}}):!1,R=w==null?void 0:w.actor;return d.jsx(C.Fragment,{children:d.jsx(Ir,{content:{type:"post",title:w==null?void 0:w.title,body:w==null?void 0:w.content,canLike:n,createdAt:(w==null?void 0:w.time)||"",slugs:{question:`${e}/${t}`,answer:S},slug:S,author:{id:R==null?void 0:R.id,name:(D=R==null?void 0:R.data)==null?void 0:D.name,organization:(H=R==null?void 0:R.data)==null?void 0:H.organization,jobTitle:(te=R==null?void 0:R.data)==null?void 0:te.jobTitle,location:(_=R==null?void 0:R.data)==null?void 0:_.location,image:{thumbnail:((j=R==null?void 0:R.data)==null?void 0:j.thumbnail)||void 0}},userLiked:B,likes:($==null?void 0:$.like)||0,comments:($==null?void 0:$.reply)||0,peopleWhoLiked:M,mentions:I},links:{post:`${e}/${t}/${S}`,comments:`${e}/${t}/${S}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>f({activityId:S}),updateContent:(q,{body:L})=>g({activityId:S,content:L})},likes:{createLike:()=>b({activityId:S}),deleteLike:()=>y({activityId:S,reactionId:T})},comments:{openComments:()=>null},mentions:a},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:F===x})},S)}),!p&&d.jsx(Mr,{hasNextPage:h,loadNextPage:k,icon:{icon:"arrow-down",position:"right"},messages:{button:o.formatMessage({id:"loadMore_button"}),error:o.formatMessage({id:"loadMore_error"})}})]})},hE={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function mE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ve.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=cc({reply:Jw(o),user:i});return mc(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=cc({reply:o,user:i});r.setQueryData(a,mc(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{ih(c.id)},0)}});return s}function pE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=$a(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function uh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ve.useQueryClient(),l=Qa(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Bo(u),mutate:Ao(u)},user:l,...u},h=mE({...c,mutationFn:e}),p=pE({...c,mutationFn:t}),m=gE({...c,mutationFn:n}),g=bE({...c,mutationFn:a}),f=yE({...c,mutationFn:i}),{replies:b,...y}=vE({queryKey:s,queryFn:r});return{replies:b,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...y}}function gE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ve.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=$a(s,o);return l&&dc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=$a(o,l);u&&dc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function vE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ve.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:u=>(u==null?void 0:u.next)||null}),o=EE(n),l=`${o.length||0}${i?"+":""}`;return{replies:o,repliesCount:l,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function bE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>wE(a,i)),onError:n});return r}function yE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ve.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=$a(i,s);return o&&Xw({reply:o,user:r}),s}),onError:n});return a}function DE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function CE(e,t,n){const r=t.pages.length-1,a=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[a]=e:t.pages[r].results.push(e),t}function xE(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function mc(e,t,n){return t?n!=null&&n.append?CE(e,t,n):xE(e,t,n):DE(e)}function $a(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function wE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function EE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const kE=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:i})=>{const s=ue.useIntl(),o=3,{replies:l,fetchNextPage:u,hasNextPage:c,isLoading:h,mutations:{create:p,edit:m,like:g,remove:f,unlike:b},user:y}=uh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:k=>i.list({...k,reactionId:r})}});Ps([h]);const[x,A]=C.useState(!0);return d.jsxs(d.Fragment,{children:[(l==null?void 0:l.length)>=o&&d.jsx(_e,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${x?"up_left":"down_right"}`,position:"left"},onClick:()=>A(!x),children:s.formatMessage({id:`discussion_thread_${x?"hide":"show"}`},{count:l==null?void 0:l.length})}),x&&d.jsx(th,{loadMore:{isLoading:h,hasNextPage:c,loadNextPage:()=>u()},form:{content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(k,{body:w})=>p({activityId:n,replyId:r,content:w}),listMembers:i.listMembers},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:l&&l.length>0?l==null?void 0:l.map(k=>{var X,G,D,H,te,_,j,q,L,U,ne,re;const{id:w,own_children:F,latest_children:S,children_counts:z,data:{mentioned_users:N}}=k,I=(((X=F==null?void 0:F.like)==null?void 0:X.length)||0)>0?(G=F==null?void 0:F.like)==null?void 0:G.find(ae=>{var fe;return((fe=ae==null?void 0:ae.user)==null?void 0:fe.id)===(y==null?void 0:y.id)}):!1,E=I?I==null?void 0:I.id:"",B=!!I,M=(((D=S==null?void 0:S.like)==null?void 0:D.length)||0)>0?(H=S==null?void 0:S.like)==null?void 0:H.map(ae=>{var fe,ee,be;return{id:(fe=ae==null?void 0:ae.user)==null?void 0:fe.id,name:(be=(ee=ae==null?void 0:ae.user)==null?void 0:ee.data)==null?void 0:be.name}}):!1,R=k==null?void 0:k.user,W=typeof k.data.content=="string"?(te=k==null?void 0:k.data)==null?void 0:te.content:((j=(_=k==null?void 0:k.data)==null?void 0:_.content)==null?void 0:j.text)||"";return d.jsx(Ir,{content:{id:w,type:"reply",body:W,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:{id:R==null?void 0:R.id,name:(q=R.data)==null?void 0:q.name,organization:(L=R.data)==null?void 0:L.organization,jobTitle:(U=R.data)==null?void 0:U.jobTitle,location:(ne=R.data)==null?void 0:ne.location,image:{thumbnail:((re=R.data)==null?void 0:re.thumbnail)||void 0}},userLiked:B,likes:(z==null?void 0:z.like)||0,peopleWhoLiked:M,mentions:N},functions:{content:{createContent:()=>null,deleteContent:()=>f({replyId:w}),updateContent:(ae,{body:fe})=>m({replyId:w,content:fe})},likes:{createLike:()=>g({replyId:w}),deleteLike:()=>b({replyId:w,reactionId:E})},comments:{},mentions:{listMembers:i.listMembers}},styling:{showShareLinkButton:!0}},w)}):null})]})};const lh=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:a,mentions:i,join:s,leave:o}})=>{const l=ue.useIntl(),{replies:u,repliesCount:c,fetchNextPage:h,hasNextPage:p,isLoading:m,mutations:{create:g,edit:f,like:b,remove:y,unlike:x},user:A}=uh({queryKey:[e,t,n,"replies"],queryFns:a}),k=()=>{F(u.length),h()},[w,F]=C.useState(null);return Ps([m]),sh(),d.jsxs("section",{className:"replies-feed",children:[d.jsx(eh,{type:"comment",responses:c,isLoading:m}),d.jsx(_o,{form:{content:{type:"reply",slugs:{}},functions:{create:(S,{body:z})=>g({activityId:n,content:z}),...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1},placeholder:l.formatMessage({id:"discussion_responses_placeholder"})},membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:l.formatMessage({id:"community_joinToPost"})}}),u==null?void 0:u.map((S,z)=>{var te,_,j,q,L,U,ne,re,ae,fe,ee,be;const{id:N,own_children:$,latest_children:I,children_counts:E,data:{mentioned_users:B}}=S,M=(((te=$==null?void 0:$.like)==null?void 0:te.length)||0)>0?(_=$==null?void 0:$.like)==null?void 0:_.find(me=>{var xe;return((xe=me==null?void 0:me.user)==null?void 0:xe.id)===(A==null?void 0:A.id)}):!1,R=M?M==null?void 0:M.id:"",W=!!M,G=(((j=I==null?void 0:I.like)==null?void 0:j.length)||0)>0?(q=I==null?void 0:I.like)==null?void 0:q.map(me=>{var xe,Fe,Te;return{id:(xe=me==null?void 0:me.user)==null?void 0:xe.id,name:(Te=(Fe=me==null?void 0:me.user)==null?void 0:Fe.data)==null?void 0:Te.name}}):!1,D=S==null?void 0:S.user,H=typeof S.data.content=="string"?(L=S==null?void 0:S.data)==null?void 0:L.content:((ne=(U=S==null?void 0:S.data)==null?void 0:U.content)==null?void 0:ne.text)||"";return d.jsx(Jf,{children:d.jsx(Ir,{content:{id:N,type:"reply",body:H,canLike:r,createdAt:S==null?void 0:S.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:N},slug:N,author:{id:D==null?void 0:D.id,name:(re=D.data)==null?void 0:re.name,organization:(ae=D.data)==null?void 0:ae.organization,jobTitle:(fe=D.data)==null?void 0:fe.jobTitle,location:(ee=D.data)==null?void 0:ee.location,image:{thumbnail:((be=D.data)==null?void 0:be.thumbnail)||void 0}},userLiked:W,likes:(E==null?void 0:E.like)||0,peopleWhoLiked:G,mentions:B},functions:{content:{createContent:()=>null,deleteContent:()=>y({replyId:N}),updateContent:(me,{body:xe})=>f({replyId:N,content:xe})},likes:{createLike:()=>b({replyId:N}),deleteLike:()=>x({replyId:N,reactionId:R})},comments:{},mentions:i},children:d.jsx(kE,{basePath:e,parentId:t,activityId:n,replyId:N,isMember:r,functions:{...a,...i}}),styling:{showShareLinkButton:!0},setFocus:z===w},N)},N)}),!m&&d.jsx(Mr,{hasNextPage:p,loadNextPage:k,icon:{icon:"arrow-down",position:"right"},messages:{button:l.formatMessage({id:"loadMore_button"}),error:l.formatMessage({id:"loadMore_error"})}})]})};function _E({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ve.useMutation({mutationFn:e,onMutate:({content:a})=>t(i=>(i&&(i.content=a),i)),onError:n});return r}function BE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=Ve.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function AE({queryFns:{read:e,edit:t,like:n,unlike:r},queryKey:a}){const i=Ve.useQueryClient(),s=Qa(),o={queryClient:i,queryKey:a},l={mutationHandlers:{error:Bo(o),mutate:Ao(o)},user:s,...o},u=_E({...l,mutationFn:t}),c=FE({...l,mutationFn:n}),h=TE({...l,mutationFn:r}),{activity:p,...m}=BE({queryKey:a,queryFn:e});return{activity:p,mutations:{edit:u,like:c,unlike:h},user:s,...m}}function FE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ve.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ma({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ma({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function TE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ve.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&ah({activity:s,user:r}),s)),onError:n});return a}const SE=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{activities:{remove:a,...i},reactions:s,mentions:o,join:l,leave:u}})=>{var N,$,I,E,B,T,M,R,W,X;const c=ue.useIntl(),{activity:h,error:p,isLoading:m,mutations:{edit:g,like:f,unlike:b}}=AE({queryFns:i,queryKey:[e,t,n]});if(m)return d.jsx(wt,{style:{height:"400px"}});if(p||!h)return d.jsx(an,{variant:"error",text:c.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:y,latest_reactions:x,mentioned_users:A}=h,k=(((N=x==null?void 0:x.like)==null?void 0:N.length)||0)>0,w=((($=y==null?void 0:y.like)==null?void 0:$.length)||0)>0,F=w?y==null?void 0:y.like[0].id:"",S=k?(I=x==null?void 0:x.like)==null?void 0:I.map(G=>{var D,H,te;return{id:(D=G==null?void 0:G.user)==null?void 0:D.id,name:(te=(H=G==null?void 0:G.user)==null?void 0:H.data)==null?void 0:te.name}}):!1,z=h==null?void 0:h.actor;return d.jsxs("section",{className:"activity-section",children:[d.jsx(Ir,{className:"highlighted-text-box subtle",content:{id:n,type:"post",body:h==null?void 0:h.content,canLike:r,createdAt:(h==null?void 0:h.time)||"",slugs:{question:`${e}/${t}`,answer:h==null?void 0:h.id},slug:n,author:{id:z.id,name:(E=z.data)==null?void 0:E.name,organization:(B=z.data)==null?void 0:B.organization,jobTitle:(T=z.data)==null?void 0:T.jobTitle,location:(M=z.data)==null?void 0:M.location,image:{thumbnail:((R=z.data)==null?void 0:R.thumbnail)||void 0}},userLiked:w,likes:((W=h==null?void 0:h.reaction_counts)==null?void 0:W.like)||0,comments:((X=h==null?void 0:h.reaction_counts)==null?void 0:X.reply)||0,peopleWhoLiked:S,mentions:A},originalAuthorId:z==null?void 0:z.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(G,{body:D})=>g({content:D})},likes:{createLike:()=>f({activityId:n}),deleteLike:()=>b({activityId:n,reactionId:F})},comments:{openComments:()=>{}},mentions:o},styling:{showShareLinkButton:!0}},n),d.jsx(lh,{basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:s,mentions:o,join:l,leave:u}})]})},jE=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),pc=[{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 sa="notFoundError_",OE=()=>{const e=ue.useIntl(),t=[];return pc.forEach((n,r)=>{n.title=e.formatMessage({id:`${sa}post_${r+1}`}),t.push("solutionArticle")}),d.jsxs(Yf,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:d.jsxs(ln,{children:[d.jsx(Hf,{cards:pc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),d.jsx(_e,{href:"/solution-articles/",children:e.formatMessage({id:`${sa}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[d.jsx("h1",{children:e.formatMessage({id:`${sa}title`})}),d.jsx("p",{children:e.formatMessage({id:`${sa}text`})})]})};exports.ASSETS_BUCKET=Wt;exports.ActivitiesFeed=fE;exports.ActivitySection=SE;exports.AddPost=_o;exports.Banner=Jx;exports.BannerSection=iw;exports.Breadcrumbs=bw;exports.Buckets=Vh;exports.Button=_e;exports.ButtonWrapper=kn;exports.COURSE_CONTENT_TYPES=hr;exports.CacheProvider=Rf;exports.Card=Co;exports.CardBlock=Hf;exports.Carousel=gw;exports.CharacterLimit=qs;exports.CollapsibleSection=qa;exports.Columns=Kf;exports.CommunityDetails=vw;exports.ContactFooter=Fw;exports.ContactForm=xf;exports.ContentTypeLabel=Ic;exports.Contributors=zs;exports.ConversationContext=ei;exports.CookieBanner=Zf;exports.CourseProgression=Rw;exports.CourseStructure=Mw;exports.CustomContentBanner=sw;exports.Directory=Zx;exports.DiscussionConversation=Jf;exports.DiscussionForm=Xa;exports.DiscussionLikes=Xf;exports.DiscussionPost=Ir;exports.DiscussionThread=th;exports.Divider=tn;exports.DownloadSection=Xx;exports.EMAILS=Nn;exports.EditSection=tw;exports.EmailHelperTextBox=Vc;exports.EmptyStateBox=an;exports.Filters=yw;exports.FlagsProvider=Mf;exports.Footer=Eo;exports.Form=nr;exports.Formatting=Z;exports.FullWidthSection=ln;exports.GET_STREAM_USER_PREFIX=ns;exports.GlobalProviders=Vx;exports.Header=ko;exports.HelperTextBox=Lc;exports.HiddenFromScreenReaders=La;exports.HideShowTextBox=zc;exports.HighlightSection=uw;exports.HighlightedTextBox=Nt;exports.INVALID_TOKEN=Tc;exports.IconBulletedList=Yh;exports.ImageContainer=Wh;exports.IntlProvider=If;exports.InviteForm=wf;exports.InviteModal=Kx;exports.JoinButton=xo;exports.LanguageContext=bo;exports.LanguageSwitcher=Cw;exports.LessonName=Gf;exports.LessonType=Qf;exports.Link=_n;exports.LoadMore=Mr;exports.LoadingBlock=sm;exports.LoadingPlaceholder=wt;exports.LoadingState=$s;exports.Logo=wo;exports.LogoSection=nw;exports.MENTION_REGEX=Sc;exports.MarkCompleteButton=Iw;exports.MarkdownText=Vn;exports.MarketingBlock=lw;exports.Marks=Ot;exports.Member=tr;exports.MembersList=Nw;exports.Modal=Do;exports.MoreMenu=Uf;exports.NUMBER_OF_COUNTRIES=Fh;exports.NUMBER_OF_USERS=Ah;exports.NavigationMenu=Vf;exports.NotFoundError=OE;exports.Overlay=Rr;exports.OverlayContext=yo;exports.OverlayProvider=zf;exports.PageHeading=qc;exports.PageLayout=Yf;exports.PasswordForm=LC;exports.PasswordRules=Qc;exports.Pill=hn;exports.Popover=Mc;exports.Portal=Ms;exports.ProfileImageChange=$C;exports.ProfilePicture=sn;exports.ProgressBar=Is;exports.ProgressTracker=Hh;exports.Rating=ym;exports.RepliesFeed=lh;exports.ResponsesHeading=eh;exports.ResponsiveImage=er;exports.ReturnToNavButton=Uh;exports.RichTextEditor=Cf;exports.SearchForm=Ef;exports.ShareLinks=_w;exports.SignupForm=VC;exports.Span=ss;exports.StatusBanner=kr;exports.TableOfContents=Qx;exports.Tabs=Bw;exports.Tags=Pw;exports.TestimonialBlock=Gx;exports.TimeToComplete=Ja;exports.Toggle=IC;exports.Tooltip=En;exports.TopLevelPage=Tw;exports.UUID_V4_REGEX=Er;exports.UserContext=Kt;exports.UserProvider=$f;exports.VisuallyHidden=Me;exports.addAriaProps=qf;exports.basicReducer=Pr;exports.camelCaseToDashCase=Bc;exports.checkIntlPathExists=za;exports.generateConditions=pa;exports.generateCssIcon=jc;exports.getCharacterLimitProps=Uc;exports.getLongDate=Rs;exports.getMember=Ls;exports.getShortDate=Oc;exports.getValueLength=Wa;exports.headerData=Or;exports.mapGetStreamData=jE;exports.pageReady=Pc;exports.passwordValidator=as;exports.repliesFeedMock=hE;exports.supportedLanguages=va;exports.toCamelCase=Ac;exports.toCapitalisedCase=Bh;exports.toSentenceCase=Fc;exports.useCurrentPath=Cc;exports.useEffectAfterMount=Un;exports.useElementWidth=Jn;exports.useOverlay=Lf;exports.useScrollListener=Ec;exports.useScrollToHash=Ps;exports.useTooltips=Ns;exports.useUser=Qa;