sykpcomposer 0.0.26 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/index.es.js +2293 -3033
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.umd.js +19 -20
  4. package/dist/index.umd.js.map +1 -1
  5. package/dist/src/components/Editor.d.ts +1 -1
  6. package/dist/style.css +1 -1
  7. package/dist/vite.svg +1 -0
  8. package/package.json +2 -2
  9. package/README.md +0 -15
  10. package/dist/assets/icons/3-columns.svg +0 -3
  11. package/dist/assets/icons/LICENSE.md +0 -5
  12. package/dist/assets/icons/add-sign.svg +0 -3
  13. package/dist/assets/icons/arrow-clockwise.svg +0 -1
  14. package/dist/assets/icons/arrow-counterclockwise.svg +0 -1
  15. package/dist/assets/icons/bg-color.svg +0 -1
  16. package/dist/assets/icons/camera.svg +0 -1
  17. package/dist/assets/icons/card-checklist.svg +0 -1
  18. package/dist/assets/icons/caret-right-fill.svg +0 -1
  19. package/dist/assets/icons/chat-left-text.svg +0 -1
  20. package/dist/assets/icons/chat-right-dots.svg +0 -1
  21. package/dist/assets/icons/chat-right-text.svg +0 -1
  22. package/dist/assets/icons/chat-right.svg +0 -1
  23. package/dist/assets/icons/chat-square-quote.svg +0 -1
  24. package/dist/assets/icons/chevron-down.svg +0 -1
  25. package/dist/assets/icons/clipboard.svg +0 -1
  26. package/dist/assets/icons/close.svg +0 -1
  27. package/dist/assets/icons/code.svg +0 -1
  28. package/dist/assets/icons/comments.svg +0 -1
  29. package/dist/assets/icons/copy.svg +0 -1
  30. package/dist/assets/icons/diagram-2.svg +0 -1
  31. package/dist/assets/icons/download.svg +0 -1
  32. package/dist/assets/icons/draggable-block-menu.svg +0 -1
  33. package/dist/assets/icons/dropdown-more.svg +0 -1
  34. package/dist/assets/icons/figma.svg +0 -1
  35. package/dist/assets/icons/file-earmark-text.svg +0 -4
  36. package/dist/assets/icons/file-image.svg +0 -1
  37. package/dist/assets/icons/filetype-gif.svg +0 -1
  38. package/dist/assets/icons/font-color.svg +0 -1
  39. package/dist/assets/icons/font-family.svg +0 -1
  40. package/dist/assets/icons/gear.svg +0 -1
  41. package/dist/assets/icons/horizontal-rule.svg +0 -1
  42. package/dist/assets/icons/indent.svg +0 -1
  43. package/dist/assets/icons/journal-code.svg +0 -1
  44. package/dist/assets/icons/journal-text.svg +0 -1
  45. package/dist/assets/icons/justify.svg +0 -1
  46. package/dist/assets/icons/link.svg +0 -1
  47. package/dist/assets/icons/list-ol.svg +0 -1
  48. package/dist/assets/icons/list-ul.svg +0 -1
  49. package/dist/assets/icons/lock-fill.svg +0 -1
  50. package/dist/assets/icons/lock.svg +0 -1
  51. package/dist/assets/icons/markdown.svg +0 -1
  52. package/dist/assets/icons/mic.svg +0 -1
  53. package/dist/assets/icons/minus-sign.svg +0 -3
  54. package/dist/assets/icons/outdent.svg +0 -1
  55. package/dist/assets/icons/paint-bucket.svg +0 -1
  56. package/dist/assets/icons/palette.svg +0 -1
  57. package/dist/assets/icons/pencil-fill.svg +0 -1
  58. package/dist/assets/icons/plug-fill.svg +0 -1
  59. package/dist/assets/icons/plug.svg +0 -1
  60. package/dist/assets/icons/plus-slash-minus.svg +0 -1
  61. package/dist/assets/icons/plus.svg +0 -1
  62. package/dist/assets/icons/prettier-error.svg +0 -1
  63. package/dist/assets/icons/prettier.svg +0 -1
  64. package/dist/assets/icons/scissors.svg +0 -3
  65. package/dist/assets/icons/send.svg +0 -1
  66. package/dist/assets/icons/square-check.svg +0 -1
  67. package/dist/assets/icons/sticky.svg +0 -1
  68. package/dist/assets/icons/success-alt.svg +0 -1
  69. package/dist/assets/icons/success.svg +0 -1
  70. package/dist/assets/icons/table.svg +0 -1
  71. package/dist/assets/icons/text-center.svg +0 -1
  72. package/dist/assets/icons/text-left.svg +0 -1
  73. package/dist/assets/icons/text-paragraph.svg +0 -1
  74. package/dist/assets/icons/text-right.svg +0 -1
  75. package/dist/assets/icons/trash.svg +0 -1
  76. package/dist/assets/icons/trash3.svg +0 -1
  77. package/dist/assets/icons/tweet.svg +0 -1
  78. package/dist/assets/icons/type-bold.svg +0 -1
  79. package/dist/assets/icons/type-h1.svg +0 -1
  80. package/dist/assets/icons/type-h2.svg +0 -1
  81. package/dist/assets/icons/type-h3.svg +0 -1
  82. package/dist/assets/icons/type-h4.svg +0 -1
  83. package/dist/assets/icons/type-h5.svg +0 -1
  84. package/dist/assets/icons/type-h6.svg +0 -1
  85. package/dist/assets/icons/type-italic.svg +0 -1
  86. package/dist/assets/icons/type-strikethrough.svg +0 -1
  87. package/dist/assets/icons/type-subscript.svg +0 -1
  88. package/dist/assets/icons/type-superscript.svg +0 -1
  89. package/dist/assets/icons/type-underline.svg +0 -1
  90. package/dist/assets/icons/upload.svg +0 -1
  91. package/dist/assets/icons/user.svg +0 -1
  92. package/dist/assets/icons/youtube.svg +0 -1
  93. package/dist/src/components/hooks/useModal.d.ts +0 -12
  94. package/dist/src/components/plugins/PageMargin.d.ts +0 -14
  95. package/dist/src/components/plugins/PageMarginPlugin/CustomMarginDialog.d.ts +0 -13
  96. package/dist/src/components/plugins/PageMarginPlugin/index.d.ts +0 -46
  97. package/dist/src/components/plugins/ToolbarPlugin/TextAlignment.d.ts +0 -8
  98. package/dist/src/components/ui/Button.d.ts +0 -17
  99. package/dist/src/components/ui/ContentEditable.d.ts +0 -12
  100. package/dist/src/components/ui/Dialog.d.ts +0 -15
  101. package/dist/src/components/ui/Divider.d.ts +0 -2
  102. package/dist/src/components/ui/DropDown.d.ts +0 -24
  103. package/dist/src/components/ui/Modal.d.ts +0 -14
  104. package/dist/src/components/ui/TextInput.d.ts +0 -19
  105. package/dist/src/utils/getSelectedNode.d.ts +0 -2
  106. package/dist/src/utils/joinClasses.d.ts +0 -8
  107. /package/dist/src/components/plugins/{ToolbarPlugin/ToolbarPlugin.d.ts → ToolbarPlugin.d.ts} +0 -0
package/dist/index.umd.js CHANGED
@@ -1,43 +1,42 @@
1
- (function(Re,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],D):(Re=typeof globalThis<"u"?globalThis:Re||self,D(Re.ViteButton={},Re.React,Re.ReactDOM))})(this,function(Re,D,un){"use strict";function Zs(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const lt=Zs(D);var or={exports:{}},at={};/*
1
+ (function(Pe,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],P):(Pe=typeof globalThis<"u"?globalThis:Pe||self,P(Pe.ViteButton={},Pe.React,Pe.ReactDOM))})(this,function(Pe,P,di){"use strict";function Ps(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Vn=Ps(P);var Jn={exports:{}},it={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var sr,wi;function Si(){if(wi)return sr;wi=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return sr=i()?Object.assign:function(o,s){for(var l,a=r(o),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)e.call(l,f)&&(a[f]=l[f]);if(n){c=n(l);for(var d=0;d<c.length;d++)t.call(l,c[d])&&(a[c[d]]=l[c[d]])}}return a},sr}/** @license React v17.0.2
5
+ */var Zn,fi;function gi(){if(fi)return Zn;fi=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Zn=i()?Object.assign:function(o,s){for(var l,a=r(o),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)e.call(l,f)&&(a[f]=l[f]);if(n){c=n(l);for(var d=0;d<c.length;d++)t.call(l,c[d])&&(a[c[d]]=l[c[d]])}}return a},Zn}/** @license React v17.0.2
6
6
  * react-jsx-runtime.production.min.js
7
7
  *
8
8
  * Copyright (c) Facebook, Inc. and its affiliates.
9
9
  *
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
- */var Ti;function el(){if(Ti)return at;Ti=1,Si();var n=D,e=60103;if(at.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),at.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,o={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,f={},d=null,h=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(h=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:h,props:f,_owner:r.current}}return at.jsx=s,at.jsxs=s,at}var lr={};/** @license React v17.0.2
12
+ */var hi;function zs(){if(hi)return it;hi=1,gi();var n=P,e=60103;if(it.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),it.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,o={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,f={},d=null,g=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(g=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:g,props:f,_owner:r.current}}return it.jsx=s,it.jsxs=s,it}var qn={};/** @license React v17.0.2
13
13
  * react-jsx-runtime.development.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var ki;function tl(){return ki||(ki=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=D,t=Si(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,f=60120,d=60115,h=60116,g=60121,m=60122,_=60117,v=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var x=Symbol.for;r=x("react.element"),i=x("react.portal"),n.Fragment=x("react.fragment"),o=x("react.strict_mode"),s=x("react.profiler"),l=x("react.provider"),a=x("react.context"),c=x("react.forward_ref"),u=x("react.suspense"),f=x("react.suspense_list"),d=x("react.memo"),h=x("react.lazy"),g=x("react.block"),m=x("react.server.block"),_=x("react.fundamental"),x("react.scope"),x("react.opaque.id"),v=x("react.debug_trace_mode"),x("react.offscreen"),y=x("react.legacy_hidden")}var k=typeof Symbol=="function"&&Symbol.iterator,S="@@iterator";function w(p){if(p===null||typeof p!="object")return null;var E=k&&p[k]||p[S];return typeof E=="function"?E:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(p){{for(var E=arguments.length,L=new Array(E>1?E-1:0),$=1;$<E;$++)L[$-1]=arguments[$];N("error",p,L)}}function N(p,E,L){{var $=P.ReactDebugCurrentFrame,J=$.getStackAddendum();J!==""&&(E+="%s",L=L.concat([J]));var Y=L.map(function(z){return""+z});Y.unshift("Warning: "+E),Function.prototype.apply.call(console[p],console,Y)}}var F=!1;function R(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===o||p===u||p===f||p===y||F||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===g||p[0]===m))}function H(p,E,L){var $=E.displayName||E.name||"";return p.displayName||($!==""?L+"("+$+")":L)}function V(p){return p.displayName||"Context"}function W(p){if(p==null)return null;if(typeof p.tag=="number"&&T("Received an unexpected object in getComponentName(). 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 n.Fragment:return"Fragment";case i:return"Portal";case s:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var E=p;return V(E)+".Consumer";case l:var L=p;return V(L._context)+".Provider";case c:return H(p,p.render,"ForwardRef");case d:return W(p.type);case g:return W(p._render);case h:{var $=p,J=$._payload,Y=$._init;try{return W(Y(J))}catch{return null}}}return null}var q=0,ce,Fe,He,sn,ln,an,wt;function St(){}St.__reactDisabledLog=!0;function Tt(){{if(q===0){ce=console.log,Fe=console.info,He=console.warn,sn=console.error,ln=console.group,an=console.groupCollapsed,wt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:St,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}q++}}function kt(){{if(q--,q===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:Fe}),warn:t({},p,{value:He}),error:t({},p,{value:sn}),group:t({},p,{value:ln}),groupCollapsed:t({},p,{value:an}),groupEnd:t({},p,{value:wt})})}q<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var me=P.ReactCurrentDispatcher,ot;function Oe(p,E,L){{if(ot===void 0)try{throw Error()}catch(J){var $=J.stack.trim().match(/\n( *(at )?)/);ot=$&&$[1]||""}return`
20
- `+ot+p}}var qe=!1,st;{var Uc=typeof WeakMap=="function"?WeakMap:Map;st=new Uc}function Ws(p,E){if(!p||qe)return"";{var L=st.get(p);if(L!==void 0)return L}var $;qe=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=me.current,me.current=null,Tt();try{if(E){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch($e){$=$e}Reflect.construct(p,[],z)}else{try{z.call()}catch($e){$=$e}p.call(z.prototype)}}else{try{throw Error()}catch($e){$=$e}p()}}catch($e){if($e&&$&&typeof $e.stack=="string"){for(var B=$e.stack.split(`
21
- `),ue=$.stack.split(`
22
- `),X=B.length-1,Z=ue.length-1;X>=1&&Z>=0&&B[X]!==ue[Z];)Z--;for(;X>=1&&Z>=0;X--,Z--)if(B[X]!==ue[Z]){if(X!==1||Z!==1)do if(X--,Z--,Z<0||B[X]!==ue[Z]){var Me=`
23
- `+B[X].replace(" at new "," at ");return typeof p=="function"&&st.set(p,Me),Me}while(X>=1&&Z>=0);break}}}finally{qe=!1,me.current=Y,kt(),Error.prepareStackTrace=J}var Nt=p?p.displayName||p.name:"",Qs=Nt?Oe(Nt):"";return typeof p=="function"&&st.set(p,Qs),Qs}function Bs(p,E,L){return Ws(p,!1)}function Vc(p){var E=p.prototype;return!!(E&&E.isReactComponent)}function rr(p,E,L){if(p==null)return"";if(typeof p=="function")return Ws(p,Vc(p));if(typeof p=="string")return Oe(p);switch(p){case u:return Oe("Suspense");case f:return Oe("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Bs(p.render);case d:return rr(p.type,E,L);case g:return Bs(p._render);case h:{var $=p,J=$._payload,Y=$._init;try{return rr(Y(J),E,L)}catch{}}}return""}var zs={},Ks=P.ReactDebugCurrentFrame;function ir(p){if(p){var E=p._owner,L=rr(p.type,p._source,E?E.type:null);Ks.setExtraStackFrame(L)}else Ks.setExtraStackFrame(null)}function Jc(p,E,L,$,J){{var Y=Function.call.bind(Object.prototype.hasOwnProperty);for(var z in p)if(Y(p,z)){var B=void 0;try{if(typeof p[z]!="function"){var ue=Error(($||"React class")+": "+L+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}B=p[z](E,z,$,L,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){B=X}B&&!(B instanceof Error)&&(ir(J),T("%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).",$||"React class",L,z,typeof B),ir(null)),B instanceof Error&&!(B.message in zs)&&(zs[B.message]=!0,ir(J),T("Failed %s type: %s",L,B.message),ir(null))}}}var cn=P.ReactCurrentOwner,yi=Object.prototype.hasOwnProperty,Yc={key:!0,ref:!0,__self:!0,__source:!0},Us,Vs,xi;xi={};function Hc(p){if(yi.call(p,"ref")){var E=Object.getOwnPropertyDescriptor(p,"ref").get;if(E&&E.isReactWarning)return!1}return p.ref!==void 0}function qc(p){if(yi.call(p,"key")){var E=Object.getOwnPropertyDescriptor(p,"key").get;if(E&&E.isReactWarning)return!1}return p.key!==void 0}function Gc(p,E){if(typeof p.ref=="string"&&cn.current&&E&&cn.current.stateNode!==E){var L=W(cn.current.type);xi[L]||(T('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',W(cn.current.type),p.ref),xi[L]=!0)}}function Xc(p,E){{var L=function(){Us||(Us=!0,T("%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)",E))};L.isReactWarning=!0,Object.defineProperty(p,"key",{get:L,configurable:!0})}}function Qc(p,E){{var L=function(){Vs||(Vs=!0,T("%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)",E))};L.isReactWarning=!0,Object.defineProperty(p,"ref",{get:L,configurable:!0})}}var Zc=function(p,E,L,$,J,Y,z){var B={$$typeof:r,type:p,key:E,ref:L,props:z,_owner:Y};return B._store={},Object.defineProperty(B._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(B,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.defineProperty(B,"_source",{configurable:!1,enumerable:!1,writable:!1,value:J}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B};function eu(p,E,L,$,J){{var Y,z={},B=null,ue=null;L!==void 0&&(B=""+L),qc(E)&&(B=""+E.key),Hc(E)&&(ue=E.ref,Gc(E,J));for(Y in E)yi.call(E,Y)&&!Yc.hasOwnProperty(Y)&&(z[Y]=E[Y]);if(p&&p.defaultProps){var X=p.defaultProps;for(Y in X)z[Y]===void 0&&(z[Y]=X[Y])}if(B||ue){var Z=typeof p=="function"?p.displayName||p.name||"Unknown":p;B&&Xc(z,Z),ue&&Qc(z,Z)}return Zc(p,B,ue,J,$,cn.current,z)}}var vi=P.ReactCurrentOwner,Js=P.ReactDebugCurrentFrame;function Et(p){if(p){var E=p._owner,L=rr(p.type,p._source,E?E.type:null);Js.setExtraStackFrame(L)}else Js.setExtraStackFrame(null)}var bi;bi=!1;function Ci(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Ys(){{if(vi.current){var p=W(vi.current.type);if(p)return`
19
+ */var pi;function Rs(){return pi||(pi=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=P,t=gi(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,f=60120,d=60115,g=60116,h=60121,m=60122,_=60117,v=60129,x=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;r=y("react.element"),i=y("react.portal"),n.Fragment=y("react.fragment"),o=y("react.strict_mode"),s=y("react.profiler"),l=y("react.provider"),a=y("react.context"),c=y("react.forward_ref"),u=y("react.suspense"),f=y("react.suspense_list"),d=y("react.memo"),g=y("react.lazy"),h=y("react.block"),m=y("react.server.block"),_=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),v=y("react.debug_trace_mode"),y("react.offscreen"),x=y("react.legacy_hidden")}var b=typeof Symbol=="function"&&Symbol.iterator,T="@@iterator";function S(p){if(p===null||typeof p!="object")return null;var w=b&&p[b]||p[T];return typeof w=="function"?w:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function N(p){{for(var w=arguments.length,I=new Array(w>1?w-1:0),z=1;z<w;z++)I[z-1]=arguments[z];M("error",p,I)}}function M(p,w,I){{var z=E.ReactDebugCurrentFrame,K=z.getStackAddendum();K!==""&&(w+="%s",I=I.concat([K]));var Q=I.map(function(U){return""+U});Q.unshift("Warning: "+w),Function.prototype.apply.call(console[p],console,Q)}}var R=!1;function B(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===o||p===u||p===f||p===x||R||typeof p=="object"&&p!==null&&(p.$$typeof===g||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===h||p[0]===m))}function ee(p,w,I){var z=w.displayName||w.name||"";return p.displayName||(z!==""?I+"("+z+")":I)}function J(p){return p.displayName||"Context"}function F(p){if(p==null)return null;if(typeof p.tag=="number"&&N("Received an unexpected object in getComponentName(). 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 n.Fragment:return"Fragment";case i:return"Portal";case s:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var w=p;return J(w)+".Consumer";case l:var I=p;return J(I._context)+".Provider";case c:return ee(p,p.render,"ForwardRef");case d:return F(p.type);case h:return F(p._render);case g:{var z=p,K=z._payload,Q=z._init;try{return F(Q(K))}catch{return null}}}return null}var V=0,ce,De,Ke,Ht,Xt,en,xt;function vt(){}vt.__reactDisabledLog=!0;function Ct(){{if(V===0){ce=console.log,De=console.info,Ke=console.warn,Ht=console.error,Xt=console.group,en=console.groupCollapsed,xt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:vt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}V++}}function St(){{if(V--,V===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:De}),warn:t({},p,{value:Ke}),error:t({},p,{value:Ht}),group:t({},p,{value:Xt}),groupCollapsed:t({},p,{value:en}),groupEnd:t({},p,{value:xt})})}V<0&&N("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=E.ReactCurrentDispatcher,nt;function Me(p,w,I){{if(nt===void 0)try{throw Error()}catch(K){var z=K.stack.trim().match(/\n( *(at )?)/);nt=z&&z[1]||""}return`
20
+ `+nt+p}}var Qe=!1,rt;{var dc=typeof WeakMap=="function"?WeakMap:Map;rt=new dc}function Ts(p,w){if(!p||Qe)return"";{var I=rt.get(p);if(I!==void 0)return I}var z;Qe=!0;var K=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q;Q=pe.current,pe.current=null,Ct();try{if(w){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(Ae){z=Ae}Reflect.construct(p,[],U)}else{try{U.call()}catch(Ae){z=Ae}p.call(U.prototype)}}else{try{throw Error()}catch(Ae){z=Ae}p()}}catch(Ae){if(Ae&&z&&typeof Ae.stack=="string"){for(var W=Ae.stack.split(`
21
+ `),ue=z.stack.split(`
22
+ `),q=W.length-1,H=ue.length-1;q>=1&&H>=0&&W[q]!==ue[H];)H--;for(;q>=1&&H>=0;q--,H--)if(W[q]!==ue[H]){if(q!==1||H!==1)do if(q--,H--,H<0||W[q]!==ue[H]){var Oe=`
23
+ `+W[q].replace(" at new "," at ");return typeof p=="function"&&rt.set(p,Oe),Oe}while(q>=1&&H>=0);break}}}finally{Qe=!1,pe.current=Q,St(),Error.prepareStackTrace=K}var Nt=p?p.displayName||p.name:"",As=Nt?Me(Nt):"";return typeof p=="function"&&rt.set(p,As),As}function Ns(p,w,I){return Ts(p,!1)}function fc(p){var w=p.prototype;return!!(w&&w.isReactComponent)}function Kn(p,w,I){if(p==null)return"";if(typeof p=="function")return Ts(p,fc(p));if(typeof p=="string")return Me(p);switch(p){case u:return Me("Suspense");case f:return Me("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Ns(p.render);case d:return Kn(p.type,w,I);case h:return Ns(p._render);case g:{var z=p,K=z._payload,Q=z._init;try{return Kn(Q(K),w,I)}catch{}}}return""}var bs={},ws=E.ReactDebugCurrentFrame;function Qn(p){if(p){var w=p._owner,I=Kn(p.type,p._source,w?w.type:null);ws.setExtraStackFrame(I)}else ws.setExtraStackFrame(null)}function gc(p,w,I,z,K){{var Q=Function.call.bind(Object.prototype.hasOwnProperty);for(var U in p)if(Q(p,U)){var W=void 0;try{if(typeof p[U]!="function"){var ue=Error((z||"React class")+": "+I+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}W=p[U](w,U,z,I,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){W=q}W&&!(W instanceof Error)&&(Qn(K),N("%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).",z||"React class",I,U,typeof W),Qn(null)),W instanceof Error&&!(W.message in bs)&&(bs[W.message]=!0,Qn(K),N("Failed %s type: %s",I,W.message),Qn(null))}}}var tn=E.ReactCurrentOwner,si=Object.prototype.hasOwnProperty,hc={key:!0,ref:!0,__self:!0,__source:!0},Ms,Es,li;li={};function pc(p){if(si.call(p,"ref")){var w=Object.getOwnPropertyDescriptor(p,"ref").get;if(w&&w.isReactWarning)return!1}return p.ref!==void 0}function _c(p){if(si.call(p,"key")){var w=Object.getOwnPropertyDescriptor(p,"key").get;if(w&&w.isReactWarning)return!1}return p.key!==void 0}function mc(p,w){if(typeof p.ref=="string"&&tn.current&&w&&tn.current.stateNode!==w){var I=F(tn.current.type);li[I]||(N('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',F(tn.current.type),p.ref),li[I]=!0)}}function yc(p,w){{var I=function(){Ms||(Ms=!0,N("%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)",w))};I.isReactWarning=!0,Object.defineProperty(p,"key",{get:I,configurable:!0})}}function xc(p,w){{var I=function(){Es||(Es=!0,N("%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)",w))};I.isReactWarning=!0,Object.defineProperty(p,"ref",{get:I,configurable:!0})}}var vc=function(p,w,I,z,K,Q,U){var W={$$typeof:r,type:p,key:w,ref:I,props:U,_owner:Q};return W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function Cc(p,w,I,z,K){{var Q,U={},W=null,ue=null;I!==void 0&&(W=""+I),_c(w)&&(W=""+w.key),pc(w)&&(ue=w.ref,mc(w,K));for(Q in w)si.call(w,Q)&&!hc.hasOwnProperty(Q)&&(U[Q]=w[Q]);if(p&&p.defaultProps){var q=p.defaultProps;for(Q in q)U[Q]===void 0&&(U[Q]=q[Q])}if(W||ue){var H=typeof p=="function"?p.displayName||p.name||"Unknown":p;W&&yc(U,H),ue&&xc(U,H)}return vc(p,W,ue,K,z,tn.current,U)}}var ai=E.ReactCurrentOwner,ks=E.ReactDebugCurrentFrame;function Tt(p){if(p){var w=p._owner,I=Kn(p.type,p._source,w?w.type:null);ks.setExtraStackFrame(I)}else ks.setExtraStackFrame(null)}var ci;ci=!1;function ui(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Ls(){{if(ai.current){var p=F(ai.current.type);if(p)return`
24
24
 
25
- Check the render method of \``+p+"`."}return""}}function tu(p){{if(p!==void 0){var E=p.fileName.replace(/^.*[\\\/]/,""),L=p.lineNumber;return`
25
+ Check the render method of \``+p+"`."}return""}}function Sc(p){{if(p!==void 0){var w=p.fileName.replace(/^.*[\\\/]/,""),I=p.lineNumber;return`
26
26
 
27
- Check your code at `+E+":"+L+"."}return""}}var Hs={};function nu(p){{var E=Ys();if(!E){var L=typeof p=="string"?p:p.displayName||p.name;L&&(E=`
27
+ Check your code at `+w+":"+I+"."}return""}}var js={};function Tc(p){{var w=Ls();if(!w){var I=typeof p=="string"?p:p.displayName||p.name;I&&(w=`
28
28
 
29
- Check the top-level render call using <`+L+">.")}return E}}function qs(p,E){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var L=nu(E);if(Hs[L])return;Hs[L]=!0;var $="";p&&p._owner&&p._owner!==vi.current&&($=" It was passed a child from "+W(p._owner.type)+"."),Et(p),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',L,$),Et(null)}}function Gs(p,E){{if(typeof p!="object")return;if(Array.isArray(p))for(var L=0;L<p.length;L++){var $=p[L];Ci($)&&qs($,E)}else if(Ci(p))p._store&&(p._store.validated=!0);else if(p){var J=w(p);if(typeof J=="function"&&J!==p.entries)for(var Y=J.call(p),z;!(z=Y.next()).done;)Ci(z.value)&&qs(z.value,E)}}}function ru(p){{var E=p.type;if(E==null||typeof E=="string")return;var L;if(typeof E=="function")L=E.propTypes;else if(typeof E=="object"&&(E.$$typeof===c||E.$$typeof===d))L=E.propTypes;else return;if(L){var $=W(E);Jc(L,p.props,"prop",$,p)}else if(E.PropTypes!==void 0&&!bi){bi=!0;var J=W(E);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",J||"Unknown")}typeof E.getDefaultProps=="function"&&!E.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function iu(p){{for(var E=Object.keys(p.props),L=0;L<E.length;L++){var $=E[L];if($!=="children"&&$!=="key"){Et(p),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$),Et(null);break}}p.ref!==null&&(Et(p),T("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function Xs(p,E,L,$,J,Y){{var z=R(p);if(!z){var B="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(B+=" 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 ue=tu(J);ue?B+=ue:B+=Ys();var X;p===null?X="null":Array.isArray(p)?X="array":p!==void 0&&p.$$typeof===r?(X="<"+(W(p.type)||"Unknown")+" />",B=" Did you accidentally export a JSX literal instead of a component?"):X=typeof p,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,B)}var Z=eu(p,E,L,J,Y);if(Z==null)return Z;if(z){var Me=E.children;if(Me!==void 0)if($)if(Array.isArray(Me)){for(var Nt=0;Nt<Me.length;Nt++)Gs(Me[Nt],p);Object.freeze&&Object.freeze(Me)}else T("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 Gs(Me,p)}return p===n.Fragment?iu(Z):ru(Z),Z}}function ou(p,E,L){return Xs(p,E,L,!0)}function su(p,E,L){return Xs(p,E,L,!1)}var lu=su,au=ou;n.jsx=lu,n.jsxs=au}()}(lr)),lr}process.env.NODE_ENV==="production"?or.exports=el():or.exports=tl();var b=or.exports;function nl(n){return{}}const dn={},rl={},Ei={},Ge={},ct={},fn={},ut={},ar={},cr={},Pt={},Ot={},de={},hn={},gn={},il={},Ni={},ol={},Pi={},sl={},Oi={},Di={},pn={},ll={},ji={},Ai={},Li={},al={},cl={},Ii={},ur={},Fi={},_e={},Mi={},$i={},ul={},mn={},dr={},fr={},dl={},fl={},Dt={},jt={},hl={},gl={},pl={},ye=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ml=ye&&"documentMode"in document?document.documentMode:null,xe=ye&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),We=ye&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_n=!(!ye||!("InputEvent"in window)||ml)&&"getTargetRanges"in new window.InputEvent("input"),hr=ye&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),yn=ye&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_l=ye&&/Android/.test(navigator.userAgent),Ri=ye&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yl=ye&&_l&&Ri,gr=ye&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ri,At=1,Be=3,Xe=0,Wi=1,dt=2,xl=0,vl=1,bl=2,xn=4,vn=8,pr=128,Cl=112|(3|xn|vn)|pr,mr=1,_r=2,yr=3,xr=4,vr=5,br=6,bn=hr||yn||gr?" ":"​",De=`
29
+ Check the top-level render call using <`+I+">.")}return w}}function Is(p,w){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var I=Tc(w);if(js[I])return;js[I]=!0;var z="";p&&p._owner&&p._owner!==ai.current&&(z=" It was passed a child from "+F(p._owner.type)+"."),Tt(p),N('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',I,z),Tt(null)}}function Ds(p,w){{if(typeof p!="object")return;if(Array.isArray(p))for(var I=0;I<p.length;I++){var z=p[I];ui(z)&&Is(z,w)}else if(ui(p))p._store&&(p._store.validated=!0);else if(p){var K=S(p);if(typeof K=="function"&&K!==p.entries)for(var Q=K.call(p),U;!(U=Q.next()).done;)ui(U.value)&&Is(U.value,w)}}}function Nc(p){{var w=p.type;if(w==null||typeof w=="string")return;var I;if(typeof w=="function")I=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===c||w.$$typeof===d))I=w.propTypes;else return;if(I){var z=F(w);gc(I,p.props,"prop",z,p)}else if(w.PropTypes!==void 0&&!ci){ci=!0;var K=F(w);N("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",K||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&N("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function bc(p){{for(var w=Object.keys(p.props),I=0;I<w.length;I++){var z=w[I];if(z!=="children"&&z!=="key"){Tt(p),N("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),Tt(null);break}}p.ref!==null&&(Tt(p),N("Invalid attribute `ref` supplied to `React.Fragment`."),Tt(null))}}function Os(p,w,I,z,K,Q){{var U=B(p);if(!U){var W="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(W+=" 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 ue=Sc(K);ue?W+=ue:W+=Ls();var q;p===null?q="null":Array.isArray(p)?q="array":p!==void 0&&p.$$typeof===r?(q="<"+(F(p.type)||"Unknown")+" />",W=" Did you accidentally export a JSX literal instead of a component?"):q=typeof p,N("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",q,W)}var H=Cc(p,w,I,K,Q);if(H==null)return H;if(U){var Oe=w.children;if(Oe!==void 0)if(z)if(Array.isArray(Oe)){for(var Nt=0;Nt<Oe.length;Nt++)Ds(Oe[Nt],p);Object.freeze&&Object.freeze(Oe)}else N("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 Ds(Oe,p)}return p===n.Fragment?bc(H):Nc(H),H}}function wc(p,w,I){return Os(p,w,I,!0)}function Mc(p,w,I){return Os(p,w,I,!1)}var Ec=Mc,kc=wc;n.jsx=Ec,n.jsxs=kc}()}(qn)),qn}process.env.NODE_ENV==="production"?Jn.exports=zs():Jn.exports=Rs();var A=Jn.exports;function Fs(n){return{}}const nn={},Ws={},_i={},Ve={},ot={},rn={},st={},Gn={},Hn={},bt={},wt={},de={},on={},sn={},Bs={},mi={},Us={},yi={},$s={},xi={},vi={},ln={},Ys={},Ci={},Si={},Ti={},Ks={},Qs={},Vs={},Ni={},bi={},Mt={},wi={},Mi={},Js={},an={},Xn={},er={},Zs={},qs={},Et={},kt={},Gs={},Hs={},Xs={},_e=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,el=_e&&"documentMode"in document?document.documentMode:null,me=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ze=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),cn=!(!_e||!("InputEvent"in window)||el)&&"getTargetRanges"in new window.InputEvent("input"),tr=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),un=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tl=_e&&/Android/.test(navigator.userAgent),Ei=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),nl=_e&&tl&&Ei,nr=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ei,Lt=1,Re=3,Je=0,ki=1,lt=2,rl=0,il=1,ol=2,dn=4,fn=8,rr=128,sl=112|(3|dn|fn)|rr,ir=1,or=2,sr=3,lr=4,ar=5,cr=6,gn=tr||un||nr?" ":"​",Ee=`
30
30
 
31
- `,wl=We?" ":bn,Bi="֑-߿יִ-﷽ﹰ-ﻼ",zi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Sl=new RegExp("^[^"+zi+"]*["+Bi+"]"),Tl=new RegExp("^[^"+Bi+"]*["+zi+"]"),je={bold:1,code:16,highlight:pr,italic:2,strikethrough:xn,subscript:32,superscript:64,underline:vn},kl={directionless:1,unmergeable:2},Ki={center:_r,end:br,justify:xr,left:mr,right:yr,start:vr},El={[_r]:"center",[br]:"end",[xr]:"justify",[mr]:"left",[yr]:"right",[vr]:"start"},Nl={normal:0,segmented:2,token:1},Pl={[xl]:"normal",[bl]:"segmented",[vl]:"token"};function Ol(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var A=Ol(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Cn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Dl=100;let Cr=!1,wr=0;function jl(n){wr=n.timeStamp}function Sr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function Al(n,e,t){const r=Te(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&Or(e,s,i,o,!1)}function Ll(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Be&&t.isAttached()}function Ui(n,e,t){Cr=!0;const r=performance.now()-wr>Dl;try{ge(n,()=>{const i=M()||function(d){return d.getEditorState().read(()=>{const h=M();return h!==null?h.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,m=h.target;let _=Ze(m,l);if(!(_===null&&m!==s||U(_))){if(g==="characterData")r&&j(_)&&Ll(i,m,_)&&Al(m,_,n);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let k=0;k<v.length;k++){const S=v[k],w=Zi(S),P=S.parentNode;if(P!=null&&S!==a&&w===null&&(S.nodeName!=="BR"||!Sr(S,P,n))){if(We){const T=S.innerText||S.nodeValue;T&&(u+=T)}P.removeChild(S)}}const y=h.removedNodes,x=y.length;if(x>0){let k=0;for(let S=0;S<x;S++){const w=y[S];(w.nodeName==="BR"&&Sr(w,m,n)||a===w)&&(m.appendChild(w),k++)}x!==k&&(m===s&&(_=no(l)),o.set(m,_))}}}}if(o.size>0)for(const[d,h]of o)if(C(h)){const g=h.getChildrenKeys();let m=d.firstChild;for(let _=0;_<g.length;_++){const v=g[_],y=n.getElementByKey(v);y!==null&&(m==null?(d.appendChild(y),m=y):m!==y&&d.replaceChild(y,m),m=m.nextSibling)}}else j(h)&&h.markDirty();const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,m=h.target;for(let _=0;_<g.length;_++){const v=g[_],y=v.parentNode;y==null||v.nodeName!=="BR"||Sr(v,m,n)||y.removeChild(v)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,Se(i)),We&&ho(n)&&i.insertRawText(u))})}finally{Cr=!1}}function Vi(n){const e=n._observer;e!==null&&Ui(n,e.takeRecords(),e)}function Ji(n){(function(e){wr===0&&Pn(e).addEventListener("textInput",jl,!0)})(n),n._observer=new MutationObserver((e,t)=>{Ui(n,e,t)})}function Yi(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==o||r!==null&&r!==s||i!==null&&i!==l)}function Hi(n,e){const t=n.mergeWithSibling(e),r=G()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function qi(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&j(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Yi(e,r)){r=Hi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&j(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Yi(r,t)){r=Hi(r,t);break}break}t.remove()}}else r.remove()}function Gi(n){return Xi(n.anchor),Xi(n.focus),n}function Xi(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),j(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!C(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let Il=1;const Fl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Tr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(Ze(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&wn(e)==null)}function Lt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Tr(e)&&Qi(e)===n}catch{return!1}}function kr(n){return n instanceof Jn}function Qi(n){let e=n;for(;e!=null;){const t=wn(e);if(kr(t))return t;e=Nn(e)}return null}function wn(n){return n?n.__lexicalEditor:null}function ft(n){return n.isToken()||n.isSegmented()}function Ml(n){return n.nodeType===Be}function Sn(n){let e=n;for(;e!=null;){if(Ml(e))return e;e=e.firstChild}return null}function Er(n,e,t){const r=je[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~je.superscript:e==="superscript"&&(i&=~je.subscript),i}function $l(n,e){if(e!=null)return void(n.__key=e);he(),Xo();const t=G(),r=Ie(),i=""+Il++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Wi,n.__key=i}function Qe(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling();if(i===null)if(o!==null){const s=o.getWritable();r.__first=o.__key,s.__prev=null}else r.__first=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(o===null)if(i!==null){const s=i.getWritable();r.__last=i.__key,s.__next=null}else r.__last=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Tn(n){Xo();const e=n.getLatest(),t=e.__parent,r=Ie(),i=G(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let f=a;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}}(t,o,s);const l=e.__key;i._dirtyType=Wi,C(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){he();const e=G(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=se(t);r!==null&&r.getWritable()}if(n!==null){const r=se(n);r!==null&&r.getWritable()}}}function ze(){return Zt()?null:G()._compositionKey}function se(n,e){const t=(e||Ie())._nodeMap.get(n);return t===void 0?null:t}function Zi(n,e){const t=n[`__lexicalKey_${G()._key}`];return t!==void 0?se(t,e):null}function Ze(n,e){let t=n;for(;t!=null;){const r=Zi(t,e);if(r!==null)return r;t=Nn(t)}return null}function eo(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function to(n){return n.read(()=>Q().getTextContent())}function Q(){return no(Ie())}function no(n){return n._nodeMap.get("root")}function Se(n){he();const e=Ie();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ht(n){const e=G(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=Nn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function ro(n,e){return e?n.getTextContentSize():0}function io(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Nr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function oo(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function so(n){return n.nodeType===Be?n.nodeValue:null}function Pr(n,e,t){const r=Te(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=so(i);const a=Ze(i);if(l!==null&&j(a)){if(l===bn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&Or(a,l,o,s,n)}}}function Or(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===bn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),hr||yn||gr)o.remove();else{const m=G();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=Qt(),f=o.getTextContentSize(),d=ze(),h=o.getKey();if(o.isToken()||d!==null&&h===d&&!s||O(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!o.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===f&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const g=M();if(!O(g)||t===null||r===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=ie(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function Rl(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(o){const s=o.getPreviousSibling();return(j(s)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function lo(n){return n==="ArrowLeft"}function ao(n){return n==="ArrowRight"}function It(n,e){return xe?n:e}function co(n){return n==="Enter"}function Ft(n){return n==="Backspace"}function Mt(n){return n==="Delete"}function uo(n,e,t){return n.toLowerCase()==="a"&&It(e,t)}function Wl(){const n=Q();Se(Gi(n.select(0,n.getChildrenSize())))}function $t(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=Cn(i);return t[e]=o,o}return i}function Dr(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&A(33,o);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),f=u==="destroyed"&&i==="created";(u===void 0||f)&&c.set(s,f?"updated":i)}function fo(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function Rt(n,e){const t=n.offset;if(n.type==="element")return fo(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?fo(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function ho(n){const e=Pn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function I(n,e,t){return ns(n,e,t)}function kn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function En(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&A(75,e),t}function Nn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function jr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Pn(n){const e=n._window;return e===null&&A(78),e}function Bl(n){let e=n.getParentOrThrow();for(;e!==null;){if(gt(e))return e;e=e.getParentOrThrow()}return e}function gt(n){return oe(n)||C(n)&&n.isShadowRoot()}function Wt(n){const e=G(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&A(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||A(98),o}return n}function Ar(n,e){!oe(n.getParent())||C(e)||U(e)||A(99)}function Lr(n){return(U(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function Ir(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function zl(n,e,t){let r=n._blockCursorElement;if(O(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,o=i.getNode(),s=i.offset;let l=!1,a=null;if(s===o.getChildrenSize())Lr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Lr(c)){const u=c.getPreviousSibling();(u===null||Lr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(o.__key);return r===null&&(n._blockCursorElement=r=function(u){const f=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let h=f.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=Cn(h);h=f.blockCursor=g}h!==void 0&&d.classList.add(...h)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Ir(r,n,e)}function Te(n){return ye?(n||window).getSelection():null}function Kl(n){return On(n)&&n.tagName==="A"}function On(n){return n.nodeType===1}function Fr(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Dn(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function pt(n){if(oe(n)||U(n)&&!n.isInline())return!0;if(!C(n)||gt(n))return!1;const e=n.getFirstChild(),t=e===null||qt(e)||j(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Mr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ul(){return G()}const go=new WeakMap,Vl=new Map;function Jl(n){if(!n._readOnly&&n.isEmpty())return Vl;n._readOnly||A(192);let e=go.get(n);if(!e){e=new Map,go.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let o=e.get(i);o||(o=new Map,e.set(i,o)),o.set(t,r)}}return e}function $r(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function po(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(C(s)&&po(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let Ke,le,Bt,jn,Rr,Wr,et,ve,Br,zt,ee="",ae="",ke=null,be="",Ae="",mo=!1,Kt=!1,An=null;function Ln(n,e){const t=et.get(n);if(e!==null){const r=Vr(n);r.parentNode===e&&e.removeChild(r)}if(ve.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=Fn(t,et);zr(r,0,r.length-1,null)}t!==void 0&&Dr(zt,Bt,jn,t,"destroyed")}function zr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&Ln(o,r)}}function tt(n,e){n.setProperty("text-align",e)}const Yl="40px";function _o(n,e){const t=Ke.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Yl;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function yo(n,e){const t=n.style;e===0?tt(t,""):e===mr?tt(t,"left"):e===_r?tt(t,"center"):e===yr?tt(t,"right"):e===xr?tt(t,"justify"):e===vr?tt(t,"start"):e===br&&tt(t,"end")}function In(n,e,t){const r=ve.get(n);r===void 0&&A(60);const i=r.createDOM(Ke,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),j(r)?i.setAttribute("data-lexical-text","true"):U(r)&&i.setAttribute("data-lexical-decorator","true"),C(r)){const o=r.__indent,s=r.__size;if(o!==0&&_o(i,o),s!==0){const a=s-1;(function(c,u,f,d){const h=ae;ae="",Kr(c,f,0,u,d,null),bo(f,d),ae=h})(Fn(r,ve),a,r,i)}const l=r.__format;l!==0&&yo(i,l),r.isInline()||vo(null,r,i),kn(r)&&(ee+=De,Ae+=De)}else{const o=r.getTextContent();if(U(r)){const s=r.decorate(le,Ke);s!==null&&Co(n,s),i.contentEditable="false"}else j(r)&&(r.isDirectionless()||(ae+=o));ee+=o,Ae+=o}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const o=e.__lexicalLineBreak;o!=null?e.insertBefore(i,o):e.appendChild(i)}return Dr(zt,Bt,jn,r,"created"),i}function Kr(n,e,t,r,i,o){const s=ee;ee="";let l=t;for(;l<=r;++l){In(n[l],i,o);const a=ve.get(n[l]);a!==null&&j(a)&&(ke===null&&(ke=a.getFormat()),be===""&&(be=a.getStyle()))}kn(e)&&(ee+=De),i.__lexicalTextContent=ee,ee=s+ee}function xo(n,e){const t=e.get(n);return qt(t)||U(t)&&t.isInline()}function vo(n,e,t){const r=n!==null&&(n.__size===0||xo(n.__last,et)),i=e.__size===0||xo(e.__last,ve);if(r){if(!i){const o=t.__lexicalLineBreak;if(o!=null)try{t.removeChild(o)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${o.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(i){const o=document.createElement("br");t.__lexicalLineBreak=o,t.appendChild(o)}}function bo(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==An){const o=ae==="",s=o?An:(i=ae,Sl.test(i)?"rtl":Tl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=Ke.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const f=Cn(c);c=a[r]=f}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const f=Cn(u);u=a[s]=f}u!==void 0&&l.add(...u)}e.dir=s}Kt||(n.getWritable().__dir=s)}An=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function Hl(n,e,t){const r=ae;var i;ae="",ke=null,be="",function(o,s,l){const a=ee,c=o.__size,u=s.__size;if(ee="",c===1&&u===1){const f=o.__first,d=s.__first;if(f===d)Ut(f,l);else{const g=Vr(f),m=In(d,null,null);try{l.replaceChild(m,g)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(v)}throw _}Ln(f,null)}const h=ve.get(d);j(h)&&(ke===null&&(ke=h.getFormat()),be===""&&(be=h.getStyle()))}else{const f=Fn(o,et),d=Fn(s,ve);if(c===0)u!==0&&Kr(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;zr(f,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,m,_,v,y){const x=_-1,k=v-1;let S,w,P=(F=y,F.firstChild),T=0,N=0;for(var F;T<=x&&N<=k;){const V=g[T],W=m[N];if(V===W)P=Ur(Ut(W,y)),T++,N++;else{S===void 0&&(S=new Set(g)),w===void 0&&(w=new Set(m));const ce=w.has(V),Fe=S.has(W);if(ce)if(Fe){const He=En(le,W);He===P?P=Ur(Ut(W,y)):(P!=null?y.insertBefore(He,P):y.appendChild(He),Ut(W,y)),T++,N++}else In(W,y,P),N++;else P=Ur(Vr(V)),Ln(V,y),T++}const q=ve.get(W);q!==null&&j(q)&&(ke===null&&(ke=q.getFormat()),be===""&&(be=q.getStyle()))}const R=T>x,H=N>k;if(R&&!H){const V=m[k+1];Kr(m,h,N,k,y,V===void 0?null:le.getElementByKey(V))}else H&&!R&&zr(g,T,x,y)})(s,f,d,c,u,l)}kn(s)&&(ee+=De),l.__lexicalTextContent=ee,ee=a+ee}(n,e,t),bo(e,t),ui(i=e)&&ke!=null&&ke!==i.__textFormat&&!Kt&&(i.setTextFormat(ke),i.setTextStyle(be)),function(o){ui(o)&&be!==""&&be!==o.__textStyle&&!Kt&&o.setTextStyle(be)}(e),ae=r}function Fn(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&A(101),t.push(r),r=i.__next}return t}function Ut(n,e){const t=et.get(n);let r=ve.get(n);t!==void 0&&r!==void 0||A(61);const i=mo||Wr.has(n)||Rr.has(n),o=En(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(ee+=s,Ae+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();j(t)&&!t.isDirectionless()&&(ae+=s),Ae+=s,ee+=s}return o}if(t!==r&&i&&Dr(zt,Bt,jn,r,"updated"),r.updateDOM(t,o,Ke)){const s=In(n,null,null);return e===null&&A(62),e.replaceChild(s,o),Ln(n,null),s}if(C(t)&&C(r)){const s=r.__indent;s!==t.__indent&&_o(o,s);const l=r.__format;l!==t.__format&&yo(o,l),i&&(Hl(t,r,o),oe(r)||r.isInline()||vo(t,r,o)),kn(r)&&(ee+=De,Ae+=De)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Ke);l!==null&&Co(n,l)}else j(r)&&!r.isDirectionless()&&(ae+=s);ee+=s,Ae+=s}if(!Kt&&oe(r)&&r.__cachedText!==Ae){const s=r.getWritable();s.__cachedText=Ae,r=s}return o}function Co(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=eo(le)}t[n]=e}function Ur(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function ql(n,e,t,r,i,o){ee="",Ae="",ae="",mo=r===dt,An=null,le=t,Ke=t._config,Bt=t._nodes,jn=le._listeners.mutation,Rr=i,Wr=o,et=n._nodeMap,ve=e._nodeMap,Kt=e._readOnly,Br=new Map(t._keyToDOMMap);const s=new Map;return zt=s,Ut("root",null),le=void 0,Bt=void 0,Rr=void 0,Wr=void 0,et=void 0,ve=void 0,Ke=void 0,Br=void 0,zt=void 0,s}function Vr(n){const e=Br.get(n);return e===void 0&&A(75,n),e}const Le=Object.freeze({}),Jr=30,Yr=[["keydown",function(n,e){if(Vt=n.timeStamp,wo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;I(e,il,n)||t!=null&&(function(l,a,c,u){return ao(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Ni,n):function(l,a,c,u,f){return ao(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?I(e,ol,n):function(l,a,c,u){return lo(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Pi,n):function(l,a,c,u,f){return lo(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?I(e,sl,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?I(e,Oi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?I(e,Di,n):function(l,a){return co(l)&&a}(t,r)?(Jt=!0,I(e,pn,n)):function(l){return l===" "}(t)?I(e,ll,n):function(l,a){return xe&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),Jt=!0,I(e,ct,!0)):function(l,a){return co(l)&&!a}(t,r)?(Jt=!1,I(e,pn,n)):function(l,a,c,u){return xe?!a&&!c&&(Ft(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Ft(l)}(t,s,o,i)?Ft(t)?I(e,ji,n):(n.preventDefault(),I(e,Ge,!0)):function(l){return l==="Escape"}(t)?I(e,Ai,n):function(l,a,c,u,f){return xe?!(c||u||f)&&(Mt(l)||l.toLowerCase()==="d"&&a):!(a||u||f)&&Mt(l)}(t,i,r,s,o)?Mt(t)?I(e,Li,n):(n.preventDefault(),I(e,Ge,!1)):function(l,a,c){return Ft(l)&&(xe?a:c)}(t,s,i)?(n.preventDefault(),I(e,Pt,!0)):function(l,a,c){return Mt(l)&&(xe?a:c)}(t,s,i)?(n.preventDefault(),I(e,Pt,!1)):function(l,a){return xe&&a&&Ft(l)}(t,o)?(n.preventDefault(),I(e,Ot,!0)):function(l,a){return xe&&a&&Mt(l)}(t,o)?(n.preventDefault(),I(e,Ot,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,de,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,de,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,de,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?I(e,al,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&It(c,u)}(t,r,o,i)?(n.preventDefault(),I(e,hn,void 0)):function(l,a,c,u){return xe?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),I(e,gn,void 0)):Ce(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(xe?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,mn,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(xe?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,dr,n)):uo(t,o,i)&&(n.preventDefault(),I(e,fr,n)):!We&&uo(t,o,i)&&(n.preventDefault(),I(e,fr,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&I(e,pl,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&ge(e,()=>{U(Ze(t))||(qr=!0)})}],["compositionstart",function(n,e){ge(e,()=>{const t=M();if(O(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Vt+Jr||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||j(i)&&i.getStyle()!==t.style)&&I(e,ut,wl)}})}],["compositionend",function(n,e){We?Yt=!0:ge(e,()=>{Gr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),ge(e,()=>{const t=M(),r=n.data,i=Po(n);if(r!=null&&O(t)&&ko(t,i,r,n.timeStamp,!1)){Yt&&(Gr(e,r),Yt=!1);const o=t.anchor.getNode(),s=Te(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;_n&&!t.isCollapsed()&&j(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===so(s.anchorNode)||I(e,ut,r);const u=r.length;We&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),hr||yn||gr||!e.isComposing()||(Vt=0,re(null))}else Pr(!1,e,r!==null?r:void 0),Yt&&(Gr(e,r||void 0),Yt=!1);he(),Vi(G())}),mt=null}],["click",function(n,e){ge(e,()=>{const t=M(),r=Te(e._window),i=Qt();if(r){if(O(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&Q().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(C(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const o=r.anchorNode;if(o!==null){const s=o.nodeType;(s===At||s===Be)&&Se(ii(i,r,e,n))}}}I(e,Ei,n)})}],["cut",Le],["copy",Le],["dragstart",Le],["dragover",Le],["dragend",Le],["paste",Le],["focus",Le],["blur",Le],["drop",Le]];_n&&Yr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=Po(t);i==="deleteCompositionText"||We&&ho(r)||i!=="insertCompositionText"&&ge(r,()=>{const s=M();if(i==="deleteContentBackward"){if(s===null){const h=Qt();if(!O(h))return;Se(h.clone())}if(O(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,wo==="MediaLast"&&l<Vt+Jr&&r.isComposing()&&h){if(re(null),Vt=0,setTimeout(()=>{ge(r,()=>{re(null)})},Jr),O(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),j(g)||A(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===g.length;yl&&h&&!m||I(r,Ge,!0)}return}}var l;if(!O(s))return;const a=t.data;mt!==null&&Pr(!1,r,mt),s.dirty&&mt===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),mt=null;const c=s.anchor,u=s.focus,f=c.getNode(),d=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,ut,t);break;case"insertFromComposition":re(null),I(r,ut,t);break;case"insertLineBreak":re(null),I(r,ct,!1);break;case"insertParagraph":re(null),Jt&&!yn?(Jt=!1,I(r,ct,!1)):I(r,fn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,ar,t);break;case"deleteByComposition":(function(h,g){return h!==g||C(h)||C(g)||!h.isToken()||!g.isToken()})(f,d)&&I(r,cr,t);break;case"deleteByDrag":case"deleteByCut":I(r,cr,t);break;case"deleteContent":I(r,Ge,!1);break;case"deleteWordBackward":I(r,Pt,!0);break;case"deleteWordForward":I(r,Pt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,Ot,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,Ot,!1);break;case"formatStrikeThrough":I(r,de,"strikethrough");break;case"formatBold":I(r,de,"bold");break;case"formatItalic":I(r,de,"italic");break;case"formatUnderline":I(r,de,"underline");break;case"historyUndo":I(r,hn,void 0);break;case"historyRedo":I(r,gn,void 0)}else{if(a===`
32
- `)t.preventDefault(),I(r,ct,!1);else if(a===De)t.preventDefault(),I(r,fn,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(h)}else a!=null&&ko(s,o,a,t.timeStamp,!0)?(t.preventDefault(),I(r,ut,a)):mt=a;So=t.timeStamp}})}(n,e)]);let Vt=0,wo=null,So=0,mt=null;const Mn=new WeakMap;let Hr=!1,qr=!1,Jt=!1,Yt=!1,To=[0,"",0,"root",0];function ko(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=G(),c=Te(a._window),u=c!==null?c.anchorNode:null,f=o.key,d=a.getElementByKey(f),h=t.length;return f!==s.key||!j(l)||(!i&&(!_n||So<r+50)||l.isDirty()&&h<2||io(t))&&o.offset!==s.offset&&!l.isComposing()||ft(l)||l.isDirty()&&h>1||(i||!_n)&&d!==null&&!l.isComposing()&&u!==Sn(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Rl(n,l)}function Eo(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Be&&e!==0&&e!==n.nodeValue.length}function No(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;Hr&&(Hr=!1,Eo(r,i)&&Eo(o,s))||ge(e,()=>{if(!t)return void Se(null);if(!Lt(e,r,o))return;const l=M();if(O(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Pn(e).event,f=u?u.timeStamp:performance.now(),[d,h,g,m,_]=To,v=Q(),y=e.isComposing()===!1&&v.getTextContent()==="";if(f<_+200&&a.offset===g&&a.key===m)l.format=d,l.style=h;else if(a.type==="text")j(c)||A(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!y){const x=a.getNode();l.style="",x instanceof xt&&x.getChildrenSize()===0?(l.format=x.getTextFormat(),l.style=x.getTextStyle()):l.format=0}}else{const u=a.key,f=l.focus.key,d=l.getNodes(),h=d.length,g=l.isBackward(),m=g?s:i,_=g?i:s,v=g?f:u,y=g?u:f;let x=Cl,k=!1;for(let S=0;S<h;S++){const w=d[S],P=w.getTextContentSize();if(j(w)&&P!==0&&!(S===0&&w.__key===v&&m===P||S===h-1&&w.__key===y&&_===0)&&(k=!0,x&=w.getFormat(),x===0))break}l.format=k?x:0}}I(e,dn,void 0)})}function Po(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Gr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=Sn(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&j(r)&&Or(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
- `){const r=M();if(O(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void I(n,pn,null)}}}Pr(!0,n,e)}function Oo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const _t=new Map;function Do(n){const e=n.target,t=Te(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=Qi(t.anchorNode);if(r===null)return;qr&&(qr=!1,ge(r,()=>{const c=Qt(),u=t.anchorNode;if(u===null)return;const f=u.nodeType;f!==At&&f!==Be||Se(ii(c,t,r,n))}));const i=Nr(r),o=i[i.length-1],s=o._key,l=_t.get(s),a=l||o;a!==r&&No(t,a,!1),No(t,r,!0),r!==o?_t.set(s,r):l&&_t.delete(s)}function jo(n){n._lexicalHandled=!0}function Ao(n){return n._lexicalHandled===!0}function Gl(n){const e=n.ownerDocument,t=Mn.get(e);t===void 0&&A(162);const r=t-1;r>=0||A(164),Mn.set(e,r),r===0&&e.removeEventListener("selectionchange",Do);const i=wn(n);kr(i)?(function(s){if(s._parentEditor!==null){const l=Nr(s),a=l[l.length-1]._key;_t.get(a)===s&&_t.delete(a)}else _t.delete(s._key)}(i),n.__lexicalEditor=null):i&&A(198);const o=Oo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function Xr(n,e,t){he();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=M();if(!O(a)||!C(l))return a;const{anchor:c,focus:u}=a,f=c.getNode(),d=u.getNode();return jr(f,l)&&c.set(l.__key,0,"element"),jr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(O(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(Kn(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Kn(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else Ce(o)&&e&&n.isSelected()&&n.selectPrevious();if(O(o)&&e&&!s){const l=n.getIndexWithinParent();Qe(n),zn(o,i,l,-1)}else Qe(n);t||gt(i)||i.canBeEmpty()||!i.isEmpty()||Xr(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class $n{static getType(){A(64,this.name)}static clone(e){A(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,$l(this,e)}getType(){return this.__type}isInline(){A(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=se(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||M();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(j(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(U(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor,s=o.getNode();if(o.offset===s.getChildrenSize()&&s.is(i)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:se(e)}getParentOrThrow(){const e=this.getParent();return e===null&&A(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(gt(t))return C(e)||e===this&&U(e)||A(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&A(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:se(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:se(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();C(this)&&t.unshift(this),C(e)&&r.unshift(e);const i=t.length,o=r.length;if(i===0||o===0||t[i-1]!==r[o-1])return null;const s=new Set(r);for(let l=0;l<i;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,i=0,o=this;for(;;){const s=o.getParentOrThrow();if(s===t){r=o.getIndexWithinParent();break}o=s}for(o=e;;){const s=o.getParentOrThrow();if(s===t){i=o.getIndexWithinParent();break}o=s}return r<i}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=C(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,f=c;do{if(f===null&&A(68),u=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||i.has(f.__key)||r.push(f)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=G()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&A(113),e}getWritable(){he();const e=Ie(),t=G(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=M();if(l!==null&&l.setCachedNodes(null),s.has(i))return Tn(o),o;const a=$r(o);return s.add(i),Tn(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){A(70)}updateDOM(e,t,r){A(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){A(72)}static importJSON(e){A(18,this.name)}static transform(){return null}remove(e){Xr(this,!0,e)}replace(e,t){he();let r=M();r!==null&&(r=r.clone()),Ar(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Qe(l);const u=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,h=i.__next,g=i.__parent;if(Xr(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,f===null?a.__last=s:f.getWritable().__prev=s,l.__next=h,l.__parent=g,a.__size=c,t&&(C(this)&&C(l)||A(139),this.getChildren().forEach(m=>{l.append(m)})),O(r)){Se(r);const m=r.anchor,_=r.focus;m.key===o&&Ro(m,l),_.key===o&&Ro(_,l)}return ze()===o&&re(s),l}insertAfter(e,t=!0){he(),Ar(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=M();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(Qe(i),O(s)){const g=o.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===g&&m.offset===h+1,a=_.type==="element"&&_.key===g&&_.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=i.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&O(s)){const h=this.getIndexWithinParent();zn(s,u,h+1);const g=u.__key;l&&s.anchor.set(g,h+2,"element"),a&&s.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){he(),Ar(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;Qe(i);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=o:s.getWritable().__next=o,l.__size++,r.__prev=o,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=M();return t&&O(u)&&zn(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Ne()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){he();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(C(r))return r.select();if(!j(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){he();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(C(r))return r.select(0,0);if(!j(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Ht extends $n{static getType(){return"linebreak"}static clone(e){return new Ht(e.__key)}constructor(e){super(e)}getTextContent(){return`
34
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&Dn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Rn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&Rn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Dn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Rn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&Rn(o))return!0}return!1}(e)?null:{conversion:Xl,priority:0}}}static importJSON(e){return nt()}exportJSON(){return{type:"linebreak",version:1}}}function Xl(n){return{node:nt()}}function nt(){return Wt(new Ht)}function qt(n){return n instanceof Ht}function Rn(n){return n.nodeType===Be&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Qr(n,e){return 16&e?"code":e&pr?"mark":32&e?"sub":64&e?"sup":null}function Zr(n,e){return 1&e?"strong":2&e?"em":"span"}function Lo(n,e,t,r,i){const o=r.classList;let s=$t(i,"base");s!==void 0&&o.add(...s),s=$t(i,"underlineStrikethrough");let l=!1;const a=e&vn&&e&xn;s!==void 0&&(t&vn&&t&xn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in je){const u=je[c];if(s=$t(i,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&o.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||o.add(...s)}else e&u&&o.remove(...s)}}function Io(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?bn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||We){const[l,a,c]=function(u,f){const d=u.length,h=f.length;let g=0,m=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;m+g<d&&m+g<h&&u[d-m-1]===f[h-m-1];)m++;return[g,d-g-m,f.slice(g,h-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function Fo(n,e,t,r,i,o){Io(i,n,e);const s=o.theme.text;s!==void 0&&Lo(0,0,r,n,s)}function Wn(n,e){const t=document.createElement(e);return t.appendChild(n),t}class yt extends $n{static getType(){return"text"}static clone(e){return new yt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Pl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===ze()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=je[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Er(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=Qr(0,r),o=Zr(0,r),s=i===null?o:i,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(o),l.appendChild(a)),Fo(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,l=Qr(0,o),a=Qr(0,s),c=Zr(0,o),u=Zr(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&A(48);const _=document.createElement(u);return Fo(_,this,0,s,i,r),t.replaceChild(_,m),!1}let f=t;a!==null&&l!==null&&(f=t.firstChild,f==null&&A(49)),Io(i,f,this);const d=r.theme.text;d!==void 0&&o!==s&&Lo(0,o,s,f,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:ta,priority:0}),b:()=>({conversion:Zl,priority:0}),code:()=>({conversion:Ue,priority:0}),em:()=>({conversion:Ue,priority:0}),i:()=>({conversion:Ue,priority:0}),s:()=>({conversion:Ue,priority:0}),span:()=>({conversion:Ql,priority:0}),strong:()=>({conversion:Ue,priority:0}),sub:()=>({conversion:Ue,priority:0}),sup:()=>({conversion:Ue,priority:0}),u:()=>({conversion:Ue,priority:0})}}static importJSON(e){const t=ie(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&On(t)||A(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Wn(t,"b")),this.hasFormat("italic")&&(t=Wn(t,"i")),this.hasFormat("strikethrough")&&(t=Wn(t,"s")),this.hasFormat("underline")&&(t=Wn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?je[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?kl[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Er(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Nl[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){he();let r=e,i=t;const o=M(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!O(o))return Jo(l,r,l,i,"text","text");{const a=ze();a!==o.anchor.key&&a!==o.focus.key||re(l),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=M();if(i&&O(c)){const f=e+l;c.setTextNodeRange(o,f,o,f)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){he();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=ze(),s=new Set(e),l=[],a=r.length;let c="";for(let S=0;S<a;S++)c!==""&&s.has(S)&&(l.push(c),c=""),c+=r[S];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const f=l[0],d=t.getParent();let h;const g=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(h=ie(f),h.__format=g,h.__style=m,h.__detail=_,v=!0):(h=t.getWritable(),h.__text=f);const y=M(),x=[h];let k=f.length;for(let S=1;S<u;S++){const w=l[S],P=w.length,T=ie(w).getWritable();T.__format=g,T.__style=m,T.__detail=_;const N=T.__key,F=k+P;if(O(y)){const R=y.anchor,H=y.focus;R.key===i&&R.type==="text"&&R.offset>k&&R.offset<=F&&(R.key=N,R.offset-=k,y.dirty=!0),H.key===i&&H.type==="text"&&H.offset>k&&H.offset<=F&&(H.key=N,H.offset-=k,y.dirty=!0)}o===i&&re(N),k=F,x.push(T)}if(d!==null){(function(P){const T=P.getPreviousSibling(),N=P.getNextSibling();T!==null&&Tn(T),N!==null&&Tn(N)})(this);const S=d.getWritable(),w=this.getIndexWithinParent();v?(S.splice(w,0,x),this.remove()):S.splice(w,1,x),O(y)&&zn(y,d,w,u-1)}return x}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||A(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;ze()===i&&re(r);const l=M();if(O(l)){const f=l.anchor,d=l.focus;f!==null&&f.key===i&&(qo(f,t,r,e,s),l.dirty=!0),d!==null&&d.key===i&&(qo(d,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Ql(n){return{forChild:ei(n.style),node:null}}function Zl(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:ei(e.style,t?void 0:"bold"),node:null}}const Mo=new WeakMap;function ea(n){return n.nodeName==="PRE"||n.nodeType===At&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function ta(n){const e=n;n.parentElement===null&&A(129);let t=e.textContent||"";if(function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=Mo.get(o))===void 0&&!ea(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)Mo.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const l=r[s];l===`
31
+ `,ll=ze?" ":gn,Li="֑-߿יִ-﷽ﹰ-ﻼ",ji="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",al=new RegExp("^[^"+ji+"]*["+Li+"]"),cl=new RegExp("^[^"+Li+"]*["+ji+"]"),ke={bold:1,code:16,highlight:rr,italic:2,strikethrough:dn,subscript:32,superscript:64,underline:fn},ul={directionless:1,unmergeable:2},Ii={center:or,end:cr,justify:lr,left:ir,right:sr,start:ar},dl={[or]:"center",[cr]:"end",[lr]:"justify",[ir]:"left",[sr]:"right",[ar]:"start"},fl={normal:0,segmented:2,token:1},gl={[rl]:"normal",[ol]:"segmented",[il]:"token"};function hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var L=hl(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function hn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const pl=100;let ur=!1,dr=0;function _l(n){dr=n.timeStamp}function fr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function ml(n,e,t){const r=Te(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&yr(e,s,i,o,!1)}function yl(n,e,t){if(k(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Re&&t.isAttached()}function Di(n,e,t){ur=!0;const r=performance.now()-dr>pl;try{he(n,()=>{const i=O()||function(d){return d.getEditorState().read(()=>{const g=O();return g!==null?g.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const g=e[d],h=g.type,m=g.target;let _=qe(m,l);if(!(_===null&&m!==s||Y(_))){if(h==="characterData")r&&j(_)&&yl(i,m,_)&&ml(m,_,n);else if(h==="childList"){c=!0;const v=g.addedNodes;for(let b=0;b<v.length;b++){const T=v[b],S=Ui(T),E=T.parentNode;if(E!=null&&T!==a&&S===null&&(T.nodeName!=="BR"||!fr(T,E,n))){if(ze){const N=T.innerText||T.nodeValue;N&&(u+=N)}E.removeChild(T)}}const x=g.removedNodes,y=x.length;if(y>0){let b=0;for(let T=0;T<y;T++){const S=x[T];(S.nodeName==="BR"&&fr(S,m,n)||a===S)&&(m.appendChild(S),b++)}y!==b&&(m===s&&(_=Ki(l)),o.set(m,_))}}}}if(o.size>0)for(const[d,g]of o)if(C(g)){const h=g.getChildrenKeys();let m=d.firstChild;for(let _=0;_<h.length;_++){const v=h[_],x=n.getElementByKey(v);x!==null&&(m==null?(d.appendChild(x),m=x):m!==x&&d.replaceChild(x,m),m=m.nextSibling)}}else j(g)&&g.markDirty();const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const g=f[d],h=g.addedNodes,m=g.target;for(let _=0;_<h.length;_++){const v=h[_],x=v.parentNode;x==null||v.nodeName!=="BR"||fr(v,m,n)||x.removeChild(v)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,Se(i)),ze&&to(n)&&i.insertRawText(u))})}finally{ur=!1}}function Oi(n){const e=n._observer;e!==null&&Di(n,e.takeRecords(),e)}function Ai(n){(function(e){dr===0&&Cn(e).addEventListener("textInput",_l,!0)})(n),n._observer=new MutationObserver((e,t)=>{Di(n,e,t)})}function Pi(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==o||r!==null&&r!==s||i!==null&&i!==l)}function zi(n,e){const t=n.mergeWithSibling(e),r=Z()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Ri(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&j(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Pi(e,r)){r=zi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&j(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Pi(r,t)){r=zi(r,t);break}break}t.remove()}}else r.remove()}function Fi(n){return Wi(n.anchor),Wi(n.focus),n}function Wi(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),j(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!C(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let xl=1;const vl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function gr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return Y(qe(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&pn(e)==null)}function jt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!gr(e)&&Bi(e)===n}catch{return!1}}function hr(n){return n instanceof Fn}function Bi(n){let e=n;for(;e!=null;){const t=pn(e);if(hr(t))return t;e=vn(e)}return null}function pn(n){return n?n.__lexicalEditor:null}function at(n){return n.isToken()||n.isSegmented()}function Cl(n){return n.nodeType===Re}function _n(n){let e=n;for(;e!=null;){if(Cl(e))return e;e=e.firstChild}return null}function pr(n,e,t){const r=ke[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~ke.superscript:e==="superscript"&&(i&=~ke.subscript),i}function Sl(n,e){if(e!=null)return void(n.__key=e);ge(),Wo();const t=Z(),r=Ie(),i=""+xl++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=ki,n.__key=i}function Ze(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling();if(i===null)if(o!==null){const s=o.getWritable();r.__first=o.__key,s.__prev=null}else r.__first=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(o===null)if(i!==null){const s=i.getWritable();r.__last=i.__key,s.__next=null}else r.__last=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function mn(n){Wo();const e=n.getLatest(),t=e.__parent,r=Ie(),i=Z(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let f=a;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}}(t,o,s);const l=e.__key;i._dirtyType=ki,C(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){ge();const e=Z(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=se(t);r!==null&&r.getWritable()}if(n!==null){const r=se(n);r!==null&&r.getWritable()}}}function Fe(){return Zt()?null:Z()._compositionKey}function se(n,e){const t=(e||Ie())._nodeMap.get(n);return t===void 0?null:t}function Ui(n,e){const t=n[`__lexicalKey_${Z()._key}`];return t!==void 0?se(t,e):null}function qe(n,e){let t=n;for(;t!=null;){const r=Ui(t,e);if(r!==null)return r;t=vn(t)}return null}function $i(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Yi(n){return n.read(()=>G().getTextContent())}function G(){return Ki(Ie())}function Ki(n){return n._nodeMap.get("root")}function Se(n){ge();const e=Ie();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ct(n){const e=Z(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=vn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Qi(n,e){return e?n.getTextContentSize():0}function Vi(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function _r(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ji(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Zi(n){return n.nodeType===Re?n.nodeValue:null}function mr(n,e,t){const r=Te(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=Zi(i);const a=qe(i);if(l!==null&&j(a)){if(l===gn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&yr(a,l,o,s,n)}}}function yr(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===gn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),tr||un||nr)o.remove();else{const m=Z();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=Jt(),f=o.getTextContentSize(),d=Fe(),g=o.getKey();if(o.isToken()||d!==null&&g===d&&!s||k(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!o.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===f&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const h=O();if(!k(h)||t===null||r===null)return void o.setTextContent(l);if(h.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=ie(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function Tl(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(o){const s=o.getPreviousSibling();return(j(s)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function qi(n){return n==="ArrowLeft"}function Gi(n){return n==="ArrowRight"}function It(n,e){return me?n:e}function Hi(n){return n==="Enter"}function Dt(n){return n==="Backspace"}function Ot(n){return n==="Delete"}function Xi(n,e,t){return n.toLowerCase()==="a"&&It(e,t)}function Nl(){const n=G();Se(Fi(n.select(0,n.getChildrenSize())))}function At(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=hn(i);return t[e]=o,o}return i}function xr(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&L(33,o);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),f=u==="destroyed"&&i==="created";(u===void 0||f)&&c.set(s,f?"updated":i)}function eo(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function Pt(n,e){const t=n.offset;if(n.type==="element")return eo(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?eo(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function to(n){const e=Cn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function D(n,e,t){return Ko(n,e,t)}function yn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function xn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&L(75,e),t}function vn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function vr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Cn(n){const e=n._window;return e===null&&L(78),e}function bl(n){let e=n.getParentOrThrow();for(;e!==null;){if(ut(e))return e;e=e.getParentOrThrow()}return e}function ut(n){return oe(n)||C(n)&&n.isShadowRoot()}function Sn(n){const e=Z(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&L(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||L(98),o}return n}function Cr(n,e){!oe(n.getParent())||C(e)||Y(e)||L(99)}function Sr(n){return(Y(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function Tr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function wl(n,e,t){let r=n._blockCursorElement;if(k(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,o=i.getNode(),s=i.offset;let l=!1,a=null;if(s===o.getChildrenSize())Sr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Sr(c)){const u=c.getPreviousSibling();(u===null||Sr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(o.__key);return r===null&&(n._blockCursorElement=r=function(u){const f=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let g=f.blockCursor;if(g!==void 0){if(typeof g=="string"){const h=hn(g);g=f.blockCursor=h}g!==void 0&&d.classList.add(...g)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Tr(r,n,e)}function Te(n){return _e?(n||window).getSelection():null}function Nr(n){return n.nodeType===1}function br(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Tn(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function dt(n){if(oe(n)||Y(n)&&!n.isInline())return!0;if(!C(n)||ut(n))return!1;const e=n.getFirstChild(),t=e===null||Kt(e)||j(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function wr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ml(){return Z()}const no=new WeakMap,El=new Map;function kl(n){if(!n._readOnly&&n.isEmpty())return El;n._readOnly||L(192);let e=no.get(n);if(!e){e=new Map,no.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let o=e.get(i);o||(o=new Map,e.set(i,o)),o.set(t,r)}}return e}function Mr(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ro(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(C(s)&&ro(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let We,le,zt,Nn,Er,kr,Ge,ye,Lr,Rt,X="",ae="",Ne=null,xe="",Le="",io=!1,Ft=!1,bn=null;function wn(n,e){const t=Ge.get(n);if(e!==null){const r=Or(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=En(t,Ge);jr(r,0,r.length-1,null)}t!==void 0&&xr(Rt,zt,Nn,t,"destroyed")}function jr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&wn(o,r)}}function He(n,e){n.setProperty("text-align",e)}const Ll="40px";function oo(n,e){const t=We.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Ll;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function so(n,e){const t=n.style;e===0?He(t,""):e===ir?He(t,"left"):e===or?He(t,"center"):e===sr?He(t,"right"):e===lr?He(t,"justify"):e===ar?He(t,"start"):e===cr&&He(t,"end")}function Mn(n,e,t){const r=ye.get(n);r===void 0&&L(60);const i=r.createDOM(We,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),j(r)?i.setAttribute("data-lexical-text","true"):Y(r)&&i.setAttribute("data-lexical-decorator","true"),C(r)){const o=r.__indent,s=r.__size;if(o!==0&&oo(i,o),s!==0){const a=s-1;(function(c,u,f,d){const g=ae;ae="",Ir(c,f,0,u,d,null),co(f,d),ae=g})(En(r,ye),a,r,i)}const l=r.__format;l!==0&&so(i,l),r.isInline()||ao(null,r,i),yn(r)&&(X+=Ee,Le+=Ee)}else{const o=r.getTextContent();if(Y(r)){const s=r.decorate(le,We);s!==null&&uo(n,s),i.contentEditable="false"}else j(r)&&(r.isDirectionless()||(ae+=o));X+=o,Le+=o}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const o=e.__lexicalLineBreak;o!=null?e.insertBefore(i,o):e.appendChild(i)}return xr(Rt,zt,Nn,r,"created"),i}function Ir(n,e,t,r,i,o){const s=X;X="";let l=t;for(;l<=r;++l){Mn(n[l],i,o);const a=ye.get(n[l]);a!==null&&j(a)&&(Ne===null&&(Ne=a.getFormat()),xe===""&&(xe=a.getStyle()))}yn(e)&&(X+=Ee),i.__lexicalTextContent=X,X=s+X}function lo(n,e){const t=e.get(n);return Kt(t)||Y(t)&&t.isInline()}function ao(n,e,t){const r=n!==null&&(n.__size===0||lo(n.__last,Ge)),i=e.__size===0||lo(e.__last,ye);if(r){if(!i){const o=t.__lexicalLineBreak;if(o!=null)try{t.removeChild(o)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${o.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(i){const o=document.createElement("br");t.__lexicalLineBreak=o,t.appendChild(o)}}function co(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==bn){const o=ae==="",s=o?bn:(i=ae,al.test(i)?"rtl":cl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=We.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const f=hn(c);c=a[r]=f}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const f=hn(u);u=a[s]=f}u!==void 0&&l.add(...u)}e.dir=s}Ft||(n.getWritable().__dir=s)}bn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function jl(n,e,t){const r=ae;var i;ae="",Ne=null,xe="",function(o,s,l){const a=X,c=o.__size,u=s.__size;if(X="",c===1&&u===1){const f=o.__first,d=s.__first;if(f===d)Wt(f,l);else{const h=Or(f),m=Mn(d,null,null);try{l.replaceChild(m,h)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${h.tagName}, key: ${f}}.`;throw new Error(v)}throw _}wn(f,null)}const g=ye.get(d);j(g)&&(Ne===null&&(Ne=g.getFormat()),xe===""&&(xe=g.getStyle()))}else{const f=En(o,Ge),d=En(s,ye);if(c===0)u!==0&&Ir(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const g=l.__lexicalLineBreak==null;jr(f,0,c-1,g?null:l),g&&(l.textContent="")}}else(function(g,h,m,_,v,x){const y=_-1,b=v-1;let T,S,E=(R=x,R.firstChild),N=0,M=0;for(var R;N<=y&&M<=b;){const J=h[N],F=m[M];if(J===F)E=Dr(Wt(F,x)),N++,M++;else{T===void 0&&(T=new Set(h)),S===void 0&&(S=new Set(m));const ce=S.has(J),De=T.has(F);if(ce)if(De){const Ke=xn(le,F);Ke===E?E=Dr(Wt(F,x)):(E!=null?x.insertBefore(Ke,E):x.appendChild(Ke),Wt(F,x)),N++,M++}else Mn(F,x,E),M++;else E=Dr(Or(J)),wn(J,x),N++}const V=ye.get(F);V!==null&&j(V)&&(Ne===null&&(Ne=V.getFormat()),xe===""&&(xe=V.getStyle()))}const B=N>y,ee=M>b;if(B&&!ee){const J=m[b+1];Ir(m,g,M,b,x,J===void 0?null:le.getElementByKey(J))}else ee&&!B&&jr(h,N,y,x)})(s,f,d,c,u,l)}yn(s)&&(X+=Ee),l.__lexicalTextContent=X,X=a+X}(n,e,t),co(e,t),Xr(i=e)&&Ne!=null&&Ne!==i.__textFormat&&!Ft&&(i.setTextFormat(Ne),i.setTextStyle(xe)),function(o){Xr(o)&&xe!==""&&xe!==o.__textStyle&&!Ft&&o.setTextStyle(xe)}(e),ae=r}function En(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&L(101),t.push(r),r=i.__next}return t}function Wt(n,e){const t=Ge.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||L(61);const i=io||kr.has(n)||Er.has(n),o=xn(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(X+=s,Le+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();j(t)&&!t.isDirectionless()&&(ae+=s),Le+=s,X+=s}return o}if(t!==r&&i&&xr(Rt,zt,Nn,r,"updated"),r.updateDOM(t,o,We)){const s=Mn(n,null,null);return e===null&&L(62),e.replaceChild(s,o),wn(n,null),s}if(C(t)&&C(r)){const s=r.__indent;s!==t.__indent&&oo(o,s);const l=r.__format;l!==t.__format&&so(o,l),i&&(jl(t,r,o),oe(r)||r.isInline()||ao(t,r,o)),yn(r)&&(X+=Ee,Le+=Ee)}else{const s=r.getTextContent();if(Y(r)){const l=r.decorate(le,We);l!==null&&uo(n,l)}else j(r)&&!r.isDirectionless()&&(ae+=s);X+=s,Le+=s}if(!Ft&&oe(r)&&r.__cachedText!==Le){const s=r.getWritable();s.__cachedText=Le,r=s}return o}function uo(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=$i(le)}t[n]=e}function Dr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Il(n,e,t,r,i,o){X="",Le="",ae="",io=r===lt,bn=null,le=t,We=t._config,zt=t._nodes,Nn=le._listeners.mutation,Er=i,kr=o,Ge=n._nodeMap,ye=e._nodeMap,Ft=e._readOnly,Lr=new Map(t._keyToDOMMap);const s=new Map;return Rt=s,Wt("root",null),le=void 0,zt=void 0,Er=void 0,kr=void 0,Ge=void 0,ye=void 0,We=void 0,Lr=void 0,Rt=void 0,s}function Or(n){const e=Lr.get(n);return e===void 0&&L(75,n),e}const je=Object.freeze({}),Ar=30,Pr=[["keydown",function(n,e){if(Bt=n.timeStamp,fo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;D(e,Bs,n)||t!=null&&(function(l,a,c,u){return Gi(l)&&!a&&!u&&!c}(t,i,s,o)?D(e,mi,n):function(l,a,c,u,f){return Gi(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?D(e,Us,n):function(l,a,c,u){return qi(l)&&!a&&!u&&!c}(t,i,s,o)?D(e,yi,n):function(l,a,c,u,f){return qi(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?D(e,$s,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?D(e,xi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?D(e,vi,n):function(l,a){return Hi(l)&&a}(t,r)?(Ut=!0,D(e,ln,n)):function(l){return l===" "}(t)?D(e,Ys,n):function(l,a){return me&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),Ut=!0,D(e,ot,!0)):function(l,a){return Hi(l)&&!a}(t,r)?(Ut=!1,D(e,ln,n)):function(l,a,c,u){return me?!a&&!c&&(Dt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Dt(l)}(t,s,o,i)?Dt(t)?D(e,Ci,n):(n.preventDefault(),D(e,Ve,!0)):function(l){return l==="Escape"}(t)?D(e,Si,n):function(l,a,c,u,f){return me?!(c||u||f)&&(Ot(l)||l.toLowerCase()==="d"&&a):!(a||u||f)&&Ot(l)}(t,i,r,s,o)?Ot(t)?D(e,Ti,n):(n.preventDefault(),D(e,Ve,!1)):function(l,a,c){return Dt(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),D(e,bt,!0)):function(l,a,c){return Ot(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),D(e,bt,!1)):function(l,a){return me&&a&&Dt(l)}(t,o)?(n.preventDefault(),D(e,wt,!0)):function(l,a){return me&&a&&Ot(l)}(t,o)?(n.preventDefault(),D(e,wt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?D(e,Ks,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&It(c,u)}(t,r,o,i)?(n.preventDefault(),D(e,on,void 0)):function(l,a,c,u){return me?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),D(e,sn,void 0)):ve(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),D(e,an,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),D(e,Xn,n)):Xi(t,o,i)&&(n.preventDefault(),D(e,er,n)):!ze&&Xi(t,o,i)&&(n.preventDefault(),D(e,er,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&D(e,Xs,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{Y(qe(t))||(Rr=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=O();if(k(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Bt+Ar||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||j(i)&&i.getStyle()!==t.style)&&D(e,st,ll)}})}],["compositionend",function(n,e){ze?$t=!0:he(e,()=>{Fr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=O(),r=n.data,i=yo(n);if(r!=null&&k(t)&&po(t,i,r,n.timeStamp,!1)){$t&&(Fr(e,r),$t=!1);const o=t.anchor.getNode(),s=Te(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;cn&&!t.isCollapsed()&&j(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===Zi(s.anchorNode)||D(e,st,r);const u=r.length;ze&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),tr||un||nr||!e.isComposing()||(Bt=0,re(null))}else mr(!1,e,r!==null?r:void 0),$t&&(Fr(e,r||void 0),$t=!1);ge(),Oi(Z())}),ft=null}],["click",function(n,e){he(e,()=>{const t=O(),r=Te(e._window),i=Jt();if(r){if(k(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&G().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(C(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const o=r.anchorNode;if(o!==null){const s=o.nodeType;(s===Lt||s===Re)&&Se(Vr(i,r,e,n))}}}D(e,_i,n)})}],["cut",je],["copy",je],["dragstart",je],["dragover",je],["dragend",je],["paste",je],["focus",je],["blur",je],["drop",je]];cn&&Pr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=yo(t);i==="deleteCompositionText"||ze&&to(r)||i!=="insertCompositionText"&&he(r,()=>{const s=O();if(i==="deleteContentBackward"){if(s===null){const g=Jt();if(!k(g))return;Se(g.clone())}if(k(s)){const g=s.anchor.key===s.focus.key;if(l=t.timeStamp,fo==="MediaLast"&&l<Bt+Ar&&r.isComposing()&&g){if(re(null),Bt=0,setTimeout(()=>{he(r,()=>{re(null)})},Ar),k(s)){const h=s.anchor.getNode();h.markDirty(),s.format=h.getFormat(),j(h)||L(142),s.style=h.getStyle()}}else{re(null),t.preventDefault();const h=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===h.length;nl&&g&&!m||D(r,Ve,!0)}return}}var l;if(!k(s))return;const a=t.data;ft!==null&&mr(!1,r,ft),s.dirty&&ft===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),ft=null;const c=s.anchor,u=s.focus,f=c.getNode(),d=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":D(r,st,t);break;case"insertFromComposition":re(null),D(r,st,t);break;case"insertLineBreak":re(null),D(r,ot,!1);break;case"insertParagraph":re(null),Ut&&!un?(Ut=!1,D(r,ot,!1)):D(r,rn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":D(r,Gn,t);break;case"deleteByComposition":(function(g,h){return g!==h||C(g)||C(h)||!g.isToken()||!h.isToken()})(f,d)&&D(r,Hn,t);break;case"deleteByDrag":case"deleteByCut":D(r,Hn,t);break;case"deleteContent":D(r,Ve,!1);break;case"deleteWordBackward":D(r,bt,!0);break;case"deleteWordForward":D(r,bt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":D(r,wt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":D(r,wt,!1);break;case"formatStrikeThrough":D(r,de,"strikethrough");break;case"formatBold":D(r,de,"bold");break;case"formatItalic":D(r,de,"italic");break;case"formatUnderline":D(r,de,"underline");break;case"historyUndo":D(r,on,void 0);break;case"historyRedo":D(r,sn,void 0)}else{if(a===`
32
+ `)t.preventDefault(),D(r,ot,!1);else if(a===Ee)t.preventDefault(),D(r,rn,void 0);else if(a==null&&t.dataTransfer){const g=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(g)}else a!=null&&po(s,o,a,t.timeStamp,!0)?(t.preventDefault(),D(r,st,a)):ft=a;go=t.timeStamp}})}(n,e)]);let Bt=0,fo=null,go=0,ft=null;const kn=new WeakMap;let zr=!1,Rr=!1,Ut=!1,$t=!1,ho=[0,"",0,"root",0];function po(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=Z(),c=Te(a._window),u=c!==null?c.anchorNode:null,f=o.key,d=a.getElementByKey(f),g=t.length;return f!==s.key||!j(l)||(!i&&(!cn||go<r+50)||l.isDirty()&&g<2||Vi(t))&&o.offset!==s.offset&&!l.isComposing()||at(l)||l.isDirty()&&g>1||(i||!cn)&&d!==null&&!l.isComposing()&&u!==_n(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Tl(n,l)}function _o(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Re&&e!==0&&e!==n.nodeValue.length}function mo(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;zr&&(zr=!1,_o(r,i)&&_o(o,s))||he(e,()=>{if(!t)return void Se(null);if(!jt(e,r,o))return;const l=O();if(k(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Cn(e).event,f=u?u.timeStamp:performance.now(),[d,g,h,m,_]=ho,v=G(),x=e.isComposing()===!1&&v.getTextContent()==="";if(f<_+200&&a.offset===h&&a.key===m)l.format=d,l.style=g;else if(a.type==="text")j(c)||L(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!x){const y=a.getNode();l.style="",y instanceof pt&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,f=l.focus.key,d=l.getNodes(),g=d.length,h=l.isBackward(),m=h?s:i,_=h?i:s,v=h?f:u,x=h?u:f;let y=sl,b=!1;for(let T=0;T<g;T++){const S=d[T],E=S.getTextContentSize();if(j(S)&&E!==0&&!(T===0&&S.__key===v&&m===E||T===g-1&&S.__key===x&&_===0)&&(b=!0,y&=S.getFormat(),y===0))break}l.format=b?y:0}}D(e,nn,void 0)})}function yo(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Fr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=_n(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&j(r)&&yr(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
+ `){const r=O();if(k(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void D(n,ln,null)}}}mr(!0,n,e)}function xo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const gt=new Map;function vo(n){const e=n.target,t=Te(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=Bi(t.anchorNode);if(r===null)return;Rr&&(Rr=!1,he(r,()=>{const c=Jt(),u=t.anchorNode;if(u===null)return;const f=u.nodeType;f!==Lt&&f!==Re||Se(Vr(c,t,r,n))}));const i=_r(r),o=i[i.length-1],s=o._key,l=gt.get(s),a=l||o;a!==r&&mo(t,a,!1),mo(t,r,!0),r!==o?gt.set(s,r):l&&gt.delete(s)}function Co(n){n._lexicalHandled=!0}function So(n){return n._lexicalHandled===!0}function Dl(n){const e=n.ownerDocument,t=kn.get(e);t===void 0&&L(162);const r=t-1;r>=0||L(164),kn.set(e,r),r===0&&e.removeEventListener("selectionchange",vo);const i=pn(n);hr(i)?(function(s){if(s._parentEditor!==null){const l=_r(s),a=l[l.length-1]._key;gt.get(a)===s&&gt.delete(a)}else gt.delete(s._key)}(i),n.__lexicalEditor=null):i&&L(198);const o=xo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function Wr(n,e,t){ge();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=O();if(!k(a)||!C(l))return a;const{anchor:c,focus:u}=a,f=c.getNode(),d=u.getNode();return vr(f,l)&&c.set(l.__key,0,"element"),vr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(k(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(An(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(An(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else ve(o)&&e&&n.isSelected()&&n.selectPrevious();if(k(o)&&e&&!s){const l=n.getIndexWithinParent();Ze(n),On(o,i,l,-1)}else Ze(n);t||ut(i)||i.canBeEmpty()||!i.isEmpty()||Wr(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class Ln{static getType(){L(64,this.name)}static clone(e){L(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Sl(this,e)}getType(){return this.__type}isInline(){L(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=se(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||O();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(j(this))return r;if(k(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(Y(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor,s=o.getNode();if(o.offset===s.getChildrenSize()&&s.is(i)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:se(e)}getParentOrThrow(){const e=this.getParent();return e===null&&L(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(ut(t))return C(e)||e===this&&Y(e)||L(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&L(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:se(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:se(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();C(this)&&t.unshift(this),C(e)&&r.unshift(e);const i=t.length,o=r.length;if(i===0||o===0||t[i-1]!==r[o-1])return null;const s=new Set(r);for(let l=0;l<i;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,i=0,o=this;for(;;){const s=o.getParentOrThrow();if(s===t){r=o.getIndexWithinParent();break}o=s}for(o=e;;){const s=o.getParentOrThrow();if(s===t){i=o.getIndexWithinParent();break}o=s}return r<i}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=C(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,f=c;do{if(f===null&&L(68),u=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||i.has(f.__key)||r.push(f)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=Z()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&L(113),e}getWritable(){ge();const e=Ie(),t=Z(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=O();if(l!==null&&l.setCachedNodes(null),s.has(i))return mn(o),o;const a=Mr(o);return s.add(i),mn(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){L(70)}updateDOM(e,t,r){L(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){L(72)}static importJSON(e){L(18,this.name)}static transform(){return null}remove(e){Wr(this,!0,e)}replace(e,t){ge();let r=O();r!==null&&(r=r.clone()),Cr(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Ze(l);const u=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,g=i.__next,h=i.__parent;if(Wr(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,f===null?a.__last=s:f.getWritable().__prev=s,l.__next=g,l.__parent=h,a.__size=c,t&&(C(this)&&C(l)||L(139),this.getChildren().forEach(m=>{l.append(m)})),k(r)){Se(r);const m=r.anchor,_=r.focus;m.key===o&&Eo(m,l),_.key===o&&Eo(_,l)}return Fe()===o&&re(s),l}insertAfter(e,t=!0){ge(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=O();let l=!1,a=!1;if(o!==null){const g=e.getIndexWithinParent();if(Ze(i),k(s)){const h=o.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===h&&m.offset===g+1,a=_.type==="element"&&_.key===h&&_.offset===g+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=i.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&k(s)){const g=this.getIndexWithinParent();On(s,u,g+1);const h=u.__key;l&&s.anchor.set(h,g+2,"element"),a&&s.focus.set(h,g+2,"element")}return e}insertBefore(e,t=!0){ge(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;Ze(i);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=o:s.getWritable().__next=o,l.__size++,r.__prev=o,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=O();return t&&k(u)&&On(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return we()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ge();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(C(r))return r.select();if(!j(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){ge();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(C(r))return r.select(0,0);if(!j(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Yt extends Ln{static getType(){return"linebreak"}static clone(e){return new Yt(e.__key)}constructor(e){super(e)}getTextContent(){return`
34
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&Tn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&jn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&jn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Tn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&jn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&jn(o))return!0}return!1}(e)?null:{conversion:Ol,priority:0}}}static importJSON(e){return Xe()}exportJSON(){return{type:"linebreak",version:1}}}function Ol(n){return{node:Xe()}}function Xe(){return Sn(new Yt)}function Kt(n){return n instanceof Yt}function jn(n){return n.nodeType===Re&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Br(n,e){return 16&e?"code":e&rr?"mark":32&e?"sub":64&e?"sup":null}function Ur(n,e){return 1&e?"strong":2&e?"em":"span"}function To(n,e,t,r,i){const o=r.classList;let s=At(i,"base");s!==void 0&&o.add(...s),s=At(i,"underlineStrikethrough");let l=!1;const a=e&fn&&e&dn;s!==void 0&&(t&fn&&t&dn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in ke){const u=ke[c];if(s=At(i,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&o.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||o.add(...s)}else e&u&&o.remove(...s)}}function No(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?gn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||ze){const[l,a,c]=function(u,f){const d=u.length,g=f.length;let h=0,m=0;for(;h<d&&h<g&&u[h]===f[h];)h++;for(;m+h<d&&m+h<g&&u[d-m-1]===f[g-m-1];)m++;return[h,d-h-m,f.slice(h,g-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function bo(n,e,t,r,i,o){No(i,n,e);const s=o.theme.text;s!==void 0&&To(0,0,r,n,s)}function In(n,e){const t=document.createElement(e);return t.appendChild(n),t}class ht extends Ln{static getType(){return"text"}static clone(e){return new ht(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return gl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Fe()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=ke[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return pr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=Br(0,r),o=Ur(0,r),s=i===null?o:i,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(o),l.appendChild(a)),bo(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,l=Br(0,o),a=Br(0,s),c=Ur(0,o),u=Ur(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&L(48);const _=document.createElement(u);return bo(_,this,0,s,i,r),t.replaceChild(_,m),!1}let f=t;a!==null&&l!==null&&(f=t.firstChild,f==null&&L(49)),No(i,f,this);const d=r.theme.text;d!==void 0&&o!==s&&To(0,o,s,f,d);const g=e.__style,h=this.__style;return g!==h&&(t.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:Rl,priority:0}),b:()=>({conversion:Pl,priority:0}),code:()=>({conversion:Be,priority:0}),em:()=>({conversion:Be,priority:0}),i:()=>({conversion:Be,priority:0}),s:()=>({conversion:Be,priority:0}),span:()=>({conversion:Al,priority:0}),strong:()=>({conversion:Be,priority:0}),sub:()=>({conversion:Be,priority:0}),sup:()=>({conversion:Be,priority:0}),u:()=>({conversion:Be,priority:0})}}static importJSON(e){const t=ie(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&Nr(t)||L(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=In(t,"b")),this.hasFormat("italic")&&(t=In(t,"i")),this.hasFormat("strikethrough")&&(t=In(t,"s")),this.hasFormat("underline")&&(t=In(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?ke[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?ul[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=pr(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=fl[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){ge();let r=e,i=t;const o=O(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!k(o))return Ao(l,r,l,i,"text","text");{const a=Fe();a!==o.anchor.key&&a!==o.focus.key||re(l),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=O();if(i&&k(c)){const f=e+l;c.setTextNodeRange(o,f,o,f)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ge();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=Fe(),s=new Set(e),l=[],a=r.length;let c="";for(let T=0;T<a;T++)c!==""&&s.has(T)&&(l.push(c),c=""),c+=r[T];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const f=l[0],d=t.getParent();let g;const h=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(g=ie(f),g.__format=h,g.__style=m,g.__detail=_,v=!0):(g=t.getWritable(),g.__text=f);const x=O(),y=[g];let b=f.length;for(let T=1;T<u;T++){const S=l[T],E=S.length,N=ie(S).getWritable();N.__format=h,N.__style=m,N.__detail=_;const M=N.__key,R=b+E;if(k(x)){const B=x.anchor,ee=x.focus;B.key===i&&B.type==="text"&&B.offset>b&&B.offset<=R&&(B.key=M,B.offset-=b,x.dirty=!0),ee.key===i&&ee.type==="text"&&ee.offset>b&&ee.offset<=R&&(ee.key=M,ee.offset-=b,x.dirty=!0)}o===i&&re(M),b=R,y.push(N)}if(d!==null){(function(E){const N=E.getPreviousSibling(),M=E.getNextSibling();N!==null&&mn(N),M!==null&&mn(M)})(this);const T=d.getWritable(),S=this.getIndexWithinParent();v?(T.splice(S,0,y),this.remove()):T.splice(S,1,y),k(x)&&On(x,d,S,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||L(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;Fe()===i&&re(r);const l=O();if(k(l)){const f=l.anchor,d=l.focus;f!==null&&f.key===i&&(Ro(f,t,r,e,s),l.dirty=!0),d!==null&&d.key===i&&(Ro(d,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Al(n){return{forChild:$r(n.style),node:null}}function Pl(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:$r(e.style,t?void 0:"bold"),node:null}}const wo=new WeakMap;function zl(n){return n.nodeName==="PRE"||n.nodeType===Lt&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function Rl(n){const e=n;n.parentElement===null&&L(129);let t=e.textContent||"";if(function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=wo.get(o))===void 0&&!zl(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)wo.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const l=r[s];l===`
35
35
  `||l===`\r
36
- `?i.push(nt()):l===" "?i.push(Xt()):l!==""&&i.push(ie(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=$o(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=$o(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ie(t)}}function $o(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,t.nodeType===At){const o=t.style.display;if(o===""&&!Fr(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===Be)return t;if(t.nodeName==="BR")return null}}const na={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ue(n){const e=na[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:ei(n.style,e),node:null}}function ie(n=""){return Wt(new yt(n))}function j(n){return n instanceof yt}function ei(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(j(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class Gt extends yt{static getType(){return"tab"}static clone(e){return new Gt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Xt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){A(126)}setDetail(e){A(127)}setMode(e){A(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Xt(){return Wt(new Gt)}function ra(n){return n instanceof Gt}class ia{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const i=this.offset,o=e.offset;if(C(t)){const s=t.getDescendantByIndex(i);t=s??t}if(C(r)){const s=r.getDescendantByIndex(o);r=s??r}return t===r?i<o:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&A(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,Zt()||(ze()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function Ee(n,e,t){return new ia(n,e,t)}function ti(n,e){let t=e.__key,r=n.offset,i="element";if(j(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!C(e)){const o=e.getNextSibling();if(j(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Ro(n,e){if(C(e)){const t=e.getLastDescendant();C(t)||j(t)?ti(n,t):ti(n,e)}else ti(n,e)}function Ve(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Bn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Ce(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Bn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(j(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=se(i);o!==null&&r.push(o)}return Zt()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function O(n){return n instanceof Je}class Je{constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!O(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,i=t.isBefore(r),o=i?t:r,s=i?r:t;let l=o.getNode(),a=s.getNode();const c=o.offset,u=s.offset;if(C(l)){const d=l.getDescendantByIndex(c);l=d??l}if(C(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let f;return f=l.is(a)?C(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Zt()||(this._cachedNodes=f),f}setTextNodeRange(e,t,r,i){Ve(this.anchor,e.__key,t,"text"),Ve(this.focus,r.__key,i,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[l,a]=ni(this);let c="",u=!0;for(let f=0;f<e.length;f++){const d=e[f];if(C(d)&&!d.isInline())u||(c+=`
37
- `),u=!d.isEmpty();else if(u=!1,j(d)){let h=d.getTextContent();d===t?d===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=s?h.slice(l):h.slice(a):d===r&&(h=s?h.slice(0,a):h.slice(0,l)),c+=h}else!U(d)&&!qt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=G(),r=t.getEditorState()._selection,i=Vo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;Ve(this.anchor,o.key,o.offset,o.type),Ve(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Je(Ee(e.key,e.offset,e.type),Ee(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Er(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=je[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];s===`
36
+ `?i.push(Xe()):l===" "?i.push(Vt()):l!==""&&i.push(ie(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Mo(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Mo(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ie(t)}}function Mo(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,t.nodeType===Lt){const o=t.style.display;if(o===""&&!br(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===Re)return t;if(t.nodeName==="BR")return null}}const Fl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Be(n){const e=Fl[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:$r(n.style,e),node:null}}function ie(n=""){return Sn(new ht(n))}function j(n){return n instanceof ht}function $r(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(j(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class Qt extends ht{static getType(){return"tab"}static clone(e){return new Qt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Vt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){L(126)}setDetail(e){L(127)}setMode(e){L(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Vt(){return Sn(new Qt)}function Wl(n){return n instanceof Qt}class Bl{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const i=this.offset,o=e.offset;if(C(t)){const s=t.getDescendantByIndex(i);t=s??t}if(C(r)){const s=r.getDescendantByIndex(o);r=s??r}return t===r?i<o:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&L(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,Zt()||(Fe()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function be(n,e,t){return new Bl(n,e,t)}function Yr(n,e){let t=e.__key,r=n.offset,i="element";if(j(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!C(e)){const o=e.getNextSibling();if(j(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Eo(n,e){if(C(e)){const t=e.getLastDescendant();C(t)||j(t)?Yr(n,t):Yr(n,e)}else Yr(n,e)}function Ue(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Dn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ve(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Dn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(j(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=se(i);o!==null&&r.push(o)}return Zt()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function k(n){return n instanceof $e}class $e{constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!k(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,i=t.isBefore(r),o=i?t:r,s=i?r:t;let l=o.getNode(),a=s.getNode();const c=o.offset,u=s.offset;if(C(l)){const d=l.getDescendantByIndex(c);l=d??l}if(C(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let f;return f=l.is(a)?C(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Zt()||(this._cachedNodes=f),f}setTextNodeRange(e,t,r,i){Ue(this.anchor,e.__key,t,"text"),Ue(this.focus,r.__key,i,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[l,a]=Kr(this);let c="",u=!0;for(let f=0;f<e.length;f++){const d=e[f];if(C(d)&&!d.isInline())u||(c+=`
37
+ `),u=!d.isEmpty();else if(u=!1,j(d)){let g=d.getTextContent();d===t?d===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(g=l<a?g.slice(l,a):g.slice(a,l)):g=s?g.slice(l):g.slice(a):d===r&&(g=s?g.slice(0,a):g.slice(0,l)),c+=g}else!Y(d)&&!Kt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=Z(),r=t.getEditorState()._selection,i=Oo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;Ue(this.anchor,o.key,o.offset,o.type),Ue(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new $e(be(e.key,e.offset,e.type),be(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=pr(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=ke[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];s===`
38
38
  `||s===`\r
39
- `?r.push(nt()):s===" "?r.push(Xt()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,v,y,x){const k=_.getNode(),S=k.getChildAtIndex(_.offset),w=ie(),P=oe(k)?Ne().append(w):w;w.setFormat(y),w.setStyle(x),S===null?k.append(P):S.insertBefore(P),_.is(v)&&v.set(w.__key,0,"text"),_.set(w.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),f=u.length;let d=u[0];j(d)||A(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let m=u[f-1];if(f===1&&l.type==="element"&&(c=h,l.set(s.key,c,"text")),this.isCollapsed()&&a===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(j(_)&&_.canInsertTextBefore()&&!ft(_)||(_=ie(),_.setFormat(i),_.setStyle(o),g.canInsertTextAfter()?d.insertAfter(_):g.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(j(_)&&!ft(_)||(_=ie(),_.setFormat(i),g.canInsertTextBefore()?d.insertBefore(_):g.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==h){const _=ie(d.getTextContent());_.setFormat(i),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||C(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Uo(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const x=ie(e);return x.select(),void d.replace(x)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===i&&v===o){if(ra(d)){const x=ie(e);return x.setFormat(i),x.setStyle(o),x.select(),void d.replace(x)}}else{if(d.getTextContent()!==""){const x=ie(e);if(x.setFormat(i),x.setStyle(o),x.select(),a===0)d.insertBefore(x,!1);else{const[k]=d.splitText(a);k.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(o)}const y=c-a;d=d.spliceText(a,y,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=C(d)?d:d.getParentOrThrow();let y=C(m)?m:m.getParentOrThrow(),x=m;if(!v.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(j(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const T=ie(m.getTextContent());m.replace(T),m=T}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const T=m.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?m.remove():T.remove()}else _.add(m.__key);const k=y.getChildren(),S=new Set(u),w=v.is(y),P=v.isInline()&&d.getNextSibling()===null?v:d;for(let T=k.length-1;T>=0;T--){const N=k[T];if(N.is(d)||C(N)&&N.isParentOf(d))break;N.isAttached()&&(!S.has(N)||N.is(x)?w||P.insertAfter(N,!1):N.remove())}if(!w){let T=y,N=null;for(;T!==null;){const F=T.getChildren(),R=F.length;(R===0||F[R-1].is(N))&&(_.delete(T.__key),N=T),T=T.getParent()}}if(d.isToken())if(a===h)d.select();else{const T=ie(e);T.select(),d.replace(T)}else d=d.spliceText(a,h-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let T=1;T<f;T++){const N=u[T],F=N.__key;_.has(F)||N.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const y of t)j(y)&&r.push(y);const i=r.length;if(i===0)return this.toggleFormat(e),void re(null);const o=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:o,c=l?o:s;let u=0,f=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===f.getTextContentSize()&&(u=1,f=r[1],d=0),f==null)return;const h=f.getFormatFlags(e,null),g=i-1;let m=r[g];const _=c.type==="text"?c.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(ft(f)||d===0&&_===f.getTextContentSize())f.setFormat(h);else{const y=f.splitText(d,_),x=d===0?y[0]:y[1];x.setFormat(h),a.type==="text"&&a.set(x.__key,0,"text"),c.type==="text"&&c.set(x.__key,_-d,"text")}return void(this.format=h)}d===0||ft(f)||([,f]=f.splitText(d),d=0),f.setFormat(h);const v=m.getFormatFlags(e,h);_>0&&(_===m.getTextContentSize()||ft(m)||([m]=m.splitText(_)),m.setFormat(v));for(let y=u+1;y<g;y++){const x=r[y],k=x.getFormatFlags(e,v);x.setFormat(k)}a.type==="text"&&a.set(f.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=h|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=M();return O(h)||A(134),h.insertNodes(e)}const t=Mr((this.isBackward()?this.focus:this.anchor).getNode(),pt),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=oi(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(C(h)||U(h))&&!h.isInline())){C(t)||A(135);const h=oi(this);return t.splice(h,0,e),void r.selectEnd()}const i=function(h){const g=Ne();let m=null;for(let _=0;_<h.length;_++){const v=h[_],y=qt(v);if(y||U(v)&&v.isInline()||C(v)&&v.isInline()||j(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),g.append(m),y))continue;m!==null&&m.append(v)}else g.append(v),m=null}return g}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!C(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;C(u=c)&&pt(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||A(135),t.append(...c.getChildren()),c=s[1]),c&&function(h,g,m){const _=g.getParentOrThrow().getLastChild();let v=g;const y=[g];for(;v!==_;)v.getNextSibling()||A(140),v=v.getNextSibling(),y.push(v);let x=h;for(const k of y)x=x.insertAfter(k)}(t,c);const f=Mr(o,pt);l&&C(f)&&(l.canMergeWhenEmpty()||pt(a))&&(f.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=C(t)?t.getLastChild():null;qt(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Ne();return Q().splice(this.anchor.offset,0,[s]),s.select(),s}const e=oi(this),t=Mr(this.anchor.getNode(),pt);C(t)||A(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=nt();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,o=this.focus;let s=e[0],l=e[r];const[a,c]=ni(this);if(t===0)return[];if(t===1){if(j(s)&&!this.isCollapsed()){const f=a>c?c:a,d=a>c?a:c,h=s.splitText(f,d),g=f===0?h[0]:h[1];return g!=null?[g]:[]}return[s]}const u=i.isBefore(o);if(j(s)){const f=u?a:c;f===s.getTextContentSize()?e.shift():f!==0&&([,s]=s.splitText(f),e[0]=s)}if(j(l)){const f=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==f&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=Rt(i,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Yo();return h.add(l.__key),void Se(h)}const d=t?l.getPreviousSibling():l.getNextSibling();if(j(d)){const h=d.__key,g=t?d.getTextContent().length:0;return i.set(h,g,"text"),void(s&&o.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,m;return C(d)?(m=d.__key,g=t?d.getChildrenSize():0):(g=l.getIndexWithinParent(),m=h.__key,t||g++),i.set(m,g,"element"),void(s&&o.set(m,g,"element"))}}const a=G(),c=Te(a._window);if(!c)return;const u=a._blockCursorElement,f=a._rootElement;if(f===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Ir(u,a,f),function(d,h,g,m){d.modify(h,g,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),h=this.anchor.getNode(),g=oe(h)?h:Bl(h);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let y=0;y<m.length;y++){const x=m[y];jr(x,g)?_.push(x):v=!0}if(v&&_.length>0)if(t){const y=_[0];C(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=_[_.length-1];C(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(y){const x=y.focus,k=y.anchor,S=k.key,w=k.offset,P=k.type;Ve(k,x.key,x.offset,x.type),Ve(x,S,w,P),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&C(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(C(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=this.focus,s=Rt(o,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Yo();l.add(s.__key),Se(l)}else s.remove(),G().dispatchCommand(dn,void 0);return}if(!e&&C(s)&&C(i)&&i.isEmpty())return i.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Bo(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Bo(i,e,a)}(function(a,c){const u=a.anchor,f=a.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,m=f.offset,_=g<m,v=_?g:m,y=_?m:g,x=y-1;v!==x&&(io(d.getTextContent().slice(v,y))||(c?f.offset=x:u.offset=x))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&oe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Ce(n){return n instanceof Bn}function Wo(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function ni(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Wo(t),Wo(r)]}function Bo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===t||s>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function zo(n,e,t,r){let i,o=e;if(n.nodeType===At){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],f=!1;if(u===c)u=l[o+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&o--}if(i=ht(u),j(i))o=ro(i,s);else{let d=ht(n);if(d===null)return null;if(C(d)){o=Math.min(d.getChildrenSize(),o);let h=d.getChildAtIndex(o);if(C(h)&&function(g,m,_){const v=g.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(h,0,t)){const g=s?h.getLastDescendant():h.getFirstDescendant();g===null?d=h:(h=g,d=C(h)?h:h.getParentOrThrow()),o=0}j(h)?(i=h,d=null,o=ro(h,s)):h!==d&&s&&!f&&o++}else{const h=d.getIndexWithinParent();o=e===0&&U(d)&&ht(n)===d?h:h+1,d=d.getParentOrThrow()}if(C(d))return Ee(d.__key,o,"element")}}else i=ht(n);return j(i)?Ee(i.__key,o,"text"):null}function Ko(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&C(s)&&s.isInline()){const l=s.getPreviousSibling();j(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else C(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):j(o)&&(n.key=o.__key,n.offset=o.getTextContent().length)}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&C(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&C(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();j(l)&&(n.key=l.__key,n.offset=0)}}}function Uo(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Ko(n,r,i),Ko(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=G();if(o.isComposing()&&o._compositionKey!==n.key&&O(t)){const s=t.anchor,l=t.focus;Ve(n,s.key,s.offset,s.type),Ve(e,l.key,l.offset,l.type)}}}function Vo(n,e,t,r,i,o){if(n===null||t===null||!Lt(i,n,t))return null;const s=zo(n,e,O(o)?o.anchor:null,i);if(s===null)return null;const l=zo(t,r,O(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ht(n),c=ht(t);if(U(a)&&U(c))return null}return Uo(s,l,o),[s,l]}function ri(n){return C(n)&&!n.isInline()}function Jo(n,e,t,r,i,o){const s=Ie(),l=new Je(Ee(n,e,i),Ee(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function oa(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new Je(n,e,0,"")}function Yo(){return new Bn(new Set)}function ii(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!Cr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(O(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&O(n)&&!Lt(t,c,u))return n.clone();const h=Vo(c,f,u,d,t,n);if(h===null)return null;const[g,m]=h;return new Je(g,m,O(n)?n.format:0,O(n)?n.style:"")}function M(){return Ie()._selection}function Qt(){return G()._editorState._selection}function zn(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),Ho(n)}}else{const c=n.isBackward(),u=c?o:i,f=u.getNode(),d=c?i:o,h=d.getNode();if(e.is(f)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(h)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(a,Math.max(0,g+r),"element")}}Ho(n)}function Ho(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!C(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(C(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(C(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Kn(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,j(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,j(i)?l="text":C(i)&&(l="element")),o!==null&&l!==null?n.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function qo(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function sa(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==o||f!==null&&Tr(f))return;if(!O(e))return void(n!==null&&Lt(t,l,a)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,m=h.key,_=En(t,g),v=En(t,m),y=d.offset,x=h.offset,k=e.format,S=e.style,w=e.isCollapsed();let P=_,T=v,N=!1;if(d.type==="text"){P=Sn(_);const q=d.getNode();N=q.getFormat()!==k||q.getStyle()!==S}else O(n)&&n.anchor.type==="text"&&(N=!0);var F,R,H,V,W;if(h.type==="text"&&(T=Sn(v)),P!==null&&T!==null&&(w&&(n===null||N||O(n)&&(n.format!==k||n.style!==S))&&(F=k,R=S,H=y,V=g,W=performance.now(),To=[F,R,H,V,W]),c!==y||u!==x||l!==P||a!==T||r.type==="Range"&&w||(f!==null&&o.contains(f)||o.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(P,y,T,x)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const q=e instanceof Je&&e.anchor.type==="element"?P.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(q!==null){let ce;if(q instanceof Text){const Fe=document.createRange();Fe.selectNode(q),ce=Fe.getBoundingClientRect()}else ce=q.getBoundingClientRect();(function(Fe,He,sn){const ln=sn.ownerDocument,an=ln.defaultView;if(an===null)return;let{top:wt,bottom:St}=He,Tt=0,kt=0,me=sn;for(;me!==null;){const ot=me===ln.body;if(ot)Tt=0,kt=Pn(Fe).innerHeight;else{const qe=me.getBoundingClientRect();Tt=qe.top,kt=qe.bottom}let Oe=0;if(wt<Tt?Oe=-(Tt-wt):St>kt&&(Oe=St-kt),Oe!==0)if(ot)an.scrollBy(0,Oe);else{const qe=me.scrollTop;me.scrollTop+=Oe;const st=me.scrollTop-qe;wt-=st,St-=st}if(ot)break;me=Nn(me)}})(t,ce,o)}}Hr=!0}}function la(n){let e=M()||Qt();e===null&&(e=Q().selectEnd()),e.insertNodes(n)}function oi(n){let e=n;n.isCollapsed()||e.removeText();const t=M();O(t)&&(e=t),O(e)||A(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!pt(i);)[i,o]=aa(i,o);return o}function aa(n,e){const t=n.getParent();if(!t){const i=Ne();return Q().append(i),i.select(),[Q(),0]}if(j(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!C(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Je(Ee(n.__key,e,"element"),Ee(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,fe=!1,si=!1,Un=0;const Go={characterData:!0,childList:!0,subtree:!0};function Zt(){return fe||te!==null&&te._readOnly}function he(){fe&&A(13)}function Xo(){Un>99&&A(14)}function Ie(){return te===null&&A(195,Qo()),te}function G(){return ne===null&&A(196,Qo()),ne}function Qo(){let n=0;const e=new Set,t=Jn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=wn(i);if(kr(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ca(){return ne}function Zo(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&A(30,a),c}(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function es(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function ua(n){return li(n,G()._nodes)}function li(n,e){const t=n.type,r=e.get(t);r===void 0&&A(17,t);const i=r.klass;n.type!==i.getType()&&A(18,i.name);const o=i.importJSON(n),s=n.children;if(C(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=li(s[l],e);o.append(a)}return o}function ts(n,e,t){const r=te,i=fe,o=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=i,ne=o}}function Ye(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,l=t._selection,a=n._dirtyType!==Xe,c=te,u=fe,f=ne,d=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const w=n._dirtyType,P=n._dirtyElements,T=n._dirtyLeaves;h.disconnect(),g=ql(o,t,n,w,P,T)}catch(w){if(w instanceof Error&&n._onError(w),si)throw w;return ls(n,null,r,t),Ji(n),n._dirtyType=dt,si=!0,Ye(n,o),void(si=!1)}finally{h.observe(r,Go),n._updating=d,te=c,fe=u,ne=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,y=n._updateTags,x=n._deferred;a&&(n._dirtyType=Xe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(w,P){const T=w._decorators;let N=w._pendingDecorators||T;const F=P._nodeMap;let R;for(R in N)F.has(R)||(N===T&&(N=eo(w)),delete N[R])}(n,t);const k=i?null:Te(n._window);if(n._editable&&k!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const w=n._blockCursorElement;w!==null&&Ir(w,n,r),sa(s,l,n,k,y,r)}zl(n,r,l),h!==null&&h.observe(r,Go)}finally{ne=f,te=c}}g!==null&&function(w,P,T,N,F){const R=Array.from(w._listeners.mutation),H=R.length;for(let V=0;V<H;V++){const[W,q]=R[V],ce=P.get(q);ce!==void 0&&W(ce,{dirtyLeaves:N,prevEditorState:F,updateTags:T})}}(n,g,y,m,o),O(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(dn,void 0);const S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,en("decorator",n,!0,S)),function(w,P,T){const N=to(P),F=to(T);N!==F&&en("textcontent",w,!0,F)}(n,e||o,t),en("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||o,tags:y}),function(w,P){if(w._deferred=[],P.length!==0){const T=w._updating;w._updating=!0;try{for(let N=0;N<P.length;N++)P[N]()}finally{w._updating=T}}}(n,x),function(w){const P=w._updates;if(P.length!==0){const T=P.shift();if(T){const[N,F]=T;is(w,N,F)}}}(n)}function en(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function ns(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=ns(n,e,t)}),i}const r=Nr(n);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(e);if(s!==void 0){const l=s[i];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function rs(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&A(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function is(n,e,t){const r=n._updateTags;let i,o,s=!1,l=!1;t!==void 0&&(i=t.onUpdate,o=t.tag,o!=null&&r.add(o),s=t.skipTransforms||!1,l=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new Vn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const f=te,d=fe,h=ne,g=n._updating;te=c,fe=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(y){const x=y.getEditorState()._selection,k=Te(y._window);return O(x)||x==null?ii(x,k,y,null):x.clone()}(n));const _=n._compositionKey;e(),s=rs(n,s),function(y,x){const k=x.getEditorState()._selection,S=y._selection;if(O(S)){const w=S.anchor,P=S.focus;let T;if(w.type==="text"&&(T=w.getNode(),T.selectionTransform(k,S)),P.type==="text"){const N=P.getNode();T!==N&&N.selectionTransform(k,S)}}}(c,n),n._dirtyType!==Xe&&(s?function(y,x){const k=x._dirtyLeaves,S=y._nodeMap;for(const w of k){const P=S.get(w);j(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&qi(P)}}(c,n):function(y,x){const k=x._dirtyLeaves,S=x._dirtyElements,w=y._nodeMap,P=ze(),T=new Map;let N=k,F=N.size,R=S,H=R.size;for(;F>0||H>0;){if(F>0){x._dirtyLeaves=new Set;for(const V of N){const W=w.get(V);j(W)&&W.isAttached()&&W.isSimpleText()&&!W.isUnmergeable()&&qi(W),W!==void 0&&es(W,P)&&Zo(x,W,T),k.add(V)}if(N=x._dirtyLeaves,F=N.size,F>0){Un++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map;for(const V of R){const W=V[0],q=V[1];if(W!=="root"&&!q)continue;const ce=w.get(W);ce!==void 0&&es(ce,P)&&Zo(x,ce,T),S.set(W,q)}N=x._dirtyLeaves,F=N.size,R=x._dirtyElements,H=R.size,Un++}x._dirtyLeaves=k,x._dirtyElements=S}(c,n),rs(n),function(y,x,k,S){const w=y._nodeMap,P=x._nodeMap,T=[];for(const[N]of S){const F=P.get(N);F!==void 0&&(F.isAttached()||(C(F)&&po(F,N,w,P,T,S),w.has(N)||S.delete(N),T.push(N)))}for(const N of T)P.delete(N);for(const N of k){const F=P.get(N);F===void 0||F.isAttached()||(w.has(N)||k.delete(N),P.delete(N))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(O(v)){const y=c._nodeMap,x=v.anchor.key,k=v.focus.key;y.get(x)!==void 0&&y.get(k)!==void 0||A(19)}else Ce(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=dt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ye(n)}finally{te=f,fe=d,ne=h,n._updating=g,Un=0}n._dirtyType!==Xe||function(_,v){const y=v.getEditorState()._selection,x=_._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ye(n)):u&&Fl(()=>{Ye(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function ge(n,e,t){n._updating?n._updates.push([e,t]):is(n,e,t)}class tn extends $n{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return El[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=G()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(j(t)&&e.push(t),C(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;C(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;C(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return C(o)&&o.getLastDescendant()||o||null}const i=t[e];return C(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&A(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&A(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),C(o)&&i!==r-1&&!o.isInline()&&(e+=De)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),C(o)&&i!==r-1&&!o.isInline()&&(e+=De.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ki[e];return!!(this.getFormat()&t)}return!1}select(e,t){he();const r=M();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(j(a)||C(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(j(a)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return O(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Jo(l,i,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ki[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,o=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let f=null,d=o-t+i;if(e!==0)if(e===o)f=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(f=g.getPreviousSibling())}if(t>0){let g=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){g===null&&A(100);const _=g.getNextSibling(),v=g.__key;Qe(g.getWritable()),c.push(v),g=_}}let h=f;for(let g=0;g<i;g++){const m=r[g];h!==null&&m.is(h)&&(f=h=h.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,Qe(_);const v=m.__key;if(h===null)s.__first=v,_.__prev=null;else{const y=h.getWritable();y.__next=v,_.__prev=y.__key}m.__key===l&&A(76),_.__parent=l,a.push(v),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(u!==null){const g=u.getWritable();if(h!==null){const m=h.getWritable();g.__prev=h.__key,m.__next=u.__key}else g.__prev=null}if(s.__size=d,c.length){const g=M();if(O(g)){const m=new Set(c),_=new Set(a),{anchor:v,focus:y}=g;os(v,m,_)&&Kn(v,v.getNode(),this,f,u),os(y,m,_)&&Kn(y,y.getNode(),this,f,u),d!==0||this.canBeEmpty()||gt(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}}function C(n){return n instanceof tn}function os(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class da extends $n{constructor(e){super(e)}decorate(e,t){A(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof da}class nn extends tn{static getType(){return"root"}static clone(){return new nn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){A(51)}getTextContent(){const e=this.__cachedText;return!Zt()&&G()._dirtyType!==Xe||e===null?super.getTextContent():e}remove(){A(52)}replace(e){A(53)}insertBefore(e){A(54)}insertAfter(e){A(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||U(r)||A(56)}return super.append(...e)}static importJSON(e){const t=Q();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function oe(n){return n instanceof nn}function ai(){return new Vn(new Map([["root",new nn]]))}function ss(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&A(130,t.name),C(n)){const r=e.children;Array.isArray(r)||A(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=ss(i[o]);r.push(s)}}return e}class Vn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return ts(t&&t.editor||null,this,e)}clone(e){const t=new Vn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return ts(null,this,()=>({root:ss(Q())}))}}class ci extends tn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class xt extends tn{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=je[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new xt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=$t(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:fa,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&On(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const o=this.getIndent();o>0&&(t.style.textIndent=20*o+"px")}return{element:t}}static importJSON(e){const t=Ne();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=Ne();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||j(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function fa(n){const e=Ne();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function Ne(){return Wt(new xt)}function ui(n){return n instanceof xt}const K=0,ha=4;function ls(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=ai(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Xe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function ga(n){const e=n||{},t=ca(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=ai(),l=e.namespace||(i!==null?i._config.namespace:oo()),a=e.editorState,c=[nn,yt,Ht,Gt,xt,ci,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,y=null;if(typeof _!="function"){const w=_;_=w.replace,v=w.with,y=w.withKlass||null}const x=_.getType(),k=_.transform(),S=new Set;k!==null&&S.add(k),h.set(x,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:y,transforms:S})}}const g=new Jn(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,y=new Set,x=k=>{Object.keys(k).forEach(S=>{let w=v.get(S);w===void 0&&(w=[],v.set(S,w)),w.push(k[S])})};return m.forEach(k=>{const S=k.klass.importDOM;if(S==null||y.has(S))return;y.add(S);const w=S.call(k.klass);w!==null&&x(w)}),_&&x(_),v}(h,f?f.import:void 0),d);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=dt),g}class Jn{constructor(e,t,r,i,o,s,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=Xe,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=oo(),this._onError=o,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&A(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&A(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,i);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,i),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&A(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Jl(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);i.push(a)}var s,l;return s=this,l=e.getType(),ge(s,()=>{const a=Ie();if(a.isEmpty())return;if(l==="root")return void Q().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return I(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=$t(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,ls(this,t,e,i),t!==null&&(this._config.disableEvents||Gl(t),r!=null&&t.classList.remove(...r)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=dt,Ji(this),this._updateTags.add("history-merge"),Ye(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=Mn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",Do),Mn.set(c,(u||0)+1),l.__lexicalEditor=a;const f=Oo(l);for(let d=0;d<Yr.length;d++){const[h,g]=Yr[d],m=typeof g=="function"?_=>{Ao(_)||(jo(_),(a.isEditable()||h==="click")&&g(_,a))}:_=>{if(Ao(_))return;jo(_);const v=a.isEditable();switch(h){case"cut":return v&&I(a,dr,_);case"copy":return I(a,mn,_);case"paste":return v&&I(a,ar,_);case"dragstart":return v&&I(a,Mi,_);case"dragover":return v&&I(a,$i,_);case"dragend":return v&&I(a,ul,_);case"focus":return v&&I(a,hl,_);case"blur":return v&&I(a,gl,_);case"drop":return v&&I(a,Fi,_)}};l.addEventListener(h,m),f.push(()=>{l.removeEventListener(h,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;en("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&A(38),Vi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ye(this)),this._pendingEditorState=e,this._dirtyType=dt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ye(this)}parseEditorState(e,t){return function(r,i,o){const s=ai(),l=te,a=fe,c=ne,u=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,fe=!1,ne=i;try{const g=i._nodes;li(r.root,g),o&&o(),s._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=h,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ye(this),this.getEditorState().read(e,{editor:this})}update(e,t){ge(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),ge(this,()=>{const i=M(),o=Q();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Te(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,en("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Jn.version="0.17.1+prod.esm";const cu="";function pa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ma=pa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const as=D.createContext(null);function _a(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function rt(){const n=D.useContext(as);return n==null&&ma(8),n}const cs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ya=cs?D.useLayoutEffect:D.useEffect,Yn={tag:"history-merge"};function xa({initialConfig:n,children:e}){const t=D.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=_a(null,r),u=ga({editable:n.editable,html:a,namespace:i,nodes:o,onError:f=>s(f,u),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=Q();if(h.isEmpty()){const g=Ne();h.append(g);const m=cs?document.activeElement:null;(M()!==null||m!==null&&m===f.getRootElement())&&g.select()}},Yn);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Yn);break}case"object":f.setEditorState(d,Yn);break;case"function":f.update(()=>{Q().isEmpty()&&d(f)},Yn)}}}(u,l),[u,c]},[]);return ya(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),b.jsx(as.Provider,{value:t,children:e})}function va({defaultSelection:n}){const[e]=rt();return D.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function ba(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ca=ba(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const di=new Map;function us(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function ds(n){let e=di.get(n);return e===void 0&&(e=us(n),di.set(n,e)),e}function fs(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,o=n.isBackward(),s=r.getNode(),l=i.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,f]=ni(n),d=s.is(l),h=e.is(o?l:s),g=e.is(o?s:l);let m,_=0;return d?(_=u>f?f:u,m=u>f?u:f):h?(_=o?f:u,m=void 0):g&&(_=0,m=o?u:f),e.__text=e.__text.slice(_,m),e}}return e}function hs(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return C(e)||Ca(177),n.offset===e.getChildrenSize()}function wa(n){const e=n.getStyle(),t=us(e);di.set(e,t)}function gs(n,e){const t=Rt(n.focus,e);return U(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function Sa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ps(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ms(n,e,t){const r=ps(n);Sa(n,e,t?!r:r,"character")}function Ta(n,e,t){const r=ds(n.getStyle());return r!==null&&r[e]||t}function ka(n,e,t=""){let r=null;const i=n.getNodes(),o=n.anchor,s=n.focus,l=n.isBackward(),a=l?s.offset:o.offset,c=l?s.getNode():o.getNode();if(O(n)&&n.isCollapsed()&&n.style!==""){const u=ds(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const f=i[u];if((u===0||a!==0||!f.is(c))&&j(f)){const d=Ta(f,e,t);if(r===null)r=d;else if(r!==d){r="";break}}}return r===null?t:r}function Ea(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Na=Ea(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const _s=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Pa=_s&&"documentMode"in document?document.documentMode:null;!(!_s||!("InputEvent"in window)||Pa)&&"getTargetRanges"in new window.InputEvent("input");function Oa(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function vt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Da(n,...e){const t=Oa(...e);t.length>0&&n.classList.add(...t)}function ja(n){const e=Hn(n,t=>C(t)&&!t.isInline());return C(e)||Na(4,n.__key),e}const Hn=(n,e)=>{let t=n;for(;t!==Q()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function it(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const qn=0,fi=1,hi=2,we=0,Aa=1,ys=2,La=3,Ia=4;function Fa(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return we;const o=e._selection,s=n._selection;if(i)return Aa;if(!(O(o)&&O(s)&&s.isCollapsed()&&o.isCollapsed()))return we;const l=function(v,y,x){const k=v._nodeMap,S=[];for(const w of y){const P=k.get(w);P!==void 0&&S.push(P)}for(const[w,P]of x){if(!P)continue;const T=k.get(w);T===void 0||oe(T)||S.push(T)}return S}(e,t,r);if(l.length===0)return we;if(l.length>1){const v=e._nodeMap,y=v.get(o.anchor.key),x=v.get(s.anchor.key);return y&&x&&!n._nodeMap.has(y.__key)&&j(y)&&y.__text.length===1&&o.anchor.offset===1?ys:we}const a=l[0],c=n._nodeMap.get(a.__key);if(!j(c)||!j(a)||c.__mode!==a.__mode)return we;const u=c.__text,f=a.__text;if(u===f)return we;const d=o.anchor,h=s.anchor;if(d.key!==h.key||d.type!=="text")return we;const g=d.offset,m=h.offset,_=f.length-u.length;return _===1&&m===g-1?ys:_===-1&&m===g+1?La:_===-1&&m===g?Ia:we}function Ma(n,e){let t=Date.now(),r=we;return(i,o,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=we,t=u,hi;const f=Fa(i,o,l,a,n.isComposing()),d=(()=>{const h=s===null||s.editor===n,g=c.has("history-push");if(!g&&h&&c.has("history-merge"))return qn;if(i===null)return fi;const m=o._selection;return l.size>0||a.size>0?g===!1&&f!==we&&f===r&&u<t+e&&h||l.size===1&&function(_,v,y){const x=v._nodeMap.get(_),k=y._nodeMap.get(_),S=v._selection,w=y._selection;return!(O(S)&&O(w)&&S.anchor.type==="element"&&S.focus.type==="element"&&w.anchor.type==="text"&&w.focus.type==="text"||!j(x)||!j(k)||x.__parent!==k.__parent)&&JSON.stringify(v.read(()=>x.exportJSON()))===JSON.stringify(y.read(()=>k.exportJSON()))}(Array.from(l)[0],i,o)?qn:fi:m!==null?qn:hi})();return t=u,r=f,d}}function xs(n){n.undoStack=[],n.redoStack=[],n.current=null}function $a(n,e,t){const r=Ma(n,t);return vt(n.registerCommand(hn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),o.dispatchCommand(Dt,!0)),a.length===0&&o.dispatchCommand(jt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(gn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),o.dispatchCommand(jt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Dt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(dl,()=>(xs(e),!1),K),n.registerCommand(fl,()=>(xs(e),n.dispatchCommand(Dt,!1),n.dispatchCommand(jt,!1),!0),K),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,f=e.redoStack,d=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&o===h)return;const g=r(s,o,u,l,a,c);if(g===fi)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Dt,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(jt,!0));else if(g===hi)return;e.current={editor:n,editorState:o}}))}function Ra(){return{current:null,redoStack:[],undoStack:[]}}function Wa({delay:n,externalHistoryState:e}){const[t]=rt();return function(r,i,o=1e3){const s=D.useMemo(()=>i||Ra(),[i]);D.useEffect(()=>$a(r,s,o),[o,r,s])}(t,e,n),null}const Ba=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function za(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Ka(){return function(n){const[e]=rt(),t=D.useMemo(()=>n(e),[e,n]),r=D.useRef(t.initialValueFn()),[i,o]=D.useState(r.current);return Ba(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,o(a)),l(c=>{r.current=c,o(c)})},[t,n]),i}(za)}function Ua(){return Q().getTextContent()}function Va(n,e=!0){if(n)return!1;let t=Ua();return e&&(t=t.trim()),t===""}function Ja(n){if(!Va(n,!1))return!1;const e=Q().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(U(i))return!1;if(C(i)){if(!ui(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!j(a))return!1}}}return!0}function vs(n){return()=>Ja(n)}function Ya(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}Ya(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Ha(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const o=r.data;if(typeof o=="string"){let s;try{s=JSON.parse(o)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,f,d,h,g]=a;n.update(()=>{const m=M();if(O(m)){const _=m.anchor;let v=_.getNode(),y=0,x=0;if(j(v)&&c>=0&&u>=0&&(y=c,x=c+u,m.setTextNodeRange(v,y,v,x)),y===x&&f===""||(m.insertRawText(f),v=_.getNode()),j(v)){y=d,x=d+h;const k=v.getTextContentSize();y=y>k?k:y,x=x>k?k:x,m.setTextNodeRange(v,y,v,x)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function qa(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let o=0;o<t.length;o++){const s=t[o];if(!Cs.has(s.nodeName)){const l=ws(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof ci&&s.insertAfter(nt());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Ga(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=Q().getChildren();for(let i=0;i<r.length;i++)bs(n,r[i],t,e);return t.innerHTML}function bs(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=C(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let h=$r(e);h=j(h)&&r!==null?fs(r,h):h,s=h}const l=C(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],m=bs(n,g,d,r);!i&&C(e)&&m&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!o){if(On(u)&&u.append(d),t.append(u),f){const h=f.call(s,u);h&&u.replaceWith(h)}}else t.append(d);return i}const Cs=new Set(["STYLE","SCRIPT"]);function ws(n,e,t,r,i=new Map,o){let s=[];if(Cs.has(n.nodeName))return s;let l=null;const a=function(g,m){const{nodeName:_}=g,v=m._htmlConversions.get(_.toLowerCase());let y=null;if(v!==void 0)for(const x of v){const k=x(g);k!==null&&(y===null||(y.priority||0)<(k.priority||0))&&(y=k)}return y!==null?y.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const h=(l==null||!gt(l))&&(l!=null&&ri(l)||r);for(let g=0;g<f.length;g++)d.push(...ws(f[g],e,t,h,new Map(i),l));return u!=null&&(d=u(d)),Dn(n)&&(d=Xa(n,d,h?()=>{const g=new ci;return t.push(g),g}:Ne)),l==null?d.length>0?s=s.concat(d):Dn(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Fr(g.nextSibling)&&Fr(g.previousSibling)}(n)&&(s=s.concat(nt())):C(l)&&l.append(...d),s}function Xa(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(ri(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&ri(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function Qa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Gn=Qa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Za=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ss=n=>Za?(n||window).getSelection():null;function ec(n,e=M()){return e==null&&Gn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":Ga(n,e)}function tc(n,e=M()){return e==null&&Gn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(nc(n,e))}function Ts(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return ks(t,rc(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return ks(t,qa(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(O(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=M();if(O(a)){const c=s[l];c===`
39
+ `?r.push(Xe()):s===" "?r.push(Vt()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,v,x,y){const b=_.getNode(),T=b.getChildAtIndex(_.offset),S=ie(),E=oe(b)?we().append(S):S;S.setFormat(x),S.setStyle(y),T===null?b.append(E):T.insertBefore(E),_.is(v)&&v.set(S.__key,0,"text"),_.set(S.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),f=u.length;let d=u[0];j(d)||L(26);const g=d.getTextContent().length,h=d.getParentOrThrow();let m=u[f-1];if(f===1&&l.type==="element"&&(c=g,l.set(s.key,c,"text")),this.isCollapsed()&&a===g&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(j(_)&&_.canInsertTextBefore()&&!at(_)||(_=ie(),_.setFormat(i),_.setStyle(o),h.canInsertTextAfter()?d.insertAfter(_):h.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(j(_)&&!at(_)||(_=ie(),_.setFormat(i),h.canInsertTextBefore()?d.insertBefore(_):h.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==g){const _=ie(d.getTextContent());_.setFormat(i),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||C(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Do(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const y=ie(e);return y.select(),void d.replace(y)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===i&&v===o){if(Wl(d)){const y=ie(e);return y.setFormat(i),y.setStyle(o),y.select(),void d.replace(y)}}else{if(d.getTextContent()!==""){const y=ie(e);if(y.setFormat(i),y.setStyle(o),y.select(),a===0)d.insertBefore(y,!1);else{const[b]=d.splitText(a);b.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(o)}const x=c-a;d=d.spliceText(a,x,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=C(d)?d:d.getParentOrThrow();let x=C(m)?m:m.getParentOrThrow(),y=m;if(!v.is(x)&&x.isInline())do y=x,x=x.getParentOrThrow();while(x.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(j(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const N=ie(m.getTextContent());m.replace(N),m=N}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const N=m.getParentOrThrow();N.canBeEmpty()||N.getChildrenSize()!==1?m.remove():N.remove()}else _.add(m.__key);const b=x.getChildren(),T=new Set(u),S=v.is(x),E=v.isInline()&&d.getNextSibling()===null?v:d;for(let N=b.length-1;N>=0;N--){const M=b[N];if(M.is(d)||C(M)&&M.isParentOf(d))break;M.isAttached()&&(!T.has(M)||M.is(y)?S||E.insertAfter(M,!1):M.remove())}if(!S){let N=x,M=null;for(;N!==null;){const R=N.getChildren(),B=R.length;(B===0||R[B-1].is(M))&&(_.delete(N.__key),M=N),N=N.getParent()}}if(d.isToken())if(a===g)d.select();else{const N=ie(e);N.select(),d.replace(N)}else d=d.spliceText(a,g-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let N=1;N<f;N++){const M=u[N],R=M.__key;_.has(R)||M.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const x of t)j(x)&&r.push(x);const i=r.length;if(i===0)return this.toggleFormat(e),void re(null);const o=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:o,c=l?o:s;let u=0,f=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===f.getTextContentSize()&&(u=1,f=r[1],d=0),f==null)return;const g=f.getFormatFlags(e,null),h=i-1;let m=r[h];const _=c.type==="text"?c.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(at(f)||d===0&&_===f.getTextContentSize())f.setFormat(g);else{const x=f.splitText(d,_),y=d===0?x[0]:x[1];y.setFormat(g),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,_-d,"text")}return void(this.format=g)}d===0||at(f)||([,f]=f.splitText(d),d=0),f.setFormat(g);const v=m.getFormatFlags(e,g);_>0&&(_===m.getTextContentSize()||at(m)||([m]=m.splitText(_)),m.setFormat(v));for(let x=u+1;x<h;x++){const y=r[x],b=y.getFormatFlags(e,v);y.setFormat(b)}a.type==="text"&&a.set(f.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=g|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=O();return k(g)||L(134),g.insertNodes(e)}const t=wr((this.isBackward()?this.focus:this.anchor).getNode(),dt),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Jr(this);t.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(C(g)||Y(g))&&!g.isInline())){C(t)||L(135);const g=Jr(this);return t.splice(g,0,e),void r.selectEnd()}const i=function(g){const h=we();let m=null;for(let _=0;_<g.length;_++){const v=g[_],x=Kt(v);if(x||Y(v)&&v.isInline()||C(v)&&v.isInline()||j(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),h.append(m),x))continue;m!==null&&m.append(v)}else h.append(v),m=null}return h}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!C(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;C(u=c)&&dt(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||L(135),t.append(...c.getChildren()),c=s[1]),c&&function(g,h,m){const _=h.getParentOrThrow().getLastChild();let v=h;const x=[h];for(;v!==_;)v.getNextSibling()||L(140),v=v.getNextSibling(),x.push(v);let y=g;for(const b of x)y=y.insertAfter(b)}(t,c);const f=wr(o,dt);l&&C(f)&&(l.canMergeWhenEmpty()||dt(a))&&(f.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=C(t)?t.getLastChild():null;Kt(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=we();return G().splice(this.anchor.offset,0,[s]),s.select(),s}const e=Jr(this),t=wr(this.anchor.getNode(),dt);C(t)||L(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=Xe();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,o=this.focus;let s=e[0],l=e[r];const[a,c]=Kr(this);if(t===0)return[];if(t===1){if(j(s)&&!this.isCollapsed()){const f=a>c?c:a,d=a>c?a:c,g=s.splitText(f,d),h=f===0?g[0]:g[1];return h!=null?[h]:[]}return[s]}const u=i.isBefore(o);if(j(s)){const f=u?a:c;f===s.getTextContentSize()?e.shift():f!==0&&([,s]=s.splitText(f),e[0]=s)}if(j(l)){const f=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==f&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=Pt(i,t);if(Y(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const g=Po();return g.add(l.__key),void Se(g)}const d=t?l.getPreviousSibling():l.getNextSibling();if(j(d)){const g=d.__key,h=t?d.getTextContent().length:0;return i.set(g,h,"text"),void(s&&o.set(g,h,"text"))}{const g=l.getParentOrThrow();let h,m;return C(d)?(m=d.__key,h=t?d.getChildrenSize():0):(h=l.getIndexWithinParent(),m=g.__key,t||h++),i.set(m,h,"element"),void(s&&o.set(m,h,"element"))}}const a=Z(),c=Te(a._window);if(!c)return;const u=a._blockCursorElement,f=a._rootElement;if(f===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Tr(u,a,f),function(d,g,h,m){d.modify(g,h,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),g=this.anchor.getNode(),h=oe(g)?g:bl(g);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let x=0;x<m.length;x++){const y=m[x];vr(y,h)?_.push(y):v=!0}if(v&&_.length>0)if(t){const x=_[0];C(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{const x=_[_.length-1];C(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(x){const y=x.focus,b=x.anchor,T=b.key,S=b.offset,E=b.type;Ue(b,y.key,y.offset,y.type),Ue(y,T,S,E),x._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&C(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(C(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=this.focus,s=Pt(o,e);if(Y(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Po();l.add(s.__key),Se(l)}else s.remove(),Z().dispatchCommand(nn,void 0);return}if(!e&&C(s)&&C(i)&&i.isEmpty())return i.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Lo(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Lo(i,e,a)}(function(a,c){const u=a.anchor,f=a.focus,d=u.getNode(),g=f.getNode();if(d===g&&u.type==="text"&&f.type==="text"){const h=u.offset,m=f.offset,_=h<m,v=_?h:m,x=_?m:h,y=x-1;v!==y&&(Vi(d.getTextContent().slice(v,x))||(c?f.offset=y:u.offset=y))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&oe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ve(n){return n instanceof Dn}function ko(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Kr(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[ko(t),ko(r)]}function Lo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===t||s>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function jo(n,e,t,r){let i,o=e;if(n.nodeType===Lt){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],f=!1;if(u===c)u=l[o+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&o--}if(i=ct(u),j(i))o=Qi(i,s);else{let d=ct(n);if(d===null)return null;if(C(d)){o=Math.min(d.getChildrenSize(),o);let g=d.getChildAtIndex(o);if(C(g)&&function(h,m,_){const v=h.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(g,0,t)){const h=s?g.getLastDescendant():g.getFirstDescendant();h===null?d=g:(g=h,d=C(g)?g:g.getParentOrThrow()),o=0}j(g)?(i=g,d=null,o=Qi(g,s)):g!==d&&s&&!f&&o++}else{const g=d.getIndexWithinParent();o=e===0&&Y(d)&&ct(n)===d?g:g+1,d=d.getParentOrThrow()}if(C(d))return be(d.__key,o,"element")}}else i=ct(n);return j(i)?be(i.__key,o,"text"):null}function Io(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&C(s)&&s.isInline()){const l=s.getPreviousSibling();j(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else C(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):j(o)&&(n.key=o.__key,n.offset=o.getTextContent().length)}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&C(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&C(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();j(l)&&(n.key=l.__key,n.offset=0)}}}function Do(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Io(n,r,i),Io(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=Z();if(o.isComposing()&&o._compositionKey!==n.key&&k(t)){const s=t.anchor,l=t.focus;Ue(n,s.key,s.offset,s.type),Ue(e,l.key,l.offset,l.type)}}}function Oo(n,e,t,r,i,o){if(n===null||t===null||!jt(i,n,t))return null;const s=jo(n,e,k(o)?o.anchor:null,i);if(s===null)return null;const l=jo(t,r,k(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ct(n),c=ct(t);if(Y(a)&&Y(c))return null}return Do(s,l,o),[s,l]}function Qr(n){return C(n)&&!n.isInline()}function Ao(n,e,t,r,i,o){const s=Ie(),l=new $e(be(n,e,i),be(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Ul(){const n=be("root",0,"element"),e=be("root",0,"element");return new $e(n,e,0,"")}function Po(){return new Dn(new Set)}function Vr(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!ur&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(k(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&k(n)&&!jt(t,c,u))return n.clone();const g=Oo(c,f,u,d,t,n);if(g===null)return null;const[h,m]=g;return new $e(h,m,k(n)?n.format:0,k(n)?n.style:"")}function O(){return Ie()._selection}function Jt(){return Z()._editorState._selection}function On(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),zo(n)}}else{const c=n.isBackward(),u=c?o:i,f=u.getNode(),d=c?i:o,g=d.getNode();if(e.is(f)){const h=u.offset;(t<=h&&r>0||t<h&&r<0)&&u.set(a,Math.max(0,h+r),"element")}if(e.is(g)){const h=d.offset;(t<=h&&r>0||t<h&&r<0)&&d.set(a,Math.max(0,h+r),"element")}}zo(n)}function zo(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!C(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(C(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(C(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function An(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,j(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,j(i)?l="text":C(i)&&(l="element")),o!==null&&l!==null?n.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Ro(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function $l(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==o||f!==null&&gr(f))return;if(!k(e))return void(n!==null&&jt(t,l,a)&&r.removeAllRanges());const d=e.anchor,g=e.focus,h=d.key,m=g.key,_=xn(t,h),v=xn(t,m),x=d.offset,y=g.offset,b=e.format,T=e.style,S=e.isCollapsed();let E=_,N=v,M=!1;if(d.type==="text"){E=_n(_);const V=d.getNode();M=V.getFormat()!==b||V.getStyle()!==T}else k(n)&&n.anchor.type==="text"&&(M=!0);var R,B,ee,J,F;if(g.type==="text"&&(N=_n(v)),E!==null&&N!==null&&(S&&(n===null||M||k(n)&&(n.format!==b||n.style!==T))&&(R=b,B=T,ee=x,J=h,F=performance.now(),ho=[R,B,ee,J,F]),c!==x||u!==y||l!==E||a!==N||r.type==="Range"&&S||(f!==null&&o.contains(f)||o.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(E,x,N,y)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const V=e instanceof $e&&e.anchor.type==="element"?E.childNodes[x]||null:r.rangeCount>0?r.getRangeAt(0):null;if(V!==null){let ce;if(V instanceof Text){const De=document.createRange();De.selectNode(V),ce=De.getBoundingClientRect()}else ce=V.getBoundingClientRect();(function(De,Ke,Ht){const Xt=Ht.ownerDocument,en=Xt.defaultView;if(en===null)return;let{top:xt,bottom:vt}=Ke,Ct=0,St=0,pe=Ht;for(;pe!==null;){const nt=pe===Xt.body;if(nt)Ct=0,St=Cn(De).innerHeight;else{const Qe=pe.getBoundingClientRect();Ct=Qe.top,St=Qe.bottom}let Me=0;if(xt<Ct?Me=-(Ct-xt):vt>St&&(Me=vt-St),Me!==0)if(nt)en.scrollBy(0,Me);else{const Qe=pe.scrollTop;pe.scrollTop+=Me;const rt=pe.scrollTop-Qe;xt-=rt,vt-=rt}if(nt)break;pe=vn(pe)}})(t,ce,o)}}zr=!0}}function Yl(n){let e=O()||Jt();e===null&&(e=G().selectEnd()),e.insertNodes(n)}function Jr(n){let e=n;n.isCollapsed()||e.removeText();const t=O();k(t)&&(e=t),k(e)||L(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!dt(i);)[i,o]=Kl(i,o);return o}function Kl(n,e){const t=n.getParent();if(!t){const i=we();return G().append(i),i.select(),[G(),0]}if(j(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!C(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new $e(be(n.__key,e,"element"),be(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,fe=!1,Zr=!1,Pn=0;const Fo={characterData:!0,childList:!0,subtree:!0};function Zt(){return fe||te!==null&&te._readOnly}function ge(){fe&&L(13)}function Wo(){Pn>99&&L(14)}function Ie(){return te===null&&L(195,Bo()),te}function Z(){return ne===null&&L(196,Bo()),ne}function Bo(){let n=0;const e=new Set,t=Fn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=pn(i);if(hr(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Ql(){return ne}function Uo(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&L(30,a),c}(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function $o(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Vl(n){return qr(n,Z()._nodes)}function qr(n,e){const t=n.type,r=e.get(t);r===void 0&&L(17,t);const i=r.klass;n.type!==i.getType()&&L(18,i.name);const o=i.importJSON(n),s=n.children;if(C(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=qr(s[l],e);o.append(a)}return o}function Yo(n,e,t){const r=te,i=fe,o=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=i,ne=o}}function Ye(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,l=t._selection,a=n._dirtyType!==Je,c=te,u=fe,f=ne,d=n._updating,g=n._observer;let h=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&g!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const S=n._dirtyType,E=n._dirtyElements,N=n._dirtyLeaves;g.disconnect(),h=Il(o,t,n,S,E,N)}catch(S){if(S instanceof Error&&n._onError(S),Zr)throw S;return qo(n,null,r,t),Ai(n),n._dirtyType=lt,Zr=!0,Ye(n,o),void(Zr=!1)}finally{g.observe(r,Fo),n._updating=d,te=c,fe=u,ne=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,x=n._updateTags,y=n._deferred;a&&(n._dirtyType=Je,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,E){const N=S._decorators;let M=S._pendingDecorators||N;const R=E._nodeMap;let B;for(B in M)R.has(B)||(M===N&&(M=$i(S)),delete M[B])}(n,t);const b=i?null:Te(n._window);if(n._editable&&b!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(g!==null&&g.disconnect(),a||l===null||l.dirty){const S=n._blockCursorElement;S!==null&&Tr(S,n,r),$l(s,l,n,b,x,r)}wl(n,r,l),g!==null&&g.observe(r,Fo)}finally{ne=f,te=c}}h!==null&&function(S,E,N,M,R){const B=Array.from(S._listeners.mutation),ee=B.length;for(let J=0;J<ee;J++){const[F,V]=B[J],ce=E.get(V);ce!==void 0&&F(ce,{dirtyLeaves:M,prevEditorState:R,updateTags:N})}}(n,h,x,m,o),k(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(nn,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,qt("decorator",n,!0,T)),function(S,E,N){const M=Yi(E),R=Yi(N);M!==R&&qt("textcontent",S,!0,R)}(n,e||o,t),qt("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||o,tags:x}),function(S,E){if(S._deferred=[],E.length!==0){const N=S._updating;S._updating=!0;try{for(let M=0;M<E.length;M++)E[M]()}finally{S._updating=N}}}(n,y),function(S){const E=S._updates;if(E.length!==0){const N=E.shift();if(N){const[M,R]=N;Vo(S,M,R)}}}(n)}function qt(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function Ko(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=Ko(n,e,t)}),i}const r=_r(n);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(e);if(s!==void 0){const l=s[i];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function Qo(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&L(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function Vo(n,e,t){const r=n._updateTags;let i,o,s=!1,l=!1;t!==void 0&&(i=t.onUpdate,o=t.tag,o!=null&&r.add(o),s=t.skipTransforms||!1,l=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new Rn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const f=te,d=fe,g=ne,h=n._updating;te=c,fe=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(x){const y=x.getEditorState()._selection,b=Te(x._window);return k(y)||y==null?Vr(y,b,x,null):y.clone()}(n));const _=n._compositionKey;e(),s=Qo(n,s),function(x,y){const b=y.getEditorState()._selection,T=x._selection;if(k(T)){const S=T.anchor,E=T.focus;let N;if(S.type==="text"&&(N=S.getNode(),N.selectionTransform(b,T)),E.type==="text"){const M=E.getNode();N!==M&&M.selectionTransform(b,T)}}}(c,n),n._dirtyType!==Je&&(s?function(x,y){const b=y._dirtyLeaves,T=x._nodeMap;for(const S of b){const E=T.get(S);j(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&Ri(E)}}(c,n):function(x,y){const b=y._dirtyLeaves,T=y._dirtyElements,S=x._nodeMap,E=Fe(),N=new Map;let M=b,R=M.size,B=T,ee=B.size;for(;R>0||ee>0;){if(R>0){y._dirtyLeaves=new Set;for(const J of M){const F=S.get(J);j(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Ri(F),F!==void 0&&$o(F,E)&&Uo(y,F,N),b.add(J)}if(M=y._dirtyLeaves,R=M.size,R>0){Pn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const J of B){const F=J[0],V=J[1];if(F!=="root"&&!V)continue;const ce=S.get(F);ce!==void 0&&$o(ce,E)&&Uo(y,ce,N),T.set(F,V)}M=y._dirtyLeaves,R=M.size,B=y._dirtyElements,ee=B.size,Pn++}y._dirtyLeaves=b,y._dirtyElements=T}(c,n),Qo(n),function(x,y,b,T){const S=x._nodeMap,E=y._nodeMap,N=[];for(const[M]of T){const R=E.get(M);R!==void 0&&(R.isAttached()||(C(R)&&ro(R,M,S,E,N,T),S.has(M)||T.delete(M),N.push(M)))}for(const M of N)E.delete(M);for(const M of b){const R=E.get(M);R===void 0||R.isAttached()||(S.has(M)||b.delete(M),E.delete(M))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(k(v)){const x=c._nodeMap,y=v.anchor.key,b=v.focus.key;x.get(y)!==void 0&&x.get(b)!==void 0||L(19)}else ve(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=lt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ye(n)}finally{te=f,fe=d,ne=g,n._updating=h,Pn=0}n._dirtyType!==Je||function(_,v){const x=v.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(x))return!0}else if(x!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ye(n)):u&&vl(()=>{Ye(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Vo(n,e,t)}class zn extends Ln{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return dl[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=Z()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(j(t)&&e.push(t),C(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;C(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;C(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return C(o)&&o.getLastDescendant()||o||null}const i=t[e];return C(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&L(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&L(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ee)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ee.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ii[e];return!!(this.getFormat()&t)}return!1}select(e,t){ge();const r=O();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(j(a)||C(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(j(a)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return k(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Ao(l,i,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ii[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,o=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let f=null,d=o-t+i;if(e!==0)if(e===o)f=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(t>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){h===null&&L(100);const _=h.getNextSibling(),v=h.__key;Ze(h.getWritable()),c.push(v),h=_}}let g=f;for(let h=0;h<i;h++){const m=r[h];g!==null&&m.is(g)&&(f=g=g.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,Ze(_);const v=m.__key;if(g===null)s.__first=v,_.__prev=null;else{const x=g.getWritable();x.__next=v,_.__prev=x.__key}m.__key===l&&L(76),_.__parent=l,a.push(v),g=m}if(e+t===o)g!==null&&(g.getWritable().__next=null,s.__last=g.__key);else if(u!==null){const h=u.getWritable();if(g!==null){const m=g.getWritable();h.__prev=g.__key,m.__next=u.__key}else h.__prev=null}if(s.__size=d,c.length){const h=O();if(k(h)){const m=new Set(c),_=new Set(a),{anchor:v,focus:x}=h;Jo(v,m,_)&&An(v,v.getNode(),this,f,u),Jo(x,m,_)&&An(x,x.getNode(),this,f,u),d!==0||this.canBeEmpty()||ut(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}}function C(n){return n instanceof zn}function Jo(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class Jl extends Ln{constructor(e){super(e)}decorate(e,t){L(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Y(n){return n instanceof Jl}class Gt extends zn{static getType(){return"root"}static clone(){return new Gt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){L(51)}getTextContent(){const e=this.__cachedText;return!Zt()&&Z()._dirtyType!==Je||e===null?super.getTextContent():e}remove(){L(52)}replace(e){L(53)}insertBefore(e){L(54)}insertAfter(e){L(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||Y(r)||L(56)}return super.append(...e)}static importJSON(e){const t=G();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function oe(n){return n instanceof Gt}function Gr(){return new Rn(new Map([["root",new Gt]]))}function Zo(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&L(130,t.name),C(n)){const r=e.children;Array.isArray(r)||L(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Zo(i[o]);r.push(s)}}return e}class Rn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Yo(t&&t.editor||null,this,e)}clone(e){const t=new Rn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Yo(null,this,()=>({root:Zo(G())}))}}class Hr extends zn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class pt extends zn{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ke[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new pt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=At(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Zl,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Nr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const o=this.getIndent();o>0&&(t.style.textIndent=20*o+"px")}return{element:t}}static importJSON(e){const t=we();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=we();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||j(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Zl(n){const e=we();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function we(){return Sn(new pt)}function Xr(n){return n instanceof pt}const $=0,ql=4;function qo(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Gr(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Je,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function Gl(n){const e=n||{},t=Ql(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=Gr(),l=e.namespace||(i!==null?i._config.namespace:Ji()),a=e.editorState,c=[Gt,ht,Yt,Qt,pt,Hr,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let g;if(n===void 0&&t!==null)g=t._nodes;else{g=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,x=null;if(typeof _!="function"){const S=_;_=S.replace,v=S.with,x=S.withKlass||null}const y=_.getType(),b=_.transform(),T=new Set;b!==null&&T.add(b),g.set(y,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:x,transforms:T})}}const h=new Fn(s,i,g,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,x=new Set,y=b=>{Object.keys(b).forEach(T=>{let S=v.get(T);S===void 0&&(S=[],v.set(T,S)),S.push(b[T])})};return m.forEach(b=>{const T=b.klass.importDOM;if(T==null||x.has(T))return;x.add(T);const S=T.call(b.klass);S!==null&&y(S)}),_&&y(_),v}(g,f?f.import:void 0),d);return a!==void 0&&(h._pendingEditorState=a,h._dirtyType=lt),h}class Fn{constructor(e,t,r,i,o,s,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=Je,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ji(),this._onError=o,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&L(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&L(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,i);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,i),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&L(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=kl(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);i.push(a)}var s,l;return s=this,l=e.getType(),he(s,()=>{const a=Ie();if(a.isEmpty())return;if(l==="root")return void G().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return D(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=At(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,qo(this,t,e,i),t!==null&&(this._config.disableEvents||Dl(t),r!=null&&t.classList.remove(...r)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=lt,Ai(this),this._updateTags.add("history-merge"),Ye(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=kn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",vo),kn.set(c,(u||0)+1),l.__lexicalEditor=a;const f=xo(l);for(let d=0;d<Pr.length;d++){const[g,h]=Pr[d],m=typeof h=="function"?_=>{So(_)||(Co(_),(a.isEditable()||g==="click")&&h(_,a))}:_=>{if(So(_))return;Co(_);const v=a.isEditable();switch(g){case"cut":return v&&D(a,Xn,_);case"copy":return D(a,an,_);case"paste":return v&&D(a,Gn,_);case"dragstart":return v&&D(a,wi,_);case"dragover":return v&&D(a,Mi,_);case"dragend":return v&&D(a,Js,_);case"focus":return v&&D(a,Gs,_);case"blur":return v&&D(a,Hs,_);case"drop":return v&&D(a,bi,_)}};l.addEventListener(g,m),f.push(()=>{l.removeEventListener(g,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;qt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&L(38),Oi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ye(this)),this._pendingEditorState=e,this._dirtyType=lt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ye(this)}parseEditorState(e,t){return function(r,i,o){const s=Gr(),l=te,a=fe,c=ne,u=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,g=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,fe=!1,ne=i;try{const h=i._nodes;qr(r.root,h),o&&o(),s._readOnly=!0}catch(h){h instanceof Error&&i._onError(h)}finally{i._dirtyElements=u,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=g,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ye(this),this.getEditorState().read(e,{editor:this})}update(e,t){he(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),he(this,()=>{const i=O(),o=G();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Te(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,qt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Fn.version="0.17.1+prod.esm";const Lc="";function Hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xl=Hl(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Go=P.createContext(null);function ea(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function et(){const n=P.useContext(Go);return n==null&&Xl(8),n}const Ho=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ta=Ho?P.useLayoutEffect:P.useEffect,Wn={tag:"history-merge"};function na({initialConfig:n,children:e}){const t=P.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=ea(null,r),u=Gl({editable:n.editable,html:a,namespace:i,nodes:o,onError:f=>s(f,u),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const g=G();if(g.isEmpty()){const h=we();g.append(h);const m=Ho?document.activeElement:null;(O()!==null||m!==null&&m===f.getRootElement())&&h.select()}},Wn);else if(d!==null)switch(typeof d){case"string":{const g=f.parseEditorState(d);f.setEditorState(g,Wn);break}case"object":f.setEditorState(d,Wn);break;case"function":f.update(()=>{G().isEmpty()&&d(f)},Wn)}}}(u,l),[u,c]},[]);return ta(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),A.jsx(Go.Provider,{value:t,children:e})}function ra({defaultSelection:n}){const[e]=et();return P.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function ia(){return G().getTextContent()}function oa(n,e=!0){if(n)return!1;let t=ia();return e&&(t=t.trim()),t===""}function sa(n){if(!oa(n,!1))return!1;const e=G().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(Y(i))return!1;if(C(i)){if(!Xr(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!j(a))return!1}}}return!0}function Xo(n){return()=>sa(n)}function la(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}la(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}aa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ca=new Map;function ua(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function es(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,o=n.isBackward(),s=r.getNode(),l=i.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,f]=Kr(n),d=s.is(l),g=e.is(o?l:s),h=e.is(o?s:l);let m,_=0;return d?(_=u>f?f:u,m=u>f?u:f):g?(_=o?f:u,m=void 0):h&&(_=0,m=o?u:f),e.__text=e.__text.slice(_,m),e}}return e}function da(n){const e=n.getStyle(),t=ua(e);ca.set(e,t)}function ts(n,e){const t=Pt(n.focus,e);return Y(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function fa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ga(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ns(n,e,t){const r=ga(n);fa(n,e,t?!r:r,"character")}function ha(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pa=ha(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const rs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_a=rs&&"documentMode"in document?document.documentMode:null;!(!rs||!("InputEvent"in window)||_a)&&"getTargetRanges"in new window.InputEvent("input");function _t(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function ma(n){const e=ei(n,t=>C(t)&&!t.isInline());return C(e)||pa(4,n.__key),e}const ei=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function tt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const is=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function ya({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:f,className:d,id:g,role:h="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":x,...y},b){const[T,S]=P.useState(n.isEditable()),E=P.useCallback(M=>{M&&M.ownerDocument&&M.ownerDocument.defaultView?n.setRootElement(M):n.setRootElement(null)},[n]),N=P.useMemo(()=>function(...M){return R=>{M.forEach(B=>{typeof B=="function"?B(R):B!=null&&(B.current=R)})}}(b,E),[E,b]);return is(()=>(S(n.isEditable()),n.registerEditableListener(M=>{S(M)})),[n]),A.jsx("div",{...y,"aria-activedescendant":T?e:void 0,"aria-autocomplete":T?t:"none","aria-controls":T?r:void 0,"aria-describedby":i,"aria-expanded":T&&h==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":T?c:void 0,"aria-readonly":!T||void 0,"aria-required":u,autoCapitalize:f,className:d,contentEditable:T,"data-testid":x,id:g,ref:N,role:T?h:void 0,spellCheck:m,style:_,tabIndex:v})}const xa=P.forwardRef(ya);function os(n){return n.getEditorState().read(Xo(n.isComposing()))}const va=P.forwardRef(Ca);function Ca(n,e){const{placeholder:t,...r}=n,[i]=et();return A.jsxs(A.Fragment,{children:[A.jsx(xa,{editor:i,...r,ref:e}),t!=null&&A.jsx(Sa,{editor:i,content:t})]})}function Sa({content:n,editor:e}){const t=function(s){const[l,a]=P.useState(()=>os(s));return is(()=>{function c(){const u=os(s);a(u)}return c(),_t(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=P.useState(e.isEditable());if(P.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:A.jsx("div",{"aria-hidden":!0,children:o})}const Bn=0,ti=1,ni=2,Ce=0,Ta=1,ss=2,Na=3,ba=4;function wa(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return Ce;const o=e._selection,s=n._selection;if(i)return Ta;if(!(k(o)&&k(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(v,x,y){const b=v._nodeMap,T=[];for(const S of x){const E=b.get(S);E!==void 0&&T.push(E)}for(const[S,E]of y){if(!E)continue;const N=b.get(S);N===void 0||oe(N)||T.push(N)}return T}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const v=e._nodeMap,x=v.get(o.anchor.key),y=v.get(s.anchor.key);return x&&y&&!n._nodeMap.has(x.__key)&&j(x)&&x.__text.length===1&&o.anchor.offset===1?ss:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!j(c)||!j(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,f=a.__text;if(u===f)return Ce;const d=o.anchor,g=s.anchor;if(d.key!==g.key||d.type!=="text")return Ce;const h=d.offset,m=g.offset,_=f.length-u.length;return _===1&&m===h-1?ss:_===-1&&m===h+1?Na:_===-1&&m===h?ba:Ce}function Ma(n,e){let t=Date.now(),r=Ce;return(i,o,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=Ce,t=u,ni;const f=wa(i,o,l,a,n.isComposing()),d=(()=>{const g=s===null||s.editor===n,h=c.has("history-push");if(!h&&g&&c.has("history-merge"))return Bn;if(i===null)return ti;const m=o._selection;return l.size>0||a.size>0?h===!1&&f!==Ce&&f===r&&u<t+e&&g||l.size===1&&function(_,v,x){const y=v._nodeMap.get(_),b=x._nodeMap.get(_),T=v._selection,S=x._selection;return!(k(T)&&k(S)&&T.anchor.type==="element"&&T.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!j(y)||!j(b)||y.__parent!==b.__parent)&&JSON.stringify(v.read(()=>y.exportJSON()))===JSON.stringify(x.read(()=>b.exportJSON()))}(Array.from(l)[0],i,o)?Bn:ti:m!==null?Bn:ni})();return t=u,r=f,d}}function ls(n){n.undoStack=[],n.redoStack=[],n.current=null}function Ea(n,e,t){const r=Ma(n,t);return _t(n.registerCommand(on,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),o.dispatchCommand(Et,!0)),a.length===0&&o.dispatchCommand(kt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),n.registerCommand(sn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),o.dispatchCommand(kt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Et,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),n.registerCommand(Zs,()=>(ls(e),!1),$),n.registerCommand(qs,()=>(ls(e),n.dispatchCommand(Et,!1),n.dispatchCommand(kt,!1),!0),$),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,f=e.redoStack,d=e.undoStack,g=u===null?null:u.editorState;if(u!==null&&o===g)return;const h=r(s,o,u,l,a,c);if(h===ti)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Et,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(kt,!0));else if(h===ni)return;e.current={editor:n,editorState:o}}))}function ka(){return{current:null,redoStack:[],undoStack:[]}}function La({delay:n,externalHistoryState:e}){const[t]=et();return function(r,i,o=1e3){const s=P.useMemo(()=>i||ka(),[i]);P.useEffect(()=>Ea(r,s,o),[o,r,s])}(t,e,n),null}const ja=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Ia(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Da(){return function(n){const[e]=et(),t=P.useMemo(()=>n(e),[e,n]),r=P.useRef(t.initialValueFn()),[i,o]=P.useState(r.current);return ja(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,o(a)),l(c=>{r.current=c,o(c)})},[t,n]),i}(Ia)}function Oa(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const o=r.data;if(typeof o=="string"){let s;try{s=JSON.parse(o)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,f,d,g,h]=a;n.update(()=>{const m=O();if(k(m)){const _=m.anchor;let v=_.getNode(),x=0,y=0;if(j(v)&&c>=0&&u>=0&&(x=c,y=c+u,m.setTextNodeRange(v,x,v,y)),x===y&&f===""||(m.insertRawText(f),v=_.getNode()),j(v)){x=d,y=d+g;const b=v.getTextContentSize();x=x>b?b:x,y=y>b?b:y,m.setTextNodeRange(v,x,v,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Aa(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let o=0;o<t.length;o++){const s=t[o];if(!cs.has(s.nodeName)){const l=us(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof Hr&&s.insertAfter(Xe());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Pa(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=G().getChildren();for(let i=0;i<r.length;i++)as(n,r[i],t,e);return t.innerHTML}function as(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=C(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let g=Mr(e);g=j(g)&&r!==null?es(r,g):g,s=g}const l=C(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let g=0;g<l.length;g++){const h=l[g],m=as(n,h,d,r);!i&&C(e)&&m&&e.extractWithChild(h,r,"html")&&(i=!0)}if(i&&!o){if(Nr(u)&&u.append(d),t.append(u),f){const g=f.call(s,u);g&&u.replaceWith(g)}}else t.append(d);return i}const cs=new Set(["STYLE","SCRIPT"]);function us(n,e,t,r,i=new Map,o){let s=[];if(cs.has(n.nodeName))return s;let l=null;const a=function(h,m){const{nodeName:_}=h,v=m._htmlConversions.get(_.toLowerCase());let x=null;if(v!==void 0)for(const y of v){const b=y(h);b!==null&&(x===null||(x.priority||0)<(b.priority||0))&&(x=b)}return x!==null?x.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const h=c.node;if(l=Array.isArray(h)?h[h.length-1]:h,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(h)?h:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const g=(l==null||!ut(l))&&(l!=null&&Qr(l)||r);for(let h=0;h<f.length;h++)d.push(...us(f[h],e,t,g,new Map(i),l));return u!=null&&(d=u(d)),Tn(n)&&(d=za(n,d,g?()=>{const h=new Hr;return t.push(h),h}:we)),l==null?d.length>0?s=s.concat(d):Tn(n)&&function(h){return h.nextSibling==null||h.previousSibling==null?!1:br(h.nextSibling)&&br(h.previousSibling)}(n)&&(s=s.concat(Xe())):C(l)&&l.append(...d),s}function za(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(Qr(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&Qr(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function Ra(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Un=Ra(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Fa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ds=n=>Fa?(n||window).getSelection():null;function Wa(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?"":Pa(n,e)}function Ba(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Ua(n,e))}function fs(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return gs(t,$a(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return gs(t,Aa(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(k(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=O();if(k(a)){const c=s[l];c===`
40
40
  `||c===`\r
41
- `?a.insertParagraph():c===" "?a.insertNodes([Xt()]):a.insertText(c)}}}else e.insertRawText(o)}function ks(n,e,t){n.dispatchCommand(rl,{nodes:e,selection:t})||t.insertNodes(e)}function Es(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=$r(t);c=j(c)&&e!==null?fs(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Gn(58,f.name),C(c)){const d=u.children;Array.isArray(d)||Gn(59,f.name)}return u}(s);if(j(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],f=Es(n,e,u,a.children);!i&&C(t)&&f&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function nc(n,e){const t=[],r=Q().getChildren();for(let i=0;i<r.length;i++)Es(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function rc(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=ua(r);j(i)&&wa(i),e.push(i)}return e}let bt=null;async function Ns(n,e,t){if(bt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(Ps(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=Ss(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(mn,f=>(it(f,ClipboardEvent)&&(u(),bt!==null&&(window.clearTimeout(bt),bt=null),a(Ps(n,f,t))),!0),ha);bt=window.setTimeout(()=>{u(),bt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function Ps(n,e,t){if(t===void 0){const i=Ss(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!Lt(n,o,s))return!1;const l=M();if(l===null)return!1;t=oc(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(sc(r,t),!0)}const ic=[["text/html",ec],["application/x-lexical-editor",tc]];function oc(n=M()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ul();for(const[r,i]of ic){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function sc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Os(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Ct=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,lc=Ct&&"documentMode"in document?document.documentMode:null,ac=!(!Ct||!("InputEvent"in window)||lc)&&"getTargetRanges"in new window.InputEvent("input"),cc=Ct&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),uc=Ct&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,dc=Ct&&/^(?=.*Chrome).*/i.test(navigator.userAgent),fc=Ct&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!dc,Ds=nl();function Xn(n){let e=null;if(it(n,DragEvent)?e=n.dataTransfer:it(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function js(n){const e=M();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=Hn(o,c=>C(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function Qn(n){const e=Ze(n);return U(e)}function hc(n){return vt(n.registerCommand(Ei,e=>{const t=M();return!!Ce(t)&&(t.clear(),!0)},0),n.registerCommand(Ge,e=>{const t=M();return!!O(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Pt,e=>{const t=M();return!!O(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(Ot,e=>{const t=M();return!!O(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(ut,e=>{const t=M();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Ts(r,t,n);else if(O(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},K),n.registerCommand(cr,()=>{const e=M();return!!O(e)&&(e.removeText(),!0)},K),n.registerCommand(de,e=>{const t=M();return!!O(t)&&(t.formatText(e),!0)},K),n.registerCommand(_e,e=>{const t=M();if(!O(t)&&!Ce(t))return!1;const r=t.getNodes();for(const i of r){const o=Hn(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},K),n.registerCommand(ct,e=>{const t=M();return!!O(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(fn,()=>{const e=M();return!!O(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(cl,()=>(la([Xt()]),!0),K),n.registerCommand(Ii,()=>js(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(ur,()=>js(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(Oi,e=>{const t=M();if(Ce(t)&&!Qn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(O(t)){const r=Rt(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(Di,e=>{const t=M();if(Ce(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(O(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===Q().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Rt(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(Pi,e=>{const t=M();if(Ce(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!O(t))return!1;if(gs(t,!0)){const r=e.shiftKey;return e.preventDefault(),ms(t,r,!0),!0}return!1},K),n.registerCommand(Ni,e=>{const t=M();if(Ce(t)&&!Qn(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!gs(t,!1)&&(e.preventDefault(),ms(t,r,!1),!0)},K),n.registerCommand(ji,e=>{if(Qn(e.target))return!1;const t=M();if(!O(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ja(i).getIndent()>0?n.dispatchCommand(ur,void 0):n.dispatchCommand(Ge,!0)},K),n.registerCommand(Li,e=>{if(Qn(e.target))return!1;const t=M();return!!O(t)&&(e.preventDefault(),n.dispatchCommand(Ge,!1))},K),n.registerCommand(pn,e=>{const t=M();if(!O(t))return!1;if(e!==null){if((uc||cc||fc)&&ac)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ct,!1)}return n.dispatchCommand(fn,void 0)},K),n.registerCommand(Ai,()=>{const e=M();return!!O(e)&&(n.blur(),!0)},K),n.registerCommand(Fi,e=>{const[,t]=Xn(e);if(t.length>0){const i=Os(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=Ze(s);if(l!==null){const a=oa();if(j(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Gi(a);Se(c)}n.dispatchCommand(Ds,t)}return e.preventDefault(),!0}const r=M();return!!O(r)},K),n.registerCommand(Mi,e=>{const[t]=Xn(e),r=M();return!(t&&!O(r))},K),n.registerCommand($i,e=>{const[t]=Xn(e),r=M();if(t&&!O(r))return!1;const i=Os(e.clientX,e.clientY);if(i!==null){const o=Ze(i.node);U(o)&&e.preventDefault()}return!0},K),n.registerCommand(fr,()=>(Wl(),!0),K),n.registerCommand(mn,e=>(Ns(n,it(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(dr,e=>(async function(t,r){await Ns(r,it(t,ClipboardEvent)?t:null),r.update(()=>{const i=M();O(i)?i.removeText():Ce(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),K),n.registerCommand(ar,e=>{const[,t,r]=Xn(e);return t.length>0&&!r?(n.dispatchCommand(Ds,t),!0):Tr(e.target)?!1:M()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=M(),l=it(i,InputEvent)||it(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&Ts(l,s,o)},{tag:"paste"})}(e,n),!0)},K))}const gi=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function As(n){return n.getEditorState().read(vs(n.isComposing()))}function gc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=rt(),i=function(o,s){const[l,a]=D.useState(()=>o.getDecorators());return gi(()=>o.registerDecoratorListener(c=>{un.flushSync(()=>{a(c)})}),[o]),D.useEffect(()=>{a(o.getDecorators())},[o]),D.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],h=b.jsx(s,{onError:m=>o._onError(m),children:b.jsx(D.Suspense,{fallback:null,children:l[d]})}),g=o.getElementByKey(d);g!==null&&c.push(un.createPortal(h,g,d))}return c},[s,l,o])}(r,t);return function(o){gi(()=>vt(hc(o),Ha(o)),[o])}(r),b.jsxs(b.Fragment,{children:[n,b.jsx(pc,{content:e}),i]})}function pc({content:n}){const[e]=rt(),t=function(i){const[o,s]=D.useState(()=>As(i));return gi(()=>{function l(){const a=As(i);s(a)}return l(),vt(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Ka();return t?typeof n=="function"?n(r):n:null}function pi(n,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},pi(n,e)}var Ls={error:null},mc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Ls,o.resetErrorBoundary=function(){for(var c,u=arguments.length,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];o.props.onReset==null||(c=o.props).onReset.apply(c,f),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,pi(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Ls)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(h,g){return!Object.is(h,u[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,d),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(lt.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return lt.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(lt.Component);function _c({children:n,onError:e}){return b.jsx(mc,{fallback:b.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}var Pe=(n=>(n.normal="1px",n.narrow="48px",n.moderate="96px 72px",n.wide="96px 192px",n))(Pe||{});const yc=D.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),Zn=()=>D.useContext(yc),xc=new Set(["http:","https:","mailto:","sms:","tel:"]);class er extends tn{static getType(){return"link"}static clone(e){return new er(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=t;this.__url=e,this.__target=i,this.__rel=o,this.__title=s}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),Da(t,e.theme.link),t}updateDOM(e,t,r){if(t instanceof HTMLAnchorElement){const i=this.__url,o=this.__target,s=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),s!==e.__rel&&(s?t.rel=s:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:vc,priority:1})}}static importJSON(e){const t=mi(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!xc.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const r=mi(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!O(t))return!1;const i=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function vc(n){let e=null;if(Kl(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=mi(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function mi(n,e){return Wt(new er(n,e))}function bc(n){return n instanceof er}function Cc(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?hs(t)?r:i:hs(e)?r:i}const uu="";function wc({onClose:n,children:e,title:t,closeOnClickOutside:r}){const i=D.useRef(null);return D.useEffect(()=>{i.current!==null&&i.current.focus()},[]),D.useEffect(()=>{let o=null;const s=c=>{c.key==="Escape"&&n()},l=c=>{const u=c.target;i.current!==null&&!i.current.contains(u)&&r&&n()},a=i.current;return a!==null&&(o=a.parentElement,o!==null&&o.addEventListener("click",l)),window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s),o!==null&&(o==null||o.removeEventListener("click",l))}},[r,n]),b.jsx("div",{className:"Modal__overlay",role:"dialog",children:b.jsxs("div",{className:"Modal__modal",tabIndex:-1,ref:i,children:[b.jsx("h2",{className:"Modal__title",children:t}),b.jsx("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:n,children:"X"}),b.jsx("div",{className:"Modal__content",children:e})]})})}function Sc({onClose:n,children:e,title:t,closeOnClickOutside:r=!1}){return un.createPortal(b.jsx(wc,{onClose:n,title:t,closeOnClickOutside:r,children:e}),document.body)}function Tc(){const[n,e]=D.useState(null),t=D.useCallback(()=>{e(null)},[]),r=D.useMemo(()=>{if(n===null)return null;const{title:o,content:s,closeOnClickOutside:l}=n;return b.jsx(Sc,{onClose:t,title:o,closeOnClickOutside:l,children:s})},[n,t]),i=D.useCallback((o,s,l=!1)=>{e({closeOnClickOutside:l,content:s(t),title:o})},[t]);return[r,i]}const Is=lt.createContext(null),Fs=4;function pe({children:n,className:e,onClick:t,title:r}){const i=D.useRef(null),o=lt.useContext(Is);if(o===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=o;return D.useEffect(()=>{i&&i.current&&s(i)},[i,s]),b.jsx("button",{className:e,onClick:t,ref:i,title:r,type:"button",children:n})}function kc({children:n,dropDownRef:e,onClose:t}){const[r,i]=D.useState(),[o,s]=D.useState(),l=D.useCallback(u=>{i(f=>f?[...f,u]:[u])},[i]),a=u=>{if(!r)return;const f=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(f)&&u.preventDefault(),f==="Escape"||f==="Tab"?t():f==="ArrowUp"?s(d=>{if(!d)return r[0];const h=r.indexOf(d)-1;return r[h===-1?r.length-1:h]}):f==="ArrowDown"&&s(d=>d?r[r.indexOf(d)+1]:r[0])},c=D.useMemo(()=>({registerItem:l}),[l]);return D.useEffect(()=>{r&&!o&&s(r[0]),o&&o.current&&o.current.focus()},[r,o]),b.jsx(Is.Provider,{value:c,children:b.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function Ms({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:i,children:o,stopCloseOnClickSelf:s}){const l=D.useRef(null),a=D.useRef(null),[c,u]=D.useState(!1),f=()=>{u(!1),a&&a.current&&a.current.focus()};return D.useEffect(()=>{const d=a.current,h=l.current;if(c&&d!==null&&h!==null){const{top:g,left:m}=d.getBoundingClientRect();h.style.top=`${g+d.offsetHeight+Fs}px`,h.style.left=`${Math.min(m,window.innerWidth-h.offsetWidth-20)}px`}},[l,a,c]),D.useEffect(()=>{const d=a.current;if(d!==null&&c){const h=g=>{const m=g.target;s&&l.current&&l.current.contains(m)||d.contains(m)||u(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[l,a,c,s]),D.useEffect(()=>{const d=()=>{if(c){const h=a.current,g=l.current;if(h!==null&&g!==null){const{top:m}=h.getBoundingClientRect(),_=m+h.offsetHeight+Fs;_!==g.getBoundingClientRect().top&&(g.style.top=`${_}px`)}}};return document.addEventListener("scroll",d),()=>{document.removeEventListener("scroll",d)}},[a,l,c]),b.jsxs(b.Fragment,{children:[b.jsxs("button",{type:"button",disabled:n,"aria-label":t||e,className:r,onClick:()=>u(!c),ref:a,children:[i&&b.jsx("span",{className:i}),e&&b.jsx("span",{className:"text dropdown-button-text",children:e}),b.jsx("i",{className:"chevron-down"})]}),c&&un.createPortal(b.jsx(kc,{dropDownRef:l,onClose:f,children:o}),document.body)]})}const du="";function Ec(...n){return n.filter(Boolean).join(" ")}function Nc({"data-test-id":n,children:e,className:t,onClick:r,disabled:i,small:o,title:s}){return b.jsx("button",{disabled:i,className:Ec("Button__root",i&&"Button__disabled",o&&"Button__small",t),onClick:r,title:s,"aria-label":s,...n&&{"data-test-id":n},children:e})}const fu="";function Pc({"data-test-id":n,children:e}){return b.jsx("div",{className:"DialogActions","data-test-id":n,children:e})}const hu="";function tr({label:n,value:e,onChange:t,placeholder:r="","data-test-id":i,type:o="text",name:s=""}){return b.jsxs("div",{className:"Input__wrapper",children:[b.jsx("label",{className:"Input__label",children:n}),b.jsx("input",{type:o,className:"Input__input",placeholder:r,value:e,name:s,onChange:l=>{t(l.target.value,l.target.name)},"data-test-id":i})]})}const Oc=({onClose:n})=>{const{margin:e,updatePageMarginValue:t,updateCustomMargin:r}=Zn(),[i,o]=lt.useState(""),s=()=>{const{top:f,right:d,bottom:h,left:g}=e,m=(816-100)/2,_=(1156-25)/2,v=[];if(+f*96>_&&v.push(`*Top margin is too large, maximum allowed is ${(_/96).toFixed(2)} inches.`),+d*96>m&&v.push(`*Right margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),+h*96>_&&v.push(`*Bottom margin is too large, maximum allowed is ${(_/96).toFixed(2)} inches.`),+g*96>m&&v.push(`*Left margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),v!=null&&v.length){o(v.join(`
42
- `));return}else{const y=`${+f*96}px ${+d*96}px ${+h*96}px ${+g*96}px`;t(y),n()}};return b.jsxs(b.Fragment,{children:[b.jsx(tr,{label:"Top",onChange:r,value:e.top,"data-test-id":"custom-margin-top",type:"number",name:"top"}),b.jsx(tr,{label:"Right",onChange:r,value:e.right,"data-test-id":"table-modal-right",type:"number",name:"right"}),b.jsx(tr,{label:"Bottom",onChange:r,value:e.bottom,"data-test-id":"table-modal-bottom",type:"number",name:"bottom"}),b.jsx(tr,{label:"Left",onChange:r,value:e.left,"data-test-id":"table-modal-left",type:"number",name:"left"}),b.jsx("div",{style:{color:"red",whiteSpace:"pre-line"},children:i}),b.jsx(Pc,{"data-test-id":"table-model-confirm-insert",children:b.jsx(Nc,{onClick:s,children:"Confirm"})})]})},nr=n=>n?"active dropdown-item-active":"",Dc=({isEditable:n})=>{const{pageMarginValue:e,updatePageMarginValue:t}=Zn(),[r,i]=Tc();return b.jsxs(b.Fragment,{children:[b.jsxs(Ms,{disabled:!n,buttonClassName:"toolbar-item spaced",buttonLabel:"Page Margin",buttonAriaLabel:"Page margin",buttonIconClassName:" plus",children:[b.jsx(pe,{onClick:()=>t(Pe.normal),className:"item "+nr(e===Pe.normal),children:b.jsx("span",{className:"text",children:"Normal"})}),b.jsx(pe,{onClick:()=>t(Pe.narrow),className:"item "+nr(e===Pe.narrow),children:b.jsx("span",{className:"text",children:"Narrow"})}),b.jsx(pe,{onClick:()=>t(Pe.moderate),className:"item "+nr(e===Pe.moderate),children:b.jsx("span",{className:"text",children:"Moderate"})}),b.jsx(pe,{onClick:()=>t(Pe.wide),className:"item "+nr(e===Pe.wide),children:b.jsx("span",{className:"text",children:"Wide"})}),b.jsx(pe,{onClick:()=>{i("Custom Margin",o=>b.jsx(Oc,{onClose:o}))},className:"item ",children:b.jsx("span",{className:"text",children:"Custom"})})]}),r]})};function jc(){return b.jsx("div",{className:"divider"})}const rn={center:{icon:"center-align",iconRTL:"center-align",name:"Center Align"},end:{icon:"right-align",iconRTL:"left-align",name:"End Align"},justify:{icon:"justify-align",iconRTL:"justify-align",name:"Justify Align"},left:{icon:"left-align",iconRTL:"left-align",name:"Left Align"},right:{icon:"right-align",iconRTL:"right-align",name:"Right Align"},start:{icon:"left-align",iconRTL:"right-align",name:"Start Align"}},Ac=({editor:n,value:e,isRTL:t,disabled:r=!1})=>{const i=rn[e||"left"];return b.jsxs(Ms,{disabled:r,buttonLabel:i.name,buttonIconClassName:`icon ${t?i.iconRTL:i.icon}`,buttonClassName:"toolbar-item spaced alignment",buttonAriaLabel:"Formatting options for text alignment",children:[b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"left")},className:"item",children:[b.jsx("i",{className:"icon left-align"}),b.jsx("span",{className:"text",children:"Left Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"center")},className:"item",children:[b.jsx("i",{className:"icon center-align"}),b.jsx("span",{className:"text",children:"Center Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"right")},className:"item",children:[b.jsx("i",{className:"icon right-align"}),b.jsx("span",{className:"text",children:"Right Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"justify")},className:"item",children:[b.jsx("i",{className:"icon justify-align"}),b.jsx("span",{className:"text",children:"Justify Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"start")},className:"item",children:[b.jsx("i",{className:`icon ${t?rn.start.iconRTL:rn.start.icon}`}),b.jsx("span",{className:"text",children:"Start Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"end")},className:"item",children:[b.jsx("i",{className:`icon ${t?rn.end.iconRTL:rn.end.icon}`}),b.jsx("span",{className:"text",children:"End Align"})]}),b.jsx(jc,{}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(ur,void 0)},className:"item",children:[b.jsx("i",{className:"icon "+(t?"indent":"outdent")}),b.jsx("span",{className:"text",children:"Outdent"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(Ii,void 0)},className:"item",children:[b.jsx("i",{className:"icon "+(t?"outdent":"indent")}),b.jsx("span",{className:"text",children:"Indent"})]})]})},_i=1;function on(){return b.jsx("div",{className:"divider"})}function Lc(){const{updatePageMarginValue:n}=Zn(),[e]=rt(),t=D.useRef(null),[r,i]=D.useState(!1),[o,s]=D.useState(!1),[l,a]=D.useState(!1),[c,u]=D.useState(!1),[f,d]=D.useState(!1),[h,g]=D.useState(!1),[m,_]=D.useState(!1),[v,y]=D.useState(!1),[x,k]=D.useState("14px"),[S,w]=D.useState("left"),[P,T]=D.useState(!1),N=D.useCallback(()=>{const F=M();if(O(F)){const R=Cc(F),H=R.getParent();a(F.hasFormat("bold")),u(F.hasFormat("italic")),d(F.hasFormat("underline")),g(F.hasFormat("strikethrough")),_(F.hasFormat("subscript")),y(F.hasFormat("superscript")),T(ps(F)),k(ka(F,"font-size","14px"));let V;bc(H)&&(V=Hn(R,W=>C(W)&&!W.isInline())),w(C(V)?V.getFormatType():C(R)?R.getFormatType():(H==null?void 0:H.getFormatType())||"left"),n(Pe)}},[]);return D.useEffect(()=>vt(e.registerUpdateListener(({editorState:F})=>{F.read(()=>{N()})}),e.registerCommand(dn,(F,R)=>(N(),!1),_i),e.registerCommand(jt,F=>(i(F),!1),_i),e.registerCommand(Dt,F=>(s(F),!1),_i)),[e,N]),b.jsxs("div",{className:"toolbar",ref:t,children:[b.jsx("button",{disabled:!r,onClick:()=>{e.dispatchCommand(hn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:b.jsx("i",{className:"format undo"})}),b.jsx("button",{disabled:!o,onClick:()=>{e.dispatchCommand(gn,void 0)},className:"toolbar-item","aria-label":"Redo",children:b.jsx("i",{className:"format redo"})}),b.jsx(on,{}),b.jsx(on,{}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(l?"active":""),"aria-label":"Format Bold",children:b.jsx("i",{className:"format bold"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Italics",children:b.jsx("i",{className:"format italic"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Underline",children:b.jsx("i",{className:"format underline"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Strikethrough",children:b.jsx("i",{className:"format strikethrough"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(m?"active":""),title:"Subscript","aria-label":"Format text with a subscript",type:"button",children:b.jsx("i",{className:"format subscript"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(v?"active":""),title:"Superscript","aria-label":"Format text with a superscript",type:"button",children:b.jsx("i",{className:"format superscript"})}),b.jsx(on,{}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:b.jsx("i",{className:"format left-align"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:b.jsx("i",{className:"format center-align"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:b.jsx("i",{className:"format right-align"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:b.jsx("i",{className:"format justify-align"})})," ",b.jsx(on,{}),b.jsx(Dc,{isEditable:!0}),b.jsx(on,{}),b.jsx(Ac,{value:S,editor:e,isRTL:P})]})}const gu="",$s=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Ic({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:f,className:d,id:h,role:g="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":y,...x},k){const[S,w]=D.useState(n.isEditable()),P=D.useCallback(N=>{N&&N.ownerDocument&&N.ownerDocument.defaultView?n.setRootElement(N):n.setRootElement(null)},[n]),T=D.useMemo(()=>function(...N){return F=>{N.forEach(R=>{typeof R=="function"?R(F):R!=null&&(R.current=F)})}}(k,P),[P,k]);return $s(()=>(w(n.isEditable()),n.registerEditableListener(N=>{w(N)})),[n]),b.jsx("div",{...x,"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?r:void 0,"aria-describedby":i,"aria-expanded":S&&g==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":S?c:void 0,"aria-readonly":!S||void 0,"aria-required":u,autoCapitalize:f,className:d,contentEditable:S,"data-testid":y,id:h,ref:T,role:S?g:void 0,spellCheck:m,style:_,tabIndex:v})}const Fc=D.forwardRef(Ic);function Rs(n){return n.getEditorState().read(vs(n.isComposing()))}const Mc=D.forwardRef($c);function $c(n,e){const{placeholder:t,...r}=n,[i]=rt();return b.jsxs(b.Fragment,{children:[b.jsx(Fc,{editor:i,...r,ref:e}),t!=null&&b.jsx(Rc,{editor:i,content:t})]})}function Rc({content:n,editor:e}){const t=function(s){const[l,a]=D.useState(()=>Rs(s));return $s(()=>{function c(){const u=Rs(s);a(u)}return c(),vt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=D.useState(e.isEditable());if(D.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:b.jsx("div",{"aria-hidden":!0,children:o})}function Wc({className:n,style:e}){return b.jsx(Mc,{className:n||"ContentEditable__root",style:e})}const Bc={};function zc(n){console.error(n)}function Kc({isCollab:n,ckey:e}){const{pageMarginValue:t}=Zn(),r={namespace:"MyEditor",theme:Bc,onError:zc};return b.jsx(xa,{initialConfig:r,children:b.jsxs("div",{className:"editor-shell",children:[b.jsx(Lc,{}),b.jsx("div",{className:"editor-container",children:b.jsxs("div",{className:"editor-inner",children:[b.jsx(gc,{contentEditable:b.jsx("div",{className:"editor-scroller",children:b.jsx("div",{className:"editor",children:b.jsx(Wc,{style:{margin:t}})})}),ErrorBoundary:_c}),b.jsx(Wa,{}),b.jsx(va,{})]})})]})})}Re.Editor=Kc,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});
41
+ `?a.insertParagraph():c===" "?a.insertNodes([Vt()]):a.insertText(c)}}}else e.insertRawText(o)}function gs(n,e,t){n.dispatchCommand(Ws,{nodes:e,selection:t})||t.insertNodes(e)}function hs(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Mr(t);c=j(c)&&e!==null?es(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Un(58,f.name),C(c)){const d=u.children;Array.isArray(d)||Un(59,f.name)}return u}(s);if(j(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],f=hs(n,e,u,a.children);!i&&C(t)&&f&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function Ua(n,e){const t=[],r=G().getChildren();for(let i=0;i<r.length;i++)hs(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function $a(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Vl(r);j(i)&&da(i),e.push(i)}return e}let mt=null;async function ps(n,e,t){if(mt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(_s(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=ds(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(an,f=>(tt(f,ClipboardEvent)&&(u(),mt!==null&&(window.clearTimeout(mt),mt=null),a(_s(n,f,t))),!0),ql);mt=window.setTimeout(()=>{u(),mt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function _s(n,e,t){if(t===void 0){const i=ds(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!jt(n,o,s))return!1;const l=O();if(l===null)return!1;t=Ka(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Qa(r,t),!0)}const Ya=[["text/html",Wa],["application/x-lexical-editor",Ba]];function Ka(n=O()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ml();for(const[r,i]of Ya){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function Qa(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function ms(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Va=yt&&"documentMode"in document?document.documentMode:null,Ja=!(!yt||!("InputEvent"in window)||Va)&&"getTargetRanges"in new window.InputEvent("input"),Za=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qa=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ga=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ha=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ga,ys=Fs();function $n(n){let e=null;if(tt(n,DragEvent)?e=n.dataTransfer:tt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function xs(n){const e=O();if(!k(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=ei(o,c=>C(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function Yn(n){const e=qe(n);return Y(e)}function Xa(n){return _t(n.registerCommand(_i,e=>{const t=O();return!!ve(t)&&(t.clear(),!0)},0),n.registerCommand(Ve,e=>{const t=O();return!!k(t)&&(t.deleteCharacter(e),!0)},$),n.registerCommand(bt,e=>{const t=O();return!!k(t)&&(t.deleteWord(e),!0)},$),n.registerCommand(wt,e=>{const t=O();return!!k(t)&&(t.deleteLine(e),!0)},$),n.registerCommand(st,e=>{const t=O();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)fs(r,t,n);else if(k(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},$),n.registerCommand(Hn,()=>{const e=O();return!!k(e)&&(e.removeText(),!0)},$),n.registerCommand(de,e=>{const t=O();return!!k(t)&&(t.formatText(e),!0)},$),n.registerCommand(Mt,e=>{const t=O();if(!k(t)&&!ve(t))return!1;const r=t.getNodes();for(const i of r){const o=ei(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},$),n.registerCommand(ot,e=>{const t=O();return!!k(t)&&(t.insertLineBreak(e),!0)},$),n.registerCommand(rn,()=>{const e=O();return!!k(e)&&(e.insertParagraph(),!0)},$),n.registerCommand(Qs,()=>(Yl([Vt()]),!0),$),n.registerCommand(Vs,()=>xs(e=>{const t=e.getIndent();e.setIndent(t+1)}),$),n.registerCommand(Ni,()=>xs(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),$),n.registerCommand(xi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(k(t)){const r=Pt(t.focus,!0);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},$),n.registerCommand(vi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(k(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Pt(t.focus,!1);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},$),n.registerCommand(yi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!k(t))return!1;if(ts(t,!0)){const r=e.shiftKey;return e.preventDefault(),ns(t,r,!0),!0}return!1},$),n.registerCommand(mi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!k(t))return!1;const r=e.shiftKey;return!!ts(t,!1)&&(e.preventDefault(),ns(t,r,!1),!0)},$),n.registerCommand(Ci,e=>{if(Yn(e.target))return!1;const t=O();if(!k(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ma(i).getIndent()>0?n.dispatchCommand(Ni,void 0):n.dispatchCommand(Ve,!0)},$),n.registerCommand(Ti,e=>{if(Yn(e.target))return!1;const t=O();return!!k(t)&&(e.preventDefault(),n.dispatchCommand(Ve,!1))},$),n.registerCommand(ln,e=>{const t=O();if(!k(t))return!1;if(e!==null){if((qa||Za||Ha)&&Ja)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ot,!1)}return n.dispatchCommand(rn,void 0)},$),n.registerCommand(Si,()=>{const e=O();return!!k(e)&&(n.blur(),!0)},$),n.registerCommand(bi,e=>{const[,t]=$n(e);if(t.length>0){const i=ms(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=qe(s);if(l!==null){const a=Ul();if(j(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Fi(a);Se(c)}n.dispatchCommand(ys,t)}return e.preventDefault(),!0}const r=O();return!!k(r)},$),n.registerCommand(wi,e=>{const[t]=$n(e),r=O();return!(t&&!k(r))},$),n.registerCommand(Mi,e=>{const[t]=$n(e),r=O();if(t&&!k(r))return!1;const i=ms(e.clientX,e.clientY);if(i!==null){const o=qe(i.node);Y(o)&&e.preventDefault()}return!0},$),n.registerCommand(er,()=>(Nl(),!0),$),n.registerCommand(an,e=>(ps(n,tt(e,ClipboardEvent)?e:null),!0),$),n.registerCommand(Xn,e=>(async function(t,r){await ps(r,tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=O();k(i)?i.removeText():ve(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),$),n.registerCommand(Gn,e=>{const[,t,r]=$n(e);return t.length>0&&!r?(n.dispatchCommand(ys,t),!0):gr(e.target)?!1:O()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=O(),l=tt(i,InputEvent)||tt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&fs(l,s,o)},{tag:"paste"})}(e,n),!0)},$))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function vs(n){return n.getEditorState().read(Xo(n.isComposing()))}function ec({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=et(),i=function(o,s){const[l,a]=P.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(c=>{di.flushSync(()=>{a(c)})}),[o]),P.useEffect(()=>{a(o.getDecorators())},[o]),P.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],g=A.jsx(s,{onError:m=>o._onError(m),children:A.jsx(P.Suspense,{fallback:null,children:l[d]})}),h=o.getElementByKey(d);h!==null&&c.push(di.createPortal(g,h,d))}return c},[s,l,o])}(r,t);return function(o){ri(()=>_t(Xa(o),Oa(o)),[o])}(r),A.jsxs(A.Fragment,{children:[n,A.jsx(tc,{content:e}),i]})}function tc({content:n}){const[e]=et(),t=function(i){const[o,s]=P.useState(()=>vs(i));return ri(()=>{function l(){const a=vs(i);s(a)}return l(),_t(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Da();return t?typeof n=="function"?n(r):n:null}function ii(n,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ii(n,e)}var Cs={error:null},nc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Cs,o.resetErrorBoundary=function(){for(var c,u=arguments.length,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];o.props.onReset==null||(c=o.props).onReset.apply(c,f),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ii(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Cs)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(g,h){return!Object.is(g,u[h])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,d),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(Vn.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Vn.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Vn.Component);function rc({children:n,onError:e}){return A.jsx(nc,{fallback:A.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const ic={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},oc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MTIgNDI2Ljg1Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNzQuMiAxMjUuMyAyNjYuNzQgMGg3Ni42NUwyMTIuODggMTczLjk5bDEzNS45IDE4MC40NUgyNzJsLTk3Ljg0LTEzMS44LTk3LjUyIDEzMS44SDBMMTM1Ljg4IDE3NCA1LjA3IDBoNzcuMDRsOTIuMDkgMTI1LjN6bTMyMi4zOCAzMDEuNTVIMzczLjV2LTI0LjE0bDIuNDMtNi40M2M1LjQ1LTYuMyA2MC4zNC02OS40OCA2MC4zNC02OS42MyAyLjk0LTMuMzggNS40NC02LjM0IDcuNDctOC44NyAyLjI1LTIuNzggNC4zNS01LjUxIDYuMy04LjE3IDEuOTUtMi42NSAzLjY0LTUuMSA1LjA4LTcuMzEgMS40OC0yLjI5IDIuNzctNC40MyAzLjg0LTYuMzkuOTgtMS44MSAxLjg5LTMuNjYgMi42OS01LjUzLjc0LTEuNzMgMS4zNC0zLjQgMS44LTQuOTYuNC0xLjM4LjcyLTIuODMuOTUtNC4zMi4yLTEuMzIuMzEtMi42My4zMS0zLjkxIDAtNC43OS0uNTktOC44Ni0xLjc3LTEyLjIyLTEuMDUtMy0yLjYxLTUuNTUtNC42Ni03LjYzLS45LS44OS0xLjk3LTEuNzMtMy4yMS0yLjQ5di0uMDVjLTEuMjUtLjc3LTIuNjQtMS40Mi00LjEzLTEuOTQtMS43Ny0uNTgtMy43NC0xLjA0LTUuOTItMS4zNi0yLjIyLS4zMy00LjcyLS40OS03LjUtLjQ5LTIuOTcgMC01LjYyLjE5LTcuOTIuNTYtMi4yNy4zNy00LjM3LjkyLTYuMjkgMS42NC0xLjc0LjY2LTMuMzcgMS40OS00Ljg0IDIuNDZoLS4wNGMtMS4zNy45LTIuNjcgMi4wMS0zLjkxIDMuMzFhMjkuMzI4IDI5LjMyOCAwIDAgMC0zLjQ1IDQuNTMgMjguMTQ1IDI4LjE0NSAwIDAgMC0yLjQ3IDUuMWMtLjY3IDEuODktMS4xOSAzLjk1LTEuNTUgNi4xNi0uMzQgMi4xNS0uNTIgNC42Mi0uNTIgNy4zOXYxNS40MmgtMzIuNDRsLTIuNDktOC4zOWMtMS42LTUuNDMtMi4wMi0xMC45Ny0xLjU5LTE2LjM5LjQ2LTUuODEgMS45My0xMS41OSAzLjk0LTE2Ljk4IDEuNS00LjAzIDMuNDMtNy45MiA1Ljc4LTExLjY3di0uMDRjMi4zMS0zLjY4IDUtNy4xNSA4LjA1LTEwLjQgMy4xNi0zLjM4IDYuNjItNi4zNyAxMC4zNi04LjkzIDMuNjctMi41MSA3LjY4LTQuNjQgMTIuMDMtNi4zN2E2Ny4yNiA2Ny4yNiAwIDAgMSAxMy4xNy0zLjczdi0uMDVjNC41Mi0uOCA5LjI1LTEuMjEgMTQuMTgtMS4yMSA0LjM4IDAgOC43NS4zNCAxMy4wNyAxLjAzIDQuMzMuNjkgOC40IDEuNzEgMTIuMTkgMy4wNSAzLjkgMS4zOCA3LjY1IDMuMTggMTEuMjQgNS4zNmguMDVjMy41MSAyLjEzIDYuNzggNC42MyA5Ljc5IDcuNDYgMy4xIDIuOSA1Ljg1IDYuMTQgOC4yMiA5LjY5IDIuNCAzLjU4IDQuMzYgNy4zNyA1Ljg4IDExLjM0IDEuNDYgMy44NiAyLjU4IDguMDIgMy4zMyAxMi40NS43MiA0LjMzIDEuMDkgOC44IDEuMDkgMTMuMzkgMCAzLjExLS4yOCA2LjM5LS44NCA5LjgzLS41MiAzLjIyLTEuMzEgNi41LTIuMzUgOS44LS45NCAzLjA4LTIuMjEgNi4yOC0zLjc0IDkuNTVhOTIuNjQ0IDkyLjY0NCAwIDAgMS01LjEyIDkuNDNsLS4wNS4wOWMtMS45NyAzLjEzLTMuOTEgNi4wOS01LjgyIDguODQtMi4wMiAyLjktNC4yNiA1Ljk4LTYuNyA5LjItMi4xNSAyLjgzLTQuNzEgNi4wOC03LjY3IDkuNzMtMi43NyAzLjQyLTUuNjMgNi44NS04LjU3IDEwLjI2bC0zMC4zMSAzNS40Mkg1MTJ2MzcuNTFoLTE1LjQyeiIvPjwvc3ZnPg==",sc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",oi=1;function Ss(){return A.jsx("div",{className:"divider"})}function lc(){const[n]=et(),e=P.useRef(null),[t,r]=P.useState(!1),[i,o]=P.useState(!1),[s,l]=P.useState(!1),[a,c]=P.useState(!1),[u,f]=P.useState(!1),[d,g]=P.useState(!1),[h,m]=P.useState(!1),[_,v]=P.useState(!1),x=P.useCallback(()=>{const y=O();k(y)&&(l(y.hasFormat("bold")),c(y.hasFormat("italic")),f(y.hasFormat("underline")),g(y.hasFormat("strikethrough")),m(y.hasFormat("subscript")),v(y.hasFormat("superscript")))},[]);return P.useEffect(()=>_t(n.registerUpdateListener(({editorState:y})=>{y.read(()=>{x()})}),n.registerCommand(nn,(y,b)=>(x(),!1),oi),n.registerCommand(kt,y=>(r(y),!1),oi),n.registerCommand(Et,y=>(o(y),!1),oi)),[n,x]),A.jsxs("div",{className:"toolbar",ref:e,children:[A.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(on,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:A.jsx("i",{className:"format undo"})}),A.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(sn,void 0)},className:"toolbar-item","aria-label":"Redo",children:A.jsx("i",{className:"format redo"})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:A.jsx("i",{className:"format bold"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:A.jsx("i",{className:"format italic"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:A.jsx("i",{className:"format underline"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:A.jsx("i",{className:"format strikethrough"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Subscript",children:A.jsx("img",{src:sc,height:16,width:16,style:{marginTop:"1px"}})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format Superscript",children:A.jsx("img",{src:oc,height:16,width:16,style:{marginTop:"5px"}})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:A.jsx("i",{className:"format left-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:A.jsx("i",{className:"format center-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:A.jsx("i",{className:"format right-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:A.jsx("i",{className:"format justify-align"})})," "]})}function ac(){return A.jsx("div",{className:"editor-placeholder",style:{marginLeft:"18px"},children:"Enter some rich text..."})}const cc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ic};function uc(){return A.jsx(na,{initialConfig:cc,children:A.jsxs("div",{className:"editor-container",children:[A.jsx(lc,{}),A.jsxs("div",{className:"editor-inner",children:[A.jsx(ec,{contentEditable:A.jsx(va,{className:"editor-input"}),placeholder:A.jsx(ac,{}),ErrorBoundary:rc}),A.jsx(La,{}),A.jsx(ra,{})]})]})})}Pe.Editor=uc,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
43
42
  //# sourceMappingURL=index.umd.js.map