sykpcomposer 0.0.6 → 0.0.8

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 (98) hide show
  1. package/dist/assets/icons/3-columns.svg +3 -0
  2. package/dist/assets/icons/LICENSE.md +5 -0
  3. package/dist/assets/icons/add-sign.svg +3 -0
  4. package/dist/assets/icons/arrow-clockwise.svg +1 -0
  5. package/dist/assets/icons/arrow-counterclockwise.svg +1 -0
  6. package/dist/assets/icons/bg-color.svg +1 -0
  7. package/dist/assets/icons/camera.svg +1 -0
  8. package/dist/assets/icons/card-checklist.svg +1 -0
  9. package/dist/assets/icons/caret-right-fill.svg +1 -0
  10. package/dist/assets/icons/chat-left-text.svg +1 -0
  11. package/dist/assets/icons/chat-right-dots.svg +1 -0
  12. package/dist/assets/icons/chat-right-text.svg +1 -0
  13. package/dist/assets/icons/chat-right.svg +1 -0
  14. package/dist/assets/icons/chat-square-quote.svg +1 -0
  15. package/dist/assets/icons/chevron-down.svg +1 -0
  16. package/dist/assets/icons/clipboard.svg +1 -0
  17. package/dist/assets/icons/close.svg +1 -0
  18. package/dist/assets/icons/code.svg +1 -0
  19. package/dist/assets/icons/comments.svg +1 -0
  20. package/dist/assets/icons/copy.svg +1 -0
  21. package/dist/assets/icons/diagram-2.svg +1 -0
  22. package/dist/assets/icons/download.svg +1 -0
  23. package/dist/assets/icons/draggable-block-menu.svg +1 -0
  24. package/dist/assets/icons/dropdown-more.svg +1 -0
  25. package/dist/assets/icons/figma.svg +1 -0
  26. package/dist/assets/icons/file-earmark-text.svg +4 -0
  27. package/dist/assets/icons/file-image.svg +1 -0
  28. package/dist/assets/icons/filetype-gif.svg +1 -0
  29. package/dist/assets/icons/font-color.svg +1 -0
  30. package/dist/assets/icons/font-family.svg +1 -0
  31. package/dist/assets/icons/gear.svg +1 -0
  32. package/dist/assets/icons/horizontal-rule.svg +1 -0
  33. package/dist/assets/icons/indent.svg +1 -0
  34. package/dist/assets/icons/journal-code.svg +1 -0
  35. package/dist/assets/icons/journal-text.svg +1 -0
  36. package/dist/assets/icons/justify.svg +1 -0
  37. package/dist/assets/icons/link.svg +1 -0
  38. package/dist/assets/icons/list-ol.svg +1 -0
  39. package/dist/assets/icons/list-ul.svg +1 -0
  40. package/dist/assets/icons/lock-fill.svg +1 -0
  41. package/dist/assets/icons/lock.svg +1 -0
  42. package/dist/assets/icons/markdown.svg +1 -0
  43. package/dist/assets/icons/mic.svg +1 -0
  44. package/dist/assets/icons/minus-sign.svg +3 -0
  45. package/dist/assets/icons/outdent.svg +1 -0
  46. package/dist/assets/icons/paint-bucket.svg +1 -0
  47. package/dist/assets/icons/palette.svg +1 -0
  48. package/dist/assets/icons/pencil-fill.svg +1 -0
  49. package/dist/assets/icons/plug-fill.svg +1 -0
  50. package/dist/assets/icons/plug.svg +1 -0
  51. package/dist/assets/icons/plus-slash-minus.svg +1 -0
  52. package/dist/assets/icons/plus.svg +1 -0
  53. package/dist/assets/icons/prettier-error.svg +1 -0
  54. package/dist/assets/icons/prettier.svg +1 -0
  55. package/dist/assets/icons/scissors.svg +3 -0
  56. package/dist/assets/icons/send.svg +1 -0
  57. package/dist/assets/icons/square-check.svg +1 -0
  58. package/dist/assets/icons/sticky.svg +1 -0
  59. package/dist/assets/icons/success-alt.svg +1 -0
  60. package/dist/assets/icons/success.svg +1 -0
  61. package/dist/assets/icons/table.svg +1 -0
  62. package/dist/assets/icons/text-center.svg +1 -0
  63. package/dist/assets/icons/text-left.svg +1 -0
  64. package/dist/assets/icons/text-paragraph.svg +1 -0
  65. package/dist/assets/icons/text-right.svg +1 -0
  66. package/dist/assets/icons/trash.svg +1 -0
  67. package/dist/assets/icons/trash3.svg +1 -0
  68. package/dist/assets/icons/tweet.svg +1 -0
  69. package/dist/assets/icons/type-bold.svg +1 -0
  70. package/dist/assets/icons/type-h1.svg +1 -0
  71. package/dist/assets/icons/type-h2.svg +1 -0
  72. package/dist/assets/icons/type-h3.svg +1 -0
  73. package/dist/assets/icons/type-h4.svg +1 -0
  74. package/dist/assets/icons/type-h5.svg +1 -0
  75. package/dist/assets/icons/type-h6.svg +1 -0
  76. package/dist/assets/icons/type-italic.svg +1 -0
  77. package/dist/assets/icons/type-strikethrough.svg +1 -0
  78. package/dist/assets/icons/type-subscript.svg +1 -0
  79. package/dist/assets/icons/type-superscript.svg +1 -0
  80. package/dist/assets/icons/type-underline.svg +1 -0
  81. package/dist/assets/icons/upload.svg +1 -0
  82. package/dist/assets/icons/user.svg +1 -0
  83. package/dist/assets/icons/youtube.svg +1 -0
  84. package/dist/index.es.js +2909 -3463
  85. package/dist/index.es.js.map +1 -1
  86. package/dist/index.umd.js +19 -20
  87. package/dist/index.umd.js.map +1 -1
  88. package/dist/src/components/plugins/PageMarginPlugin/CustomMarginDialog.d.ts +1 -8
  89. package/dist/src/components/plugins/PageMarginPlugin/index.d.ts +1 -1
  90. package/dist/src/utils/FindParent.d.ts +6 -0
  91. package/dist/src/vite-env.d.ts +1 -1
  92. package/dist/style.css +1 -1
  93. package/package.json +45 -45
  94. package/dist/src/components/plugins/ToolbarPlugin/TextAlignment.d.ts +0 -8
  95. package/dist/src/components/plugins/ToolbarPlugin/fontSize.d.ts +0 -12
  96. package/dist/src/components/ui/ContentEditable.d.ts +0 -12
  97. package/dist/src/components/ui/Divider.d.ts +0 -2
  98. /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(Be,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],j):(Be=typeof globalThis<"u"?globalThis:Be||self,j(Be.ViteButton={},Be.React,Be.ReactDOM))})(this,function(Be,j,hn){"use strict";function nl(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 Oe=nl(j);var ar={exports:{}},ft={};/*
1
+ (function(Ae,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],F):(Ae=typeof globalThis<"u"?globalThis:Ae||self,F(Ae.ViteButton={},Ae.React,Ae.ReactDOM))})(this,function(Ae,F,sn){"use strict";function Us(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 kt=Us(F);var er={exports:{}},it={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var cr,Ei;function Ni(){if(Ei)return cr;Ei=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 cr=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 d in l)e.call(l,d)&&(a[d]=l[d]);if(n){c=n(l);for(var f=0;f<c.length;f++)t.call(l,c[f])&&(a[c[f]]=l[c[f]])}}return a},cr}/** @license React v17.0.2
5
+ */var tr,vo;function xo(){if(vo)return tr;vo=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},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 tr=o()?Object.assign:function(i,s){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var h in l)e.call(l,h)&&(a[h]=l[h]);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},tr}/** @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 Pi;function rl(){if(Pi)return ft;Pi=1,Ni();var n=j,e=60103;if(ft.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),ft.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,d={},f=null,h=null;c!==void 0&&(f=""+c),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(d[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)d[u]===void 0&&(d[u]=a[u]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:r.current}}return ft.jsx=s,ft.jsxs=s,ft}var ur={};/** @license React v17.0.2
12
+ */var bo;function Vs(){if(bo)return it;bo=1,xo();var n=F,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,o=Object.prototype.hasOwnProperty,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,h={},d=null,f=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(f=a.ref);for(u in a)o.call(a,u)&&!i.hasOwnProperty(u)&&(h[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)h[u]===void 0&&(h[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:f,props:h,_owner:r.current}}return it.jsx=s,it.jsxs=s,it}var nr={};/** @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 Oi;function il(){return Oi||(Oi=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=j,t=Ni(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,d=60120,f=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"),d=x("react.suspense_list"),f=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 w=typeof Symbol=="function"&&Symbol.iterator,k="@@iterator";function S(p){if(p===null||typeof p!="object")return null;var N=w&&p[w]||p[k];return typeof N=="function"?N:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(p){{for(var N=arguments.length,L=new Array(N>1?N-1:0),$=1;$<N;$++)L[$-1]=arguments[$];T("error",p,L)}}function T(p,N,L){{var $=P.ReactDebugCurrentFrame,V=$.getStackAddendum();V!==""&&(N+="%s",L=L.concat([V]));var J=L.map(function(z){return""+z});J.unshift("Warning: "+N),Function.prototype.apply.call(console[p],console,J)}}var M=!1;function R(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===o||p===u||p===d||p===y||M||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===f||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===g||p[0]===m))}function q(p,N,L){var $=N.displayName||N.name||"";return p.displayName||($!==""?L+"("+$+")":L)}function Y(p){return p.displayName||"Context"}function W(p){if(p==null)return null;if(typeof p.tag=="number"&&E("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 d:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var N=p;return Y(N)+".Consumer";case l:var L=p;return Y(L._context)+".Provider";case c:return q(p,p.render,"ForwardRef");case f:return W(p.type);case g:return W(p._render);case h:{var $=p,V=$._payload,J=$._init;try{return W(J(V))}catch{return null}}}return null}var H=0,ce,$e,Ge,cn,un,fn,Tt;function Et(){}Et.__reactDisabledLog=!0;function Nt(){{if(H===0){ce=console.log,$e=console.info,Ge=console.warn,cn=console.error,un=console.group,fn=console.groupCollapsed,Tt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:Et,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}H++}}function Pt(){{if(H--,H===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:$e}),warn:t({},p,{value:Ge}),error:t({},p,{value:cn}),group:t({},p,{value:un}),groupCollapsed:t({},p,{value:fn}),groupEnd:t({},p,{value:Tt})})}H<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var me=P.ReactCurrentDispatcher,ct;function Pe(p,N,L){{if(ct===void 0)try{throw Error()}catch(V){var $=V.stack.trim().match(/\n( *(at )?)/);ct=$&&$[1]||""}return`
20
- `+ct+p}}var Xe=!1,ut;{var Gc=typeof WeakMap=="function"?WeakMap:Map;ut=new Gc}function Ks(p,N){if(!p||Xe)return"";{var L=ut.get(p);if(L!==void 0)return L}var $;Xe=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=me.current,me.current=null,Nt();try{if(N){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(We){$=We}Reflect.construct(p,[],z)}else{try{z.call()}catch(We){$=We}p.call(z.prototype)}}else{try{throw Error()}catch(We){$=We}p()}}catch(We){if(We&&$&&typeof We.stack=="string"){for(var B=We.stack.split(`
21
- `),ue=$.stack.split(`
22
- `),X=B.length-1,Q=ue.length-1;X>=1&&Q>=0&&B[X]!==ue[Q];)Q--;for(;X>=1&&Q>=0;X--,Q--)if(B[X]!==ue[Q]){if(X!==1||Q!==1)do if(X--,Q--,Q<0||B[X]!==ue[Q]){var Re=`
23
- `+B[X].replace(" at new "," at ");return typeof p=="function"&&ut.set(p,Re),Re}while(X>=1&&Q>=0);break}}}finally{Xe=!1,me.current=J,Pt(),Error.prepareStackTrace=V}var Dt=p?p.displayName||p.name:"",tl=Dt?Pe(Dt):"";return typeof p=="function"&&ut.set(p,tl),tl}function Us(p,N,L){return Ks(p,!1)}function Xc(p){var N=p.prototype;return!!(N&&N.isReactComponent)}function sr(p,N,L){if(p==null)return"";if(typeof p=="function")return Ks(p,Xc(p));if(typeof p=="string")return Pe(p);switch(p){case u:return Pe("Suspense");case d:return Pe("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Us(p.render);case f:return sr(p.type,N,L);case g:return Us(p._render);case h:{var $=p,V=$._payload,J=$._init;try{return sr(J(V),N,L)}catch{}}}return""}var Vs={},Js=P.ReactDebugCurrentFrame;function lr(p){if(p){var N=p._owner,L=sr(p.type,p._source,N?N.type:null);Js.setExtraStackFrame(L)}else Js.setExtraStackFrame(null)}function Zc(p,N,L,$,V){{var J=Function.call.bind(Object.prototype.hasOwnProperty);for(var z in p)if(J(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](N,z,$,L,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){B=X}B&&!(B instanceof Error)&&(lr(V),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",$||"React class",L,z,typeof B),lr(null)),B instanceof Error&&!(B.message in Vs)&&(Vs[B.message]=!0,lr(V),E("Failed %s type: %s",L,B.message),lr(null))}}}var dn=P.ReactCurrentOwner,Ci=Object.prototype.hasOwnProperty,Qc={key:!0,ref:!0,__self:!0,__source:!0},Ys,Hs,wi;wi={};function eu(p){if(Ci.call(p,"ref")){var N=Object.getOwnPropertyDescriptor(p,"ref").get;if(N&&N.isReactWarning)return!1}return p.ref!==void 0}function tu(p){if(Ci.call(p,"key")){var N=Object.getOwnPropertyDescriptor(p,"key").get;if(N&&N.isReactWarning)return!1}return p.key!==void 0}function nu(p,N){if(typeof p.ref=="string"&&dn.current&&N&&dn.current.stateNode!==N){var L=W(dn.current.type);wi[L]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(dn.current.type),p.ref),wi[L]=!0)}}function ru(p,N){{var L=function(){Ys||(Ys=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",N))};L.isReactWarning=!0,Object.defineProperty(p,"key",{get:L,configurable:!0})}}function iu(p,N){{var L=function(){Hs||(Hs=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",N))};L.isReactWarning=!0,Object.defineProperty(p,"ref",{get:L,configurable:!0})}}var ou=function(p,N,L,$,V,J,z){var B={$$typeof:r,type:p,key:N,ref:L,props:z,_owner:J};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:V}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B};function su(p,N,L,$,V){{var J,z={},B=null,ue=null;L!==void 0&&(B=""+L),tu(N)&&(B=""+N.key),eu(N)&&(ue=N.ref,nu(N,V));for(J in N)Ci.call(N,J)&&!Qc.hasOwnProperty(J)&&(z[J]=N[J]);if(p&&p.defaultProps){var X=p.defaultProps;for(J in X)z[J]===void 0&&(z[J]=X[J])}if(B||ue){var Q=typeof p=="function"?p.displayName||p.name||"Unknown":p;B&&ru(z,Q),ue&&iu(z,Q)}return ou(p,B,ue,V,$,dn.current,z)}}var Si=P.ReactCurrentOwner,qs=P.ReactDebugCurrentFrame;function Ot(p){if(p){var N=p._owner,L=sr(p.type,p._source,N?N.type:null);qs.setExtraStackFrame(L)}else qs.setExtraStackFrame(null)}var ki;ki=!1;function Ti(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Gs(){{if(Si.current){var p=W(Si.current.type);if(p)return`
19
+ */var Co;function Js(){return Co||(Co=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=F,t=xo(),r=60103,o=60106;n.Fragment=60107;var i=60108,s=60114,l=60109,a=60110,c=60112,u=60113,h=60120,d=60115,f=60116,g=60121,_=60122,m=60117,x=60129,v=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;r=y("react.element"),o=y("react.portal"),n.Fragment=y("react.fragment"),i=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"),h=y("react.suspense_list"),d=y("react.memo"),f=y("react.lazy"),g=y("react.block"),_=y("react.server.block"),m=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),x=y("react.debug_trace_mode"),y("react.offscreen"),v=y("react.legacy_hidden")}var S=typeof Symbol=="function"&&Symbol.iterator,w="@@iterator";function C(p){if(p===null||typeof p!="object")return null;var k=S&&p[S]||p[w];return typeof k=="function"?k:null}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(p){{for(var k=arguments.length,I=new Array(k>1?k-1:0),A=1;A<k;A++)I[A-1]=arguments[A];P("error",p,I)}}function P(p,k,I){{var A=N.ReactDebugCurrentFrame,V=A.getStackAddendum();V!==""&&(k+="%s",I=I.concat([V]));var J=I.map(function($){return""+$});J.unshift("Warning: "+k),Function.prototype.apply.call(console[p],console,J)}}var j=!1;function z(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===x||p===i||p===u||p===h||p===v||j||typeof p=="object"&&p!==null&&(p.$$typeof===f||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===m||p.$$typeof===g||p[0]===_))}function ee(p,k,I){var A=k.displayName||k.name||"";return p.displayName||(A!==""?I+"("+A+")":I)}function q(p){return p.displayName||"Context"}function B(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 o:return"Portal";case s:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case h:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var k=p;return q(k)+".Consumer";case l:var I=p;return q(I._context)+".Provider";case c:return ee(p,p.render,"ForwardRef");case d:return B(p.type);case g:return B(p._render);case f:{var A=p,V=A._payload,J=A._init;try{return B(J(V))}catch{return null}}}return null}var Y=0,ce,Fe,Je,tn,nn,rn,bt;function Ct(){}Ct.__reactDisabledLog=!0;function wt(){{if(Y===0){ce=console.log,Fe=console.info,Je=console.warn,tn=console.error,nn=console.group,rn=console.groupCollapsed,bt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:Ct,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}Y++}}function St(){{if(Y--,Y===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:Je}),error:t({},p,{value:tn}),group:t({},p,{value:nn}),groupCollapsed:t({},p,{value:rn}),groupEnd:t({},p,{value:bt})})}Y<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=N.ReactCurrentDispatcher,rt;function Ne(p,k,I){{if(rt===void 0)try{throw Error()}catch(V){var A=V.stack.trim().match(/\n( *(at )?)/);rt=A&&A[1]||""}return`
20
+ `+rt+p}}var Ye=!1,ot;{var Dc=typeof WeakMap=="function"?WeakMap:Map;ot=new Dc}function Ds(p,k){if(!p||Ye)return"";{var I=ot.get(p);if(I!==void 0)return I}var A;Ye=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=pe.current,pe.current=null,wt();try{if(k){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(Le){A=Le}Reflect.construct(p,[],$)}else{try{$.call()}catch(Le){A=Le}p.call($.prototype)}}else{try{throw Error()}catch(Le){A=Le}p()}}catch(Le){if(Le&&A&&typeof Le.stack=="string"){for(var W=Le.stack.split(`
21
+ `),ue=A.stack.split(`
22
+ `),X=W.length-1,Q=ue.length-1;X>=1&&Q>=0&&W[X]!==ue[Q];)Q--;for(;X>=1&&Q>=0;X--,Q--)if(W[X]!==ue[Q]){if(X!==1||Q!==1)do if(X--,Q--,Q<0||W[X]!==ue[Q]){var Me=`
23
+ `+W[X].replace(" at new "," at ");return typeof p=="function"&&ot.set(p,Me),Me}while(X>=1&&Q>=0);break}}}finally{Ye=!1,pe.current=J,St(),Error.prepareStackTrace=V}var Tt=p?p.displayName||p.name:"",Ks=Tt?Ne(Tt):"";return typeof p=="function"&&ot.set(p,Ks),Ks}function Rs(p,k,I){return Ds(p,!1)}function Rc(p){var k=p.prototype;return!!(k&&k.isReactComponent)}function Qn(p,k,I){if(p==null)return"";if(typeof p=="function")return Ds(p,Rc(p));if(typeof p=="string")return Ne(p);switch(p){case u:return Ne("Suspense");case h:return Ne("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Rs(p.render);case d:return Qn(p.type,k,I);case g:return Rs(p._render);case f:{var A=p,V=A._payload,J=A._init;try{return Qn(J(V),k,I)}catch{}}}return""}var Is={},Fs=N.ReactDebugCurrentFrame;function Zn(p){if(p){var k=p._owner,I=Qn(p.type,p._source,k?k.type:null);Fs.setExtraStackFrame(I)}else Fs.setExtraStackFrame(null)}function Ic(p,k,I,A,V){{var J=Function.call.bind(Object.prototype.hasOwnProperty);for(var $ in p)if(J(p,$)){var W=void 0;try{if(typeof p[$]!="function"){var ue=Error((A||"React class")+": "+I+" type `"+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[$]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}W=p[$](k,$,A,I,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){W=X}W&&!(W instanceof Error)&&(Zn(V),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).",A||"React class",I,$,typeof W),Zn(null)),W instanceof Error&&!(W.message in Is)&&(Is[W.message]=!0,Zn(V),T("Failed %s type: %s",I,W.message),Zn(null))}}}var on=N.ReactCurrentOwner,go=Object.prototype.hasOwnProperty,Fc={key:!0,ref:!0,__self:!0,__source:!0},Ms,Ls,po;po={};function Mc(p){if(go.call(p,"ref")){var k=Object.getOwnPropertyDescriptor(p,"ref").get;if(k&&k.isReactWarning)return!1}return p.ref!==void 0}function Lc(p){if(go.call(p,"key")){var k=Object.getOwnPropertyDescriptor(p,"key").get;if(k&&k.isReactWarning)return!1}return p.key!==void 0}function Ac(p,k){if(typeof p.ref=="string"&&on.current&&k&&on.current.stateNode!==k){var I=B(on.current.type);po[I]||(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',B(on.current.type),p.ref),po[I]=!0)}}function jc(p,k){{var I=function(){Ms||(Ms=!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)",k))};I.isReactWarning=!0,Object.defineProperty(p,"key",{get:I,configurable:!0})}}function Bc(p,k){{var I=function(){Ls||(Ls=!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)",k))};I.isReactWarning=!0,Object.defineProperty(p,"ref",{get:I,configurable:!0})}}var Wc=function(p,k,I,A,V,J,$){var W={$$typeof:r,type:p,key:k,ref:I,props:$,_owner:J};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:A}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function zc(p,k,I,A,V){{var J,$={},W=null,ue=null;I!==void 0&&(W=""+I),Lc(k)&&(W=""+k.key),Mc(k)&&(ue=k.ref,Ac(k,V));for(J in k)go.call(k,J)&&!Fc.hasOwnProperty(J)&&($[J]=k[J]);if(p&&p.defaultProps){var X=p.defaultProps;for(J in X)$[J]===void 0&&($[J]=X[J])}if(W||ue){var Q=typeof p=="function"?p.displayName||p.name||"Unknown":p;W&&jc($,Q),ue&&Bc($,Q)}return Wc(p,W,ue,V,A,on.current,$)}}var _o=N.ReactCurrentOwner,As=N.ReactDebugCurrentFrame;function Et(p){if(p){var k=p._owner,I=Qn(p.type,p._source,k?k.type:null);As.setExtraStackFrame(I)}else As.setExtraStackFrame(null)}var mo;mo=!1;function yo(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function js(){{if(_o.current){var p=B(_o.current.type);if(p)return`
24
24
 
25
- Check the render method of \``+p+"`."}return""}}function lu(p){{if(p!==void 0){var N=p.fileName.replace(/^.*[\\\/]/,""),L=p.lineNumber;return`
25
+ Check the render method of \``+p+"`."}return""}}function $c(p){{if(p!==void 0){var k=p.fileName.replace(/^.*[\\\/]/,""),I=p.lineNumber;return`
26
26
 
27
- Check your code at `+N+":"+L+"."}return""}}var Xs={};function au(p){{var N=Gs();if(!N){var L=typeof p=="string"?p:p.displayName||p.name;L&&(N=`
27
+ Check your code at `+k+":"+I+"."}return""}}var Bs={};function Kc(p){{var k=js();if(!k){var I=typeof p=="string"?p:p.displayName||p.name;I&&(k=`
28
28
 
29
- Check the top-level render call using <`+L+">.")}return N}}function Zs(p,N){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var L=au(N);if(Xs[L])return;Xs[L]=!0;var $="";p&&p._owner&&p._owner!==Si.current&&($=" It was passed a child from "+W(p._owner.type)+"."),Ot(p),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',L,$),Ot(null)}}function Qs(p,N){{if(typeof p!="object")return;if(Array.isArray(p))for(var L=0;L<p.length;L++){var $=p[L];Ti($)&&Zs($,N)}else if(Ti(p))p._store&&(p._store.validated=!0);else if(p){var V=S(p);if(typeof V=="function"&&V!==p.entries)for(var J=V.call(p),z;!(z=J.next()).done;)Ti(z.value)&&Zs(z.value,N)}}}function cu(p){{var N=p.type;if(N==null||typeof N=="string")return;var L;if(typeof N=="function")L=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===c||N.$$typeof===f))L=N.propTypes;else return;if(L){var $=W(N);Zc(L,p.props,"prop",$,p)}else if(N.PropTypes!==void 0&&!ki){ki=!0;var V=W(N);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function uu(p){{for(var N=Object.keys(p.props),L=0;L<N.length;L++){var $=N[L];if($!=="children"&&$!=="key"){Ot(p),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$),Ot(null);break}}p.ref!==null&&(Ot(p),E("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function el(p,N,L,$,V,J){{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=lu(V);ue?B+=ue:B+=Gs();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,E("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 Q=su(p,N,L,V,J);if(Q==null)return Q;if(z){var Re=N.children;if(Re!==void 0)if($)if(Array.isArray(Re)){for(var Dt=0;Dt<Re.length;Dt++)Qs(Re[Dt],p);Object.freeze&&Object.freeze(Re)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Qs(Re,p)}return p===n.Fragment?uu(Q):cu(Q),Q}}function fu(p,N,L){return el(p,N,L,!0)}function du(p,N,L){return el(p,N,L,!1)}var hu=du,gu=fu;n.jsx=hu,n.jsxs=gu}()}(ur)),ur}process.env.NODE_ENV==="production"?ar.exports=rl():ar.exports=il();var b=ar.exports;function ol(n){return{}}const gn={},sl={},Di={},Ze={},dt={},pn={},ht={},fr={},dr={},jt={},At={},fe={},mn={},_n={},ll={},ji={},al={},Ai={},cl={},Li={},Ii={},yn={},ul={},Fi={},Mi={},$i={},fl={},dl={},Ri={},hr={},Wi={},_e={},Bi={},zi={},hl={},xn={},gr={},pr={},gl={},pl={},Lt={},It={},ml={},_l={},yl={},ye=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,xl=ye&&"documentMode"in document?document.documentMode:null,xe=ye&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ze=ye&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),vn=!(!ye||!("InputEvent"in window)||xl)&&"getTargetRanges"in new window.InputEvent("input"),mr=ye&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),bn=ye&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,vl=ye&&/Android/.test(navigator.userAgent),Ki=ye&&/^(?=.*Chrome).*/i.test(navigator.userAgent),bl=ye&&vl&&Ki,_r=ye&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ki,Ft=1,Ke=3,Qe=0,Ui=1,gt=2,Cl=0,wl=1,Sl=2,Cn=4,wn=8,yr=128,kl=112|(3|Cn|wn)|yr,xr=1,vr=2,br=3,Cr=4,wr=5,Sr=6,Sn=mr||bn||_r?" ":"​",De=`
29
+ Check the top-level render call using <`+I+">.")}return k}}function Ws(p,k){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var I=Kc(k);if(Bs[I])return;Bs[I]=!0;var A="";p&&p._owner&&p._owner!==_o.current&&(A=" It was passed a child from "+B(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.',I,A),Et(null)}}function zs(p,k){{if(typeof p!="object")return;if(Array.isArray(p))for(var I=0;I<p.length;I++){var A=p[I];yo(A)&&Ws(A,k)}else if(yo(p))p._store&&(p._store.validated=!0);else if(p){var V=C(p);if(typeof V=="function"&&V!==p.entries)for(var J=V.call(p),$;!($=J.next()).done;)yo($.value)&&Ws($.value,k)}}}function Uc(p){{var k=p.type;if(k==null||typeof k=="string")return;var I;if(typeof k=="function")I=k.propTypes;else if(typeof k=="object"&&(k.$$typeof===c||k.$$typeof===d))I=k.propTypes;else return;if(I){var A=B(k);Ic(I,p.props,"prop",A,p)}else if(k.PropTypes!==void 0&&!mo){mo=!0;var V=B(k);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof k.getDefaultProps=="function"&&!k.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vc(p){{for(var k=Object.keys(p.props),I=0;I<k.length;I++){var A=k[I];if(A!=="children"&&A!=="key"){Et(p),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",A),Et(null);break}}p.ref!==null&&(Et(p),T("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function $s(p,k,I,A,V,J){{var $=z(p);if(!$){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=$c(V);ue?W+=ue:W+=js();var X;p===null?X="null":Array.isArray(p)?X="array":p!==void 0&&p.$$typeof===r?(X="<"+(B(p.type)||"Unknown")+" />",W=" 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,W)}var Q=zc(p,k,I,V,J);if(Q==null)return Q;if($){var Me=k.children;if(Me!==void 0)if(A)if(Array.isArray(Me)){for(var Tt=0;Tt<Me.length;Tt++)zs(Me[Tt],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 zs(Me,p)}return p===n.Fragment?Vc(Q):Uc(Q),Q}}function Jc(p,k,I){return $s(p,k,I,!0)}function Yc(p,k,I){return $s(p,k,I,!1)}var qc=Yc,Hc=Jc;n.jsx=qc,n.jsxs=Hc}()}(nr)),nr}process.env.NODE_ENV==="production"?er.exports=Vs():er.exports=Js();var E=er.exports;function Ys(n){return{}}const ln={},qs={},wo={},qe={},st={},an={},lt={},rr={},or={},Nt={},Pt={},ge={},cn={},un={},Hs={},So={},Gs={},Eo={},Xs={},To={},ko={},dn={},Qs={},No={},Po={},Oo={},Zs={},el={},tl={},Do={},Ro={},Ot={},Io={},Fo={},nl={},fn={},ir={},sr={},rl={},ol={},Dt={},Rt={},il={},sl={},ll={},_e=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,al=_e&&"documentMode"in document?document.documentMode:null,me=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),je=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),hn=!(!_e||!("InputEvent"in window)||al)&&"getTargetRanges"in new window.InputEvent("input"),lr=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gn=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,cl=_e&&/Android/.test(navigator.userAgent),Mo=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ul=_e&&cl&&Mo,ar=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Mo,It=1,Be=3,He=0,Lo=1,at=2,dl=0,fl=1,hl=2,pn=4,_n=8,cr=128,gl=112|(3|pn|_n)|cr,ur=1,dr=2,fr=3,hr=4,gr=5,pr=6,mn=lr||gn||ar?" ":"​",Pe=`
30
30
 
31
- `,Tl=ze?" ":Sn,Vi="֑-߿יִ-﷽ﹰ-ﻼ",Ji="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",El=new RegExp("^[^"+Ji+"]*["+Vi+"]"),Nl=new RegExp("^[^"+Vi+"]*["+Ji+"]"),je={bold:1,code:16,highlight:yr,italic:2,strikethrough:Cn,subscript:32,superscript:64,underline:wn},Pl={directionless:1,unmergeable:2},Yi={center:vr,end:Sr,justify:Cr,left:xr,right:br,start:wr},Ol={[vr]:"center",[Sr]:"end",[Cr]:"justify",[xr]:"left",[br]:"right",[wr]:"start"},Dl={normal:0,segmented:2,token:1},jl={[Cl]:"normal",[Sl]:"segmented",[wl]:"token"};function Al(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var A=Al(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 kn(...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 Ll=100;let kr=!1,Tr=0;function Il(n){Tr=n.timeStamp}function Er(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function Fl(n,e,t){const r=ke(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&Ar(e,s,i,o,!1)}function Ml(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Ke&&t.isAttached()}function Hi(n,e,t){kr=!0;const r=performance.now()-Tr>Ll;try{ge(n,()=>{const i=F()||function(f){return f.getEditorState().read(()=>{const h=F();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 f=0;f<e.length;f++){const h=e[f],g=h.type,m=h.target;let _=tt(m,l);if(!(_===null&&m!==s||U(_))){if(g==="characterData")r&&D(_)&&Ml(i,m,_)&&Fl(m,_,n);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let w=0;w<v.length;w++){const k=v[w],S=ro(k),P=k.parentNode;if(P!=null&&k!==a&&S===null&&(k.nodeName!=="BR"||!Er(k,P,n))){if(ze){const E=k.innerText||k.nodeValue;E&&(u+=E)}P.removeChild(k)}}const y=h.removedNodes,x=y.length;if(x>0){let w=0;for(let k=0;k<x;k++){const S=y[k];(S.nodeName==="BR"&&Er(S,m,n)||a===S)&&(m.appendChild(S),w++)}x!==w&&(m===s&&(_=so(l)),o.set(m,_))}}}}if(o.size>0)for(const[f,h]of o)if(C(h)){const g=h.getChildrenKeys();let m=f.firstChild;for(let _=0;_<g.length;_++){const v=g[_],y=n.getElementByKey(v);y!==null&&(m==null?(f.appendChild(y),m=y):m!==y&&f.replaceChild(y,m),m=m.nextSibling)}}else D(h)&&h.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,m=h.target;for(let _=0;_<g.length;_++){const v=g[_],y=v.parentNode;y==null||v.nodeName!=="BR"||Er(v,m,n)||y.removeChild(v)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,Se(i)),ze&&_o(n)&&i.insertRawText(u))})}finally{kr=!1}}function qi(n){const e=n._observer;e!==null&&Hi(n,e.takeRecords(),e)}function Gi(n){(function(e){Tr===0&&jn(e).addEventListener("textInput",Il,!0)})(n),n._observer=new MutationObserver((e,t)=>{Hi(n,e,t)})}function Xi(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=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&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Xi(e,r)){r=Zi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Xi(r,t)){r=Zi(r,t);break}break}t.remove()}}else r.remove()}function eo(n){return to(n.anchor),to(n.focus),n}function to(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),D(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 $l=1;const Rl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Nr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(tt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Tn(e)==null)}function Mt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Nr(e)&&no(e)===n}catch{return!1}}function Pr(n){return n instanceof qn}function no(n){let e=n;for(;e!=null;){const t=Tn(e);if(Pr(t))return t;e=Dn(e)}return null}function Tn(n){return n?n.__lexicalEditor:null}function Ae(n){return n.isToken()||n.isSegmented()}function Wl(n){return n.nodeType===Ke}function En(n){let e=n;for(;e!=null;){if(Wl(e))return e;e=e.firstChild}return null}function Or(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 Bl(n,e){if(e!=null)return void(n.__key=e);he(),ts();const t=G(),r=Fe(),i=""+$l++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Ui,n.__key=i}function et(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 Nn(n){ts();const e=n.getLatest(),t=e.__parent,r=Fe(),i=G(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(t,o,s);const l=e.__key;i._dirtyType=Ui,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 Ue(){return nn()?null:G()._compositionKey}function se(n,e){const t=(e||Fe())._nodeMap.get(n);return t===void 0?null:t}function ro(n,e){const t=n[`__lexicalKey_${G()._key}`];return t!==void 0?se(t,e):null}function tt(n,e){let t=n;for(;t!=null;){const r=ro(t,e);if(r!==null)return r;t=Dn(t)}return null}function io(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function oo(n){return n.read(()=>Z().getTextContent())}function Z(){return so(Fe())}function so(n){return n._nodeMap.get("root")}function Se(n){he();const e=Fe();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function pt(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=Dn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function lo(n,e){return e?n.getTextContentSize():0}function ao(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Dr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function co(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function uo(n){return n.nodeType===Ke?n.nodeValue:null}function jr(n,e,t){const r=ke(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=uo(i);const a=tt(i);if(l!==null&&D(a)){if(l===Sn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&Ar(a,l,o,s,n)}}}function Ar(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]===Sn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),mr||bn||_r)o.remove();else{const m=G();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=tn(),d=o.getTextContentSize(),f=Ue(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!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===d&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const g=F();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 zl(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(D(s)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function fo(n){return n==="ArrowLeft"}function ho(n){return n==="ArrowRight"}function $t(n,e){return xe?n:e}function go(n){return n==="Enter"}function Rt(n){return n==="Backspace"}function Wt(n){return n==="Delete"}function po(n,e,t){return n.toLowerCase()==="a"&&$t(e,t)}function Kl(){const n=Z();Se(eo(n.select(0,n.getChildrenSize())))}function Bt(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=kn(i);return t[e]=o,o}return i}function Lr(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),d=u==="destroyed"&&i==="created";(u===void 0||d)&&c.set(s,d?"updated":i)}function mo(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 zt(n,e){const t=n.offset;if(n.type==="element")return mo(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?mo(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function _o(n){const e=jn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function I(n,e,t){return ss(n,e,t)}function Pn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function On(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&A(75,e),t}function Dn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Ir(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function jn(n){const e=n._window;return e===null&&A(78),e}function Ul(n){let e=n.getParentOrThrow();for(;e!==null;){if(mt(e))return e;e=e.getParentOrThrow()}return e}function mt(n){return oe(n)||C(n)&&n.isShadowRoot()}function Kt(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 Fr(n,e){!oe(n.getParent())||C(e)||U(e)||A(99)}function Mr(n){return(U(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function $r(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Vl(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())Mr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Mr(c)){const u=c.getPreviousSibling();(u===null||Mr(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 d=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=kn(h);h=d.blockCursor=g}h!==void 0&&f.classList.add(...h)}return f}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&$r(r,n,e)}function ke(n){return ye?(n||window).getSelection():null}function Jl(n){return An(n)&&n.tagName==="A"}function An(n){return n.nodeType===1}function Rr(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 Ln(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 _t(n){if(oe(n)||U(n)&&!n.isInline())return!0;if(!C(n)||mt(n))return!1;const e=n.getFirstChild(),t=e===null||Zt(e)||D(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 Yl(){return G()}const yo=new WeakMap,Hl=new Map;function ql(n){if(!n._readOnly&&n.isEmpty())return Hl;n._readOnly||A(192);let e=yo.get(n);if(!e){e=new Map,yo.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 Br(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function xo(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(C(s)&&xo(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let Ve,le,Ut,In,zr,Kr,nt,ve,Ur,Vt,ee="",ae="",Te=null,be="",Le="",vo=!1,Jt=!1,Fn=null;function Mn(n,e){const t=nt.get(n);if(e!==null){const r=Hr(n);r.parentNode===e&&e.removeChild(r)}if(ve.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=Rn(t,nt);Vr(r,0,r.length-1,null)}t!==void 0&&Lr(Vt,Ut,In,t,"destroyed")}function Vr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&Mn(o,r)}}function rt(n,e){n.setProperty("text-align",e)}const Gl="40px";function bo(n,e){const t=Ve.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")||Gl;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Co(n,e){const t=n.style;e===0?rt(t,""):e===xr?rt(t,"left"):e===vr?rt(t,"center"):e===br?rt(t,"right"):e===Cr?rt(t,"justify"):e===wr?rt(t,"start"):e===Sr&&rt(t,"end")}function $n(n,e,t){const r=ve.get(n);r===void 0&&A(60);const i=r.createDOM(Ve,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),D(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&&bo(i,o),s!==0){const a=s-1;(function(c,u,d,f){const h=ae;ae="",Jr(c,d,0,u,f,null),ko(d,f),ae=h})(Rn(r,ve),a,r,i)}const l=r.__format;l!==0&&Co(i,l),r.isInline()||So(null,r,i),Pn(r)&&(ee+=De,Le+=De)}else{const o=r.getTextContent();if(U(r)){const s=r.decorate(le,Ve);s!==null&&To(n,s),i.contentEditable="false"}else D(r)&&(r.isDirectionless()||(ae+=o));ee+=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 Lr(Vt,Ut,In,r,"created"),i}function Jr(n,e,t,r,i,o){const s=ee;ee="";let l=t;for(;l<=r;++l){$n(n[l],i,o);const a=ve.get(n[l]);a!==null&&D(a)&&(Te===null&&(Te=a.getFormat()),be===""&&(be=a.getStyle()))}Pn(e)&&(ee+=De),i.__lexicalTextContent=ee,ee=s+ee}function wo(n,e){const t=e.get(n);return Zt(t)||U(t)&&t.isInline()}function So(n,e,t){const r=n!==null&&(n.__size===0||wo(n.__last,nt)),i=e.__size===0||wo(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 ko(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==Fn){const o=ae==="",s=o?Fn:(i=ae,El.test(i)?"rtl":Nl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=Ve.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 d=kn(c);c=a[r]=d}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const d=kn(u);u=a[s]=d}u!==void 0&&l.add(...u)}e.dir=s}Jt||(n.getWritable().__dir=s)}Fn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function Xl(n,e,t){const r=ae;var i;ae="",Te=null,be="",function(o,s,l){const a=ee,c=o.__size,u=s.__size;if(ee="",c===1&&u===1){const d=o.__first,f=s.__first;if(d===f)Yt(d,l);else{const g=Hr(d),m=$n(f,null,null);try{l.replaceChild(m,g)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(v)}throw _}Mn(d,null)}const h=ve.get(f);D(h)&&(Te===null&&(Te=h.getFormat()),be===""&&(be=h.getStyle()))}else{const d=Rn(o,nt),f=Rn(s,ve);if(c===0)u!==0&&Jr(f,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;Vr(d,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,m,_,v,y){const x=_-1,w=v-1;let k,S,P=(M=y,M.firstChild),E=0,T=0;for(var M;E<=x&&T<=w;){const Y=g[E],W=m[T];if(Y===W)P=Yr(Yt(W,y)),E++,T++;else{k===void 0&&(k=new Set(g)),S===void 0&&(S=new Set(m));const ce=S.has(Y),$e=k.has(W);if(ce)if($e){const Ge=On(le,W);Ge===P?P=Yr(Yt(W,y)):(P!=null?y.insertBefore(Ge,P):y.appendChild(Ge),Yt(W,y)),E++,T++}else $n(W,y,P),T++;else P=Yr(Hr(Y)),Mn(Y,y),E++}const H=ve.get(W);H!==null&&D(H)&&(Te===null&&(Te=H.getFormat()),be===""&&(be=H.getStyle()))}const R=E>x,q=T>w;if(R&&!q){const Y=m[w+1];Jr(m,h,T,w,y,Y===void 0?null:le.getElementByKey(Y))}else q&&!R&&Vr(g,E,x,y)})(s,d,f,c,u,l)}Pn(s)&&(ee+=De),l.__lexicalTextContent=ee,ee=a+ee}(n,e,t),ko(e,t),hi(i=e)&&Te!=null&&Te!==i.__textFormat&&!Jt&&(i.setTextFormat(Te),i.setTextStyle(be)),function(o){hi(o)&&be!==""&&be!==o.__textStyle&&!Jt&&o.setTextStyle(be)}(e),ae=r}function Rn(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 Yt(n,e){const t=nt.get(n);let r=ve.get(n);t!==void 0&&r!==void 0||A(61);const i=vo||Kr.has(n)||zr.has(n),o=On(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(ee+=s,Le+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();D(t)&&!t.isDirectionless()&&(ae+=s),Le+=s,ee+=s}return o}if(t!==r&&i&&Lr(Vt,Ut,In,r,"updated"),r.updateDOM(t,o,Ve)){const s=$n(n,null,null);return e===null&&A(62),e.replaceChild(s,o),Mn(n,null),s}if(C(t)&&C(r)){const s=r.__indent;s!==t.__indent&&bo(o,s);const l=r.__format;l!==t.__format&&Co(o,l),i&&(Xl(t,r,o),oe(r)||r.isInline()||So(t,r,o)),Pn(r)&&(ee+=De,Le+=De)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Ve);l!==null&&To(n,l)}else D(r)&&!r.isDirectionless()&&(ae+=s);ee+=s,Le+=s}if(!Jt&&oe(r)&&r.__cachedText!==Le){const s=r.getWritable();s.__cachedText=Le,r=s}return o}function To(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=io(le)}t[n]=e}function Yr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Zl(n,e,t,r,i,o){ee="",Le="",ae="",vo=r===gt,Fn=null,le=t,Ve=t._config,Ut=t._nodes,In=le._listeners.mutation,zr=i,Kr=o,nt=n._nodeMap,ve=e._nodeMap,Jt=e._readOnly,Ur=new Map(t._keyToDOMMap);const s=new Map;return Vt=s,Yt("root",null),le=void 0,Ut=void 0,zr=void 0,Kr=void 0,nt=void 0,ve=void 0,Ve=void 0,Ur=void 0,Vt=void 0,s}function Hr(n){const e=Ur.get(n);return e===void 0&&A(75,n),e}const Ie=Object.freeze({}),qr=30,Gr=[["keydown",function(n,e){if(Ht=n.timeStamp,Eo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;I(e,ll,n)||t!=null&&(function(l,a,c,u){return ho(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,ji,n):function(l,a,c,u,d){return ho(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?I(e,al,n):function(l,a,c,u){return fo(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Ai,n):function(l,a,c,u,d){return fo(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?I(e,cl,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?I(e,Li,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?I(e,Ii,n):function(l,a){return go(l)&&a}(t,r)?(qt=!0,I(e,yn,n)):function(l){return l===" "}(t)?I(e,ul,n):function(l,a){return xe&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),qt=!0,I(e,dt,!0)):function(l,a){return go(l)&&!a}(t,r)?(qt=!1,I(e,yn,n)):function(l,a,c,u){return xe?!a&&!c&&(Rt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Rt(l)}(t,s,o,i)?Rt(t)?I(e,Fi,n):(n.preventDefault(),I(e,Ze,!0)):function(l){return l==="Escape"}(t)?I(e,Mi,n):function(l,a,c,u,d){return xe?!(c||u||d)&&(Wt(l)||l.toLowerCase()==="d"&&a):!(a||u||d)&&Wt(l)}(t,i,r,s,o)?Wt(t)?I(e,$i,n):(n.preventDefault(),I(e,Ze,!1)):function(l,a,c){return Rt(l)&&(xe?a:c)}(t,s,i)?(n.preventDefault(),I(e,jt,!0)):function(l,a,c){return Wt(l)&&(xe?a:c)}(t,s,i)?(n.preventDefault(),I(e,jt,!1)):function(l,a){return xe&&a&&Rt(l)}(t,o)?(n.preventDefault(),I(e,At,!0)):function(l,a){return xe&&a&&Wt(l)}(t,o)?(n.preventDefault(),I(e,At,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?I(e,fl,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&$t(c,u)}(t,r,o,i)?(n.preventDefault(),I(e,mn,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,_n,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,xn,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(xe?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,gr,n)):po(t,o,i)&&(n.preventDefault(),I(e,pr,n)):!ze&&po(t,o,i)&&(n.preventDefault(),I(e,pr,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&I(e,yl,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&ge(e,()=>{U(tt(t))||(Zr=!0)})}],["compositionstart",function(n,e){ge(e,()=>{const t=F();if(O(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Ht+qr||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||D(i)&&i.getStyle()!==t.style)&&I(e,ht,Tl)}})}],["compositionend",function(n,e){ze?Gt=!0:ge(e,()=>{Qr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),ge(e,()=>{const t=F(),r=n.data,i=Ao(n);if(r!=null&&O(t)&&Oo(t,i,r,n.timeStamp,!1)){Gt&&(Qr(e,r),Gt=!1);const o=t.anchor.getNode(),s=ke(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;vn&&!t.isCollapsed()&&D(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===uo(s.anchorNode)||I(e,ht,r);const u=r.length;ze&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),mr||bn||_r||!e.isComposing()||(Ht=0,re(null))}else jr(!1,e,r!==null?r:void 0),Gt&&(Qr(e,r||void 0),Gt=!1);he(),qi(G())}),yt=null}],["click",function(n,e){ge(e,()=>{const t=F(),r=ke(e._window),i=tn();if(r){if(O(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&Z().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===Ft||s===Ke)&&Se(li(i,r,e,n))}}}I(e,Di,n)})}],["cut",Ie],["copy",Ie],["dragstart",Ie],["dragover",Ie],["dragend",Ie],["paste",Ie],["focus",Ie],["blur",Ie],["drop",Ie]];vn&&Gr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=Ao(t);i==="deleteCompositionText"||ze&&_o(r)||i!=="insertCompositionText"&&ge(r,()=>{const s=F();if(i==="deleteContentBackward"){if(s===null){const h=tn();if(!O(h))return;Se(h.clone())}if(O(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,Eo==="MediaLast"&&l<Ht+qr&&r.isComposing()&&h){if(re(null),Ht=0,setTimeout(()=>{ge(r,()=>{re(null)})},qr),O(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),D(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;bl&&h&&!m||I(r,Ze,!0)}return}}var l;if(!O(s))return;const a=t.data;yt!==null&&jr(!1,r,yt),s.dirty&&yt===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),yt=null;const c=s.anchor,u=s.focus,d=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,ht,t);break;case"insertFromComposition":re(null),I(r,ht,t);break;case"insertLineBreak":re(null),I(r,dt,!1);break;case"insertParagraph":re(null),qt&&!bn?(qt=!1,I(r,dt,!1)):I(r,pn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,fr,t);break;case"deleteByComposition":(function(h,g){return h!==g||C(h)||C(g)||!h.isToken()||!g.isToken()})(d,f)&&I(r,dr,t);break;case"deleteByDrag":case"deleteByCut":I(r,dr,t);break;case"deleteContent":I(r,Ze,!1);break;case"deleteWordBackward":I(r,jt,!0);break;case"deleteWordForward":I(r,jt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,At,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,At,!1);break;case"formatStrikeThrough":I(r,fe,"strikethrough");break;case"formatBold":I(r,fe,"bold");break;case"formatItalic":I(r,fe,"italic");break;case"formatUnderline":I(r,fe,"underline");break;case"historyUndo":I(r,mn,void 0);break;case"historyRedo":I(r,_n,void 0)}else{if(a===`
32
- `)t.preventDefault(),I(r,dt,!1);else if(a===De)t.preventDefault(),I(r,pn,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(h)}else a!=null&&Oo(s,o,a,t.timeStamp,!0)?(t.preventDefault(),I(r,ht,a)):yt=a;No=t.timeStamp}})}(n,e)]);let Ht=0,Eo=null,No=0,yt=null;const Wn=new WeakMap;let Xr=!1,Zr=!1,qt=!1,Gt=!1,Po=[0,"",0,"root",0];function Oo(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=G(),c=ke(a._window),u=c!==null?c.anchorNode:null,d=o.key,f=a.getElementByKey(d),h=t.length;return d!==s.key||!D(l)||(!i&&(!vn||No<r+50)||l.isDirty()&&h<2||ao(t))&&o.offset!==s.offset&&!l.isComposing()||Ae(l)||l.isDirty()&&h>1||(i||!vn)&&f!==null&&!l.isComposing()&&u!==En(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||zl(n,l)}function Do(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Ke&&e!==0&&e!==n.nodeValue.length}function jo(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;Xr&&(Xr=!1,Do(r,i)&&Do(o,s))||ge(e,()=>{if(!t)return void Se(null);if(!Mt(e,r,o))return;const l=F();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=jn(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,m,_]=Po,v=Z(),y=e.isComposing()===!1&&v.getTextContent()==="";if(d<_+200&&a.offset===g&&a.key===m)l.format=f,l.style=h;else if(a.type==="text")D(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 bt&&x.getChildrenSize()===0?(l.format=x.getTextFormat(),l.style=x.getTextStyle()):l.format=0}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),m=g?s:i,_=g?i:s,v=g?d:u,y=g?u:d;let x=kl,w=!1;for(let k=0;k<h;k++){const S=f[k],P=S.getTextContentSize();if(D(S)&&P!==0&&!(k===0&&S.__key===v&&m===P||k===h-1&&S.__key===y&&_===0)&&(w=!0,x&=S.getFormat(),x===0))break}l.format=w?x:0}}I(e,gn,void 0)})}function Ao(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Qr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=En(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&D(r)&&Ar(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
- `){const r=F();if(O(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void I(n,yn,null)}}}jr(!0,n,e)}function Lo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const xt=new Map;function Io(n){const e=n.target,t=ke(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=no(t.anchorNode);if(r===null)return;Zr&&(Zr=!1,ge(r,()=>{const c=tn(),u=t.anchorNode;if(u===null)return;const d=u.nodeType;d!==Ft&&d!==Ke||Se(li(c,t,r,n))}));const i=Dr(r),o=i[i.length-1],s=o._key,l=xt.get(s),a=l||o;a!==r&&jo(t,a,!1),jo(t,r,!0),r!==o?xt.set(s,r):l&&xt.delete(s)}function Fo(n){n._lexicalHandled=!0}function Mo(n){return n._lexicalHandled===!0}function Ql(n){const e=n.ownerDocument,t=Wn.get(e);t===void 0&&A(162);const r=t-1;r>=0||A(164),Wn.set(e,r),r===0&&e.removeEventListener("selectionchange",Io);const i=Tn(n);Pr(i)?(function(s){if(s._parentEditor!==null){const l=Dr(s),a=l[l.length-1]._key;xt.get(a)===s&&xt.delete(a)}else xt.delete(s._key)}(i),n.__lexicalEditor=null):i&&A(198);const o=Lo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function ei(n,e,t){he();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=F();if(!O(a)||!C(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return Ir(d,l)&&c.set(l.__key,0,"element"),Ir(f,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&&(Jn(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Jn(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();et(n),Vn(o,i,l,-1)}else et(n);t||mt(i)||i.canBeEmpty()||!i.isEmpty()||ei(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class Bn{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,Bl(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||F();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(D(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(mt(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,d=c;do{if(d===null&&A(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||i.has(d.__key)||r.push(d)}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=Fe(),t=G(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=F();if(l!==null&&l.setCachedNodes(null),s.has(i))return Nn(o),o;const a=Br(o);return s.add(i),Nn(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){ei(this,!0,e)}replace(e,t){he();let r=F();r!==null&&(r=r.clone()),Fr(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;et(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(ei(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=f,d===null?a.__last=s:d.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&&Ko(m,l),_.key===o&&Ko(_,l)}return Ue()===o&&re(s),l}insertAfter(e,t=!0){he(),Fr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=F();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(et(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(),d=i.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,i.__next=f,i.__prev=r.__key,i.__parent=r.__parent,t&&O(s)){const h=this.getIndexWithinParent();Vn(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(),Fr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;et(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=F();return t&&O(u)&&Vn(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(!D(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(!D(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Xt extends Bn{static getType(){return"linebreak"}static clone(e){return new Xt(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&&Ln(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&zn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&zn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Ln(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&zn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&zn(o))return!0}return!1}(e)?null:{conversion:ea,priority:0}}}static importJSON(e){return it()}exportJSON(){return{type:"linebreak",version:1}}}function ea(n){return{node:it()}}function it(){return Kt(new Xt)}function Zt(n){return n instanceof Xt}function zn(n){return n.nodeType===Ke&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function ti(n,e){return 16&e?"code":e&yr?"mark":32&e?"sub":64&e?"sup":null}function ni(n,e){return 1&e?"strong":2&e?"em":"span"}function $o(n,e,t,r,i){const o=r.classList;let s=Bt(i,"base");s!==void 0&&o.add(...s),s=Bt(i,"underlineStrikethrough");let l=!1;const a=e&wn&&e&Cn;s!==void 0&&(t&wn&&t&Cn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in je){const u=je[c];if(s=Bt(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 Ro(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?Sn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||ze){const[l,a,c]=function(u,d){const f=u.length,h=d.length;let g=0,m=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;m+g<f&&m+g<h&&u[f-m-1]===d[h-m-1];)m++;return[g,f-g-m,d.slice(g,h-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function Wo(n,e,t,r,i,o){Ro(i,n,e);const s=o.theme.text;s!==void 0&&$o(0,0,r,n,s)}function Kn(n,e){const t=document.createElement(e);return t.appendChild(n),t}class vt extends Bn{static getType(){return"text"}static clone(e){return new vt(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 jl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ue()}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 Or(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=ti(0,r),o=ni(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)),Wo(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=ti(0,o),a=ti(0,s),c=ni(0,o),u=ni(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 Wo(_,this,0,s,i,r),t.replaceChild(_,m),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&A(49)),Ro(i,d,this);const f=r.theme.text;f!==void 0&&o!==s&&$o(0,o,s,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:ia,priority:0}),b:()=>({conversion:na,priority:0}),code:()=>({conversion:Je,priority:0}),em:()=>({conversion:Je,priority:0}),i:()=>({conversion:Je,priority:0}),s:()=>({conversion:Je,priority:0}),span:()=>({conversion:ta,priority:0}),strong:()=>({conversion:Je,priority:0}),sub:()=>({conversion:Je,priority:0}),sup:()=>({conversion:Je,priority:0}),u:()=>({conversion:Je,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&&An(t)||A(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Kn(t,"b")),this.hasFormat("italic")&&(t=Kn(t,"i")),this.hasFormat("strikethrough")&&(t=Kn(t,"s")),this.hasFormat("underline")&&(t=Kn(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"?Pl[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Or(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=Dl[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=F(),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 Go(l,r,l,i,"text","text");{const a=Ue();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=F();if(i&&O(c)){const d=e+l;c.setTextNodeRange(o,d,o,d)}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=Ue(),s=new Set(e),l=[],a=r.length;let c="";for(let k=0;k<a;k++)c!==""&&s.has(k)&&(l.push(c),c=""),c+=r[k];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const d=l[0],f=t.getParent();let h;const g=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(h=ie(d),h.__format=g,h.__style=m,h.__detail=_,v=!0):(h=t.getWritable(),h.__text=d);const y=F(),x=[h];let w=d.length;for(let k=1;k<u;k++){const S=l[k],P=S.length,E=ie(S).getWritable();E.__format=g,E.__style=m,E.__detail=_;const T=E.__key,M=w+P;if(O(y)){const R=y.anchor,q=y.focus;R.key===i&&R.type==="text"&&R.offset>w&&R.offset<=M&&(R.key=T,R.offset-=w,y.dirty=!0),q.key===i&&q.type==="text"&&q.offset>w&&q.offset<=M&&(q.key=T,q.offset-=w,y.dirty=!0)}o===i&&re(T),w=M,x.push(E)}if(f!==null){(function(P){const E=P.getPreviousSibling(),T=P.getNextSibling();E!==null&&Nn(E),T!==null&&Nn(T)})(this);const k=f.getWritable(),S=this.getIndexWithinParent();v?(k.splice(S,0,x),this.remove()):k.splice(S,1,x),O(y)&&Vn(y,f,S,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;Ue()===i&&re(r);const l=F();if(O(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===i&&(Qo(d,t,r,e,s),l.dirty=!0),f!==null&&f.key===i&&(Qo(f,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 ta(n){return{forChild:ri(n.style),node:null}}function na(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:ri(e.style,t?void 0:"bold"),node:null}}const Bo=new WeakMap;function ra(n){return n.nodeName==="PRE"||n.nodeType===Ft&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function ia(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=Bo.get(o))===void 0&&!ra(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)Bo.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
+ `,pl=je?" ":mn,Ao="֑-߿יִ-﷽ﹰ-ﻼ",jo="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",_l=new RegExp("^[^"+jo+"]*["+Ao+"]"),ml=new RegExp("^[^"+Ao+"]*["+jo+"]"),Oe={bold:1,code:16,highlight:cr,italic:2,strikethrough:pn,subscript:32,superscript:64,underline:_n},yl={directionless:1,unmergeable:2},Bo={center:dr,end:pr,justify:hr,left:ur,right:fr,start:gr},vl={[dr]:"center",[pr]:"end",[hr]:"justify",[ur]:"left",[fr]:"right",[gr]:"start"},xl={normal:0,segmented:2,token:1},bl={[dl]:"normal",[hl]:"segmented",[fl]:"token"};function Cl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D=Cl(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 yn(...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 wl=100;let _r=!1,mr=0;function Sl(n){mr=n.timeStamp}function yr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function El(n,e,t){const r=we(t._window);let o=null,i=null;r!==null&&r.anchorNode===n&&(o=r.anchorOffset,i=r.focusOffset);const s=n.nodeValue;s!==null&&Sr(e,s,o,i,!1)}function Tl(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 Wo(n,e,t){_r=!0;const r=performance.now()-mr>wl;try{he(n,()=>{const o=L()||function(d){return d.getEditorState().read(()=>{const f=L();return f!==null?f.clone():null})}(n),i=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const f=e[d],g=f.type,_=f.target;let m=Xe(_,l);if(!(m===null&&_!==s||U(m))){if(g==="characterData")r&&R(m)&&Tl(o,_,m)&&El(_,m,n);else if(g==="childList"){c=!0;const x=f.addedNodes;for(let S=0;S<x.length;S++){const w=x[S],C=Ho(w),N=w.parentNode;if(N!=null&&w!==a&&C===null&&(w.nodeName!=="BR"||!yr(w,N,n))){if(je){const T=w.innerText||w.nodeValue;T&&(u+=T)}N.removeChild(w)}}const v=f.removedNodes,y=v.length;if(y>0){let S=0;for(let w=0;w<y;w++){const C=v[w];(C.nodeName==="BR"&&yr(C,_,n)||a===C)&&(_.appendChild(C),S++)}y!==S&&(_===s&&(m=Qo(l)),i.set(_,m))}}}}if(i.size>0)for(const[d,f]of i)if(b(f)){const g=f.getChildrenKeys();let _=d.firstChild;for(let m=0;m<g.length;m++){const x=g[m],v=n.getElementByKey(x);v!==null&&(_==null?(d.appendChild(v),_=v):_!==v&&d.replaceChild(v,_),_=_.nextSibling)}}else R(f)&&f.markDirty();const h=t.takeRecords();if(h.length>0){for(let d=0;d<h.length;d++){const f=h[d],g=f.addedNodes,_=f.target;for(let m=0;m<g.length;m++){const x=g[m],v=x.parentNode;v==null||x.nodeName!=="BR"||yr(x,_,n)||v.removeChild(x)}}t.takeRecords()}o!==null&&(c&&(o.dirty=!0,Ce(o)),je&&ai(n)&&o.insertRawText(u))})}finally{_r=!1}}function zo(n){const e=n._observer;e!==null&&Wo(n,e.takeRecords(),e)}function $o(n){(function(e){mr===0&&En(e).addEventListener("textInput",Sl,!0)})(n),n._observer=new MutationObserver((e,t)=>{Wo(n,e,t)})}function Ko(n,e){const t=n.__mode,r=n.__format,o=n.__style,i=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==i||r!==null&&r!==s||o!==null&&o!==l)}function Uo(n,e){const t=n.mergeWithSibling(e),r=H()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Vo(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&R(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ko(e,r)){r=Uo(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&R(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ko(r,t)){r=Uo(r,t);break}break}t.remove()}}else r.remove()}function Jo(n){return Yo(n.anchor),Yo(n.focus),n}function Yo(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),R(r)){n.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!b(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element")}}let kl=1;const Nl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function vr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(Xe(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&vn(e)==null)}function Ft(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!vr(e)&&qo(e)===n}catch{return!1}}function xr(n){return n instanceof Kn}function qo(n){let e=n;for(;e!=null;){const t=vn(e);if(xr(t))return t;e=Sn(e)}return null}function vn(n){return n?n.__lexicalEditor:null}function ct(n){return n.isToken()||n.isSegmented()}function Pl(n){return n.nodeType===Be}function xn(n){let e=n;for(;e!=null;){if(Pl(e))return e;e=e.firstChild}return null}function br(n,e,t){const r=Oe[e];if(t!==null&&(n&r)==(t&r))return n;let o=n^r;return e==="subscript"?o&=~Oe.superscript:e==="superscript"&&(o&=~Oe.subscript),o}function Ol(n,e){if(e!=null)return void(n.__key=e);fe(),Ji();const t=H(),r=Ie(),o=""+kl++;r._nodeMap.set(o,n),b(n)?t._dirtyElements.set(o,!0):t._dirtyLeaves.add(o),t._cloneNotNeeded.add(o),t._dirtyType=Lo,n.__key=o}function Ge(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),o=n.getPreviousSibling(),i=n.getNextSibling();if(o===null)if(i!==null){const s=i.getWritable();r.__first=i.__key,s.__prev=null}else r.__first=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(i===null)if(o!==null){const s=o.getWritable();r.__last=o.__key,s.__next=null}else r.__last=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function bn(n){Ji();const e=n.getLatest(),t=e.__parent,r=Ie(),o=H(),i=r._nodeMap,s=o._dirtyElements;t!==null&&function(a,c,u){let h=a;for(;h!==null;){if(u.has(h))return;const d=c.get(h);if(d===void 0)break;u.set(h,!1),h=d.__parent}}(t,i,s);const l=e.__key;o._dirtyType=Lo,b(n)?s.set(l,!0):o._dirtyLeaves.add(l)}function re(n){fe();const e=H(),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 We(){return Xt()?null:H()._compositionKey}function se(n,e){const t=(e||Ie())._nodeMap.get(n);return t===void 0?null:t}function Ho(n,e){const t=n[`__lexicalKey_${H()._key}`];return t!==void 0?se(t,e):null}function Xe(n,e){let t=n;for(;t!=null;){const r=Ho(t,e);if(r!==null)return r;t=Sn(t)}return null}function Go(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Xo(n){return n.read(()=>G().getTextContent())}function G(){return Qo(Ie())}function Qo(n){return n._nodeMap.get("root")}function Ce(n){fe();const e=Ie();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ut(n){const e=H(),t=function(r,o){let i=r;for(;i!=null;){const s=i[`__lexicalKey_${o._key}`];if(s!==void 0)return s;i=Sn(i)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Zo(n,e){return e?n.getTextContentSize():0}function ei(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Cr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function ti(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ni(n){return n.nodeType===Be?n.nodeValue:null}function wr(n,e,t){const r=we(e._window);if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let l=ni(o);const a=Xe(o);if(l!==null&&R(a)){if(l===mn&&t){const c=t.length;l=t,i=c,s=c}l!==null&&Sr(a,l,i,s,n)}}}function Sr(n,e,t,r,o){let i=n;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let l=e;(s||o)&&e[e.length-1]===mn&&(l=e.slice(0,-1));const a=i.getTextContent();if(o||l!==a){if(l===""){if(re(null),lr||gn||ar)i.remove();else{const _=H();setTimeout(()=>{_.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Gt(),h=i.getTextContentSize(),d=We(),f=i.getKey();if(i.isToken()||d!==null&&f===d&&!s||O(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===h&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=L();if(!O(g)||t===null||r===null)return void i.setTextContent(l);if(g.setTextNodeRange(i,t,i,r),i.isSegmented()){const _=oe(i.getTextContent());i.replace(_),i=_}i.setTextContent(l)}}}function Dl(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),o=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||o||function(i){const s=i.getPreviousSibling();return(R(s)||b(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||o)}function ri(n){return n==="ArrowLeft"}function oi(n){return n==="ArrowRight"}function Mt(n,e){return me?n:e}function ii(n){return n==="Enter"}function Lt(n){return n==="Backspace"}function At(n){return n==="Delete"}function si(n,e,t){return n.toLowerCase()==="a"&&Mt(e,t)}function Rl(){const n=G();Ce(Jo(n.select(0,n.getChildrenSize())))}function jt(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const o=n[e];if(typeof o=="string"){const i=yn(o);return t[e]=i,i}return o}function Er(n,e,t,r,o){if(t.size===0)return;const i=r.__type,s=r.__key,l=e.get(i);l===void 0&&D(33,i);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),h=u==="destroyed"&&o==="created";(u===void 0||h)&&c.set(s,h?"updated":o)}function li(n,e,t){const r=n.getParent();let o=t,i=n;return r!==null&&(e&&t===0?(o=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?o-1:o)}function Bt(n,e){const t=n.offset;if(n.type==="element")return li(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const o=e?r.getPreviousSibling():r.getNextSibling();return o===null?li(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function ai(n){const e=En(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function M(n,e,t){return Xi(n,e,t)}function Cn(n){return!ie(n)&&!n.isLastChild()&&!n.isInline()}function wn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&D(75,e),t}function Sn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Tr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function En(n){const e=n._window;return e===null&&D(78),e}function Il(n){let e=n.getParentOrThrow();for(;e!==null;){if(dt(e))return e;e=e.getParentOrThrow()}return e}function dt(n){return ie(n)||b(n)&&n.isShadowRoot()}function Tn(n){const e=H(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&D(97);const o=r.replace;if(o!==null){const i=o(n);return i instanceof n.constructor||D(98),i}return n}function kr(n,e){!ie(n.getParent())||b(e)||U(e)||D(99)}function Nr(n){return(U(n)||b(n)&&!n.canBeEmpty())&&!n.isInline()}function Pr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Fl(n,e,t){let r=n._blockCursorElement;if(O(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const o=t.anchor,i=o.getNode(),s=o.offset;let l=!1,a=null;if(s===i.getChildrenSize())Nr(i.getChildAtIndex(s-1))&&(l=!0);else{const c=i.getChildAtIndex(s);if(Nr(c)){const u=c.getPreviousSibling();(u===null||Nr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(i.__key);return r===null&&(n._blockCursorElement=r=function(u){const h=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let f=h.blockCursor;if(f!==void 0){if(typeof f=="string"){const g=yn(f);f=h.blockCursor=g}f!==void 0&&d.classList.add(...f)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Pr(r,n,e)}function we(n){return _e?(n||window).getSelection():null}function Or(n){return n.nodeType===1}function Dr(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 kn(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 ft(n){if(ie(n)||U(n)&&!n.isInline())return!0;if(!b(n)||dt(n))return!1;const e=n.getFirstChild(),t=e===null||pt(e)||R(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Rr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ml(){return H()}const ci=new WeakMap,Ll=new Map;function Al(n){if(!n._readOnly&&n.isEmpty())return Ll;n._readOnly||D(192);let e=ci.get(n);if(!e){e=new Map,ci.set(n,e);for(const[t,r]of n._nodeMap){const o=r.__type;let i=e.get(o);i||(i=new Map,e.set(o,i)),i.set(t,r)}}return e}function Ir(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ui(n,e,t,r,o,i){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(b(s)&&ui(s,l,t,r,o,i),t.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}let ze,le,Wt,Nn,Fr,Mr,Qe,ye,Lr,zt,Z="",ae="",Se=null,ve="",De="",di=!1,$t=!1,Pn=null;function On(n,e){const t=Qe.get(n);if(e!==null){const r=Wr(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),b(t)){const r=Rn(t,Qe);Ar(r,0,r.length-1,null)}t!==void 0&&Er(zt,Wt,Nn,t,"destroyed")}function Ar(n,e,t,r){let o=e;for(;o<=t;++o){const i=n[o];i!==void 0&&On(i,r)}}function Ze(n,e){n.setProperty("text-align",e)}const jl="40px";function fi(n,e){const t=ze.theme.indent;if(typeof t=="string"){const o=n.classList.contains(t);e>0&&!o?n.classList.add(t):e<1&&o&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||jl;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function hi(n,e){const t=n.style;e===0?Ze(t,""):e===ur?Ze(t,"left"):e===dr?Ze(t,"center"):e===fr?Ze(t,"right"):e===hr?Ze(t,"justify"):e===gr?Ze(t,"start"):e===pr&&Ze(t,"end")}function Dn(n,e,t){const r=ye.get(n);r===void 0&&D(60);const o=r.createDOM(ze,le);if(function(i,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=i,a.set(i,s)}(n,o,le),R(r)?o.setAttribute("data-lexical-text","true"):U(r)&&o.setAttribute("data-lexical-decorator","true"),b(r)){const i=r.__indent,s=r.__size;if(i!==0&&fi(o,i),s!==0){const a=s-1;(function(c,u,h,d){const f=ae;ae="",jr(c,h,0,u,d,null),_i(h,d),ae=f})(Rn(r,ye),a,r,o)}const l=r.__format;l!==0&&hi(o,l),r.isInline()||pi(null,r,o),Cn(r)&&(Z+=Pe,De+=Pe)}else{const i=r.getTextContent();if(U(r)){const s=r.decorate(le,ze);s!==null&&mi(n,s),o.contentEditable="false"}else R(r)&&(r.isDirectionless()||(ae+=i));Z+=i,De+=i}if(e!==null)if(t!=null)e.insertBefore(o,t);else{const i=e.__lexicalLineBreak;i!=null?e.insertBefore(o,i):e.appendChild(o)}return Er(zt,Wt,Nn,r,"created"),o}function jr(n,e,t,r,o,i){const s=Z;Z="";let l=t;for(;l<=r;++l){Dn(n[l],o,i);const a=ye.get(n[l]);a!==null&&R(a)&&(Se===null&&(Se=a.getFormat()),ve===""&&(ve=a.getStyle()))}Cn(e)&&(Z+=Pe),o.__lexicalTextContent=Z,Z=s+Z}function gi(n,e){const t=e.get(n);return pt(t)||U(t)&&t.isInline()}function pi(n,e,t){const r=n!==null&&(n.__size===0||gi(n.__last,Qe)),o=e.__size===0||gi(e.__last,ye);if(r){if(!o){const i=t.__lexicalLineBreak;if(i!=null)try{t.removeChild(i)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${i.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(o){const i=document.createElement("br");t.__lexicalLineBreak=i,t.appendChild(i)}}function _i(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==Pn){const i=ae==="",s=i?Pn:(o=ae,_l.test(o)?"rtl":ml.test(o)?"ltr":null);if(s!==r){const l=e.classList,a=ze.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 h=yn(c);c=a[r]=h}l.remove(...c)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const h=yn(u);u=a[s]=h}u!==void 0&&l.add(...u)}e.dir=s}$t||(n.getWritable().__dir=s)}Pn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var o}function Bl(n,e,t){const r=ae;var o;ae="",Se=null,ve="",function(i,s,l){const a=Z,c=i.__size,u=s.__size;if(Z="",c===1&&u===1){const h=i.__first,d=s.__first;if(h===d)Kt(h,l);else{const g=Wr(h),_=Dn(d,null,null);try{l.replaceChild(_,g)}catch(m){if(typeof m=="object"&&m!=null){const x=`${m.toString()} Parent: ${l.tagName}, new child: {tag: ${_.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${h}}.`;throw new Error(x)}throw m}On(h,null)}const f=ye.get(d);R(f)&&(Se===null&&(Se=f.getFormat()),ve===""&&(ve=f.getStyle()))}else{const h=Rn(i,Qe),d=Rn(s,ye);if(c===0)u!==0&&jr(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const f=l.__lexicalLineBreak==null;Ar(h,0,c-1,f?null:l),f&&(l.textContent="")}}else(function(f,g,_,m,x,v){const y=m-1,S=x-1;let w,C,N=(j=v,j.firstChild),T=0,P=0;for(var j;T<=y&&P<=S;){const q=g[T],B=_[P];if(q===B)N=Br(Kt(B,v)),T++,P++;else{w===void 0&&(w=new Set(g)),C===void 0&&(C=new Set(_));const ce=C.has(q),Fe=w.has(B);if(ce)if(Fe){const Je=wn(le,B);Je===N?N=Br(Kt(B,v)):(N!=null?v.insertBefore(Je,N):v.appendChild(Je),Kt(B,v)),T++,P++}else Dn(B,v,N),P++;else N=Br(Wr(q)),On(q,v),T++}const Y=ye.get(B);Y!==null&&R(Y)&&(Se===null&&(Se=Y.getFormat()),ve===""&&(ve=Y.getStyle()))}const z=T>y,ee=P>S;if(z&&!ee){const q=_[S+1];jr(_,f,P,S,v,q===void 0?null:le.getElementByKey(q))}else ee&&!z&&Ar(g,T,y,v)})(s,h,d,c,u,l)}Cn(s)&&(Z+=Pe),l.__lexicalTextContent=Z,Z=a+Z}(n,e,t),_i(e,t),io(o=e)&&Se!=null&&Se!==o.__textFormat&&!$t&&(o.setTextFormat(Se),o.setTextStyle(ve)),function(i){io(i)&&ve!==""&&ve!==i.__textStyle&&!$t&&i.setTextStyle(ve)}(e),ae=r}function Rn(n,e){const t=[];let r=n.__first;for(;r!==null;){const o=e.get(r);o===void 0&&D(101),t.push(r),r=o.__next}return t}function Kt(n,e){const t=Qe.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||D(61);const o=di||Mr.has(n)||Fr.has(n),i=wn(le,n);if(t===r&&!o){if(b(t)){const s=i.__lexicalTextContent;s!==void 0&&(Z+=s,De+=s);const l=i.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();R(t)&&!t.isDirectionless()&&(ae+=s),De+=s,Z+=s}return i}if(t!==r&&o&&Er(zt,Wt,Nn,r,"updated"),r.updateDOM(t,i,ze)){const s=Dn(n,null,null);return e===null&&D(62),e.replaceChild(s,i),On(n,null),s}if(b(t)&&b(r)){const s=r.__indent;s!==t.__indent&&fi(i,s);const l=r.__format;l!==t.__format&&hi(i,l),o&&(Bl(t,r,i),ie(r)||r.isInline()||pi(t,r,i)),Cn(r)&&(Z+=Pe,De+=Pe)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,ze);l!==null&&mi(n,l)}else R(r)&&!r.isDirectionless()&&(ae+=s);Z+=s,De+=s}if(!$t&&ie(r)&&r.__cachedText!==De){const s=r.getWritable();s.__cachedText=De,r=s}return i}function mi(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=Go(le)}t[n]=e}function Br(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Wl(n,e,t,r,o,i){Z="",De="",ae="",di=r===at,Pn=null,le=t,ze=t._config,Wt=t._nodes,Nn=le._listeners.mutation,Fr=o,Mr=i,Qe=n._nodeMap,ye=e._nodeMap,$t=e._readOnly,Lr=new Map(t._keyToDOMMap);const s=new Map;return zt=s,Kt("root",null),le=void 0,Wt=void 0,Fr=void 0,Mr=void 0,Qe=void 0,ye=void 0,ze=void 0,Lr=void 0,zt=void 0,s}function Wr(n){const e=Lr.get(n);return e===void 0&&D(75,n),e}const Re=Object.freeze({}),zr=30,$r=[["keydown",function(n,e){if(Ut=n.timeStamp,yi=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=n;M(e,Hs,n)||t!=null&&(function(l,a,c,u){return oi(l)&&!a&&!u&&!c}(t,o,s,i)?M(e,So,n):function(l,a,c,u,h){return oi(l)&&!u&&!c&&(a||h)}(t,o,r,s,i)?M(e,Gs,n):function(l,a,c,u){return ri(l)&&!a&&!u&&!c}(t,o,s,i)?M(e,Eo,n):function(l,a,c,u,h){return ri(l)&&!u&&!c&&(a||h)}(t,o,r,s,i)?M(e,Xs,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,o,i)?M(e,To,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,o,i)?M(e,ko,n):function(l,a){return ii(l)&&a}(t,r)?(Vt=!0,M(e,dn,n)):function(l){return l===" "}(t)?M(e,Qs,n):function(l,a){return me&&a&&l.toLowerCase()==="o"}(t,o)?(n.preventDefault(),Vt=!0,M(e,st,!0)):function(l,a){return ii(l)&&!a}(t,r)?(Vt=!1,M(e,dn,n)):function(l,a,c,u){return me?!a&&!c&&(Lt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Lt(l)}(t,s,i,o)?Lt(t)?M(e,No,n):(n.preventDefault(),M(e,qe,!0)):function(l){return l==="Escape"}(t)?M(e,Po,n):function(l,a,c,u,h){return me?!(c||u||h)&&(At(l)||l.toLowerCase()==="d"&&a):!(a||u||h)&&At(l)}(t,o,r,s,i)?At(t)?M(e,Oo,n):(n.preventDefault(),M(e,qe,!1)):function(l,a,c){return Lt(l)&&(me?a:c)}(t,s,o)?(n.preventDefault(),M(e,Nt,!0)):function(l,a,c){return At(l)&&(me?a:c)}(t,s,o)?(n.preventDefault(),M(e,Nt,!1)):function(l,a){return me&&a&&Lt(l)}(t,i)?(n.preventDefault(),M(e,Pt,!0)):function(l,a){return me&&a&&At(l)}(t,i)?(n.preventDefault(),M(e,Pt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&Mt(c,u)}(t,s,i,o)?(n.preventDefault(),M(e,ge,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&Mt(c,u)}(t,s,i,o)?(n.preventDefault(),M(e,ge,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&Mt(c,u)}(t,s,i,o)?(n.preventDefault(),M(e,ge,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,o,i)?M(e,Zs,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&Mt(c,u)}(t,r,i,o)?(n.preventDefault(),M(e,cn,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,i,o)?(n.preventDefault(),M(e,un,void 0)):xe(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(me?c:u)}(t,r,i,o)?(n.preventDefault(),M(e,fn,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(me?c:u)}(t,r,i,o)?(n.preventDefault(),M(e,ir,n)):si(t,i,o)&&(n.preventDefault(),M(e,sr,n)):!je&&si(t,i,o)&&(n.preventDefault(),M(e,sr,n)),function(l,a,c,u){return l||a||c||u}(o,r,s,i)&&M(e,ll,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{U(Xe(t))||(Ur=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=L();if(O(t)&&!e.isComposing()){const r=t.anchor,o=t.anchor.getNode();re(r.key),(n.timeStamp<Ut+zr||r.type==="element"||!t.isCollapsed()||o.getFormat()!==t.format||R(o)&&o.getStyle()!==t.style)&&M(e,lt,pl)}})}],["compositionend",function(n,e){je?Jt=!0:he(e,()=>{Vr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=L(),r=n.data,o=Si(n);if(r!=null&&O(t)&&bi(t,o,r,n.timeStamp,!1)){Jt&&(Vr(e,r),Jt=!1);const i=t.anchor.getNode(),s=we(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;hn&&!t.isCollapsed()&&R(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+c)===ni(s.anchorNode)||M(e,lt,r);const u=r.length;je&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),lr||gn||ar||!e.isComposing()||(Ut=0,re(null))}else wr(!1,e,r!==null?r:void 0),Jt&&(Vr(e,r||void 0),Jt=!1);fe(),zo(H())}),ht=null}],["click",function(n,e){he(e,()=>{const t=L(),r=we(e._window),o=Gt();if(r){if(O(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!ie(s)&&G().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(b(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const i=r.anchorNode;if(i!==null){const s=i.nodeType;(s===It||s===Be)&&Ce(Zr(o,r,e,n))}}}M(e,wo,n)})}],["cut",Re],["copy",Re],["dragstart",Re],["dragover",Re],["dragend",Re],["paste",Re],["focus",Re],["blur",Re],["drop",Re]];hn&&$r.push(["beforeinput",(n,e)=>function(t,r){const o=t.inputType,i=Si(t);o==="deleteCompositionText"||je&&ai(r)||o!=="insertCompositionText"&&he(r,()=>{const s=L();if(o==="deleteContentBackward"){if(s===null){const f=Gt();if(!O(f))return;Ce(f.clone())}if(O(s)){const f=s.anchor.key===s.focus.key;if(l=t.timeStamp,yi==="MediaLast"&&l<Ut+zr&&r.isComposing()&&f){if(re(null),Ut=0,setTimeout(()=>{he(r,()=>{re(null)})},zr),O(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),R(g)||D(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),_=s.anchor.offset===0&&s.focus.offset===g.length;ul&&f&&!_||M(r,qe,!0)}return}}var l;if(!O(s))return;const a=t.data;ht!==null&&wr(!1,r,ht),s.dirty&&ht===null||!s.isCollapsed()||ie(s.anchor.getNode())||i===null||s.applyDOMRange(i),ht=null;const c=s.anchor,u=s.focus,h=c.getNode(),d=u.getNode();if(o!=="insertText"&&o!=="insertTranspose")switch(t.preventDefault(),o){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":M(r,lt,t);break;case"insertFromComposition":re(null),M(r,lt,t);break;case"insertLineBreak":re(null),M(r,st,!1);break;case"insertParagraph":re(null),Vt&&!gn?(Vt=!1,M(r,st,!1)):M(r,an,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":M(r,rr,t);break;case"deleteByComposition":(function(f,g){return f!==g||b(f)||b(g)||!f.isToken()||!g.isToken()})(h,d)&&M(r,or,t);break;case"deleteByDrag":case"deleteByCut":M(r,or,t);break;case"deleteContent":M(r,qe,!1);break;case"deleteWordBackward":M(r,Nt,!0);break;case"deleteWordForward":M(r,Nt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":M(r,Pt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":M(r,Pt,!1);break;case"formatStrikeThrough":M(r,ge,"strikethrough");break;case"formatBold":M(r,ge,"bold");break;case"formatItalic":M(r,ge,"italic");break;case"formatUnderline":M(r,ge,"underline");break;case"historyUndo":M(r,cn,void 0);break;case"historyRedo":M(r,un,void 0)}else{if(a===`
32
+ `)t.preventDefault(),M(r,st,!1);else if(a===Pe)t.preventDefault(),M(r,an,void 0);else if(a==null&&t.dataTransfer){const f=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(f)}else a!=null&&bi(s,i,a,t.timeStamp,!0)?(t.preventDefault(),M(r,lt,a)):ht=a;vi=t.timeStamp}})}(n,e)]);let Ut=0,yi=null,vi=0,ht=null;const In=new WeakMap;let Kr=!1,Ur=!1,Vt=!1,Jt=!1,xi=[0,"",0,"root",0];function bi(n,e,t,r,o){const i=n.anchor,s=n.focus,l=i.getNode(),a=H(),c=we(a._window),u=c!==null?c.anchorNode:null,h=i.key,d=a.getElementByKey(h),f=t.length;return h!==s.key||!R(l)||(!o&&(!hn||vi<r+50)||l.isDirty()&&f<2||ei(t))&&i.offset!==s.offset&&!l.isComposing()||ct(l)||l.isDirty()&&f>1||(o||!hn)&&d!==null&&!l.isComposing()&&u!==xn(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Dl(n,l)}function Ci(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Be&&e!==0&&e!==n.nodeValue.length}function wi(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=n;Kr&&(Kr=!1,Ci(r,o)&&Ci(i,s))||he(e,()=>{if(!t)return void Ce(null);if(!Ft(e,r,i))return;const l=L();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=En(e).event,h=u?u.timeStamp:performance.now(),[d,f,g,_,m]=xi,x=G(),v=e.isComposing()===!1&&x.getTextContent()==="";if(h<m+200&&a.offset===g&&a.key===_)l.format=d,l.style=f;else if(a.type==="text")R(c)||D(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!v){const y=a.getNode();l.style="",y instanceof mt&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,h=l.focus.key,d=l.getNodes(),f=d.length,g=l.isBackward(),_=g?s:o,m=g?o:s,x=g?h:u,v=g?u:h;let y=gl,S=!1;for(let w=0;w<f;w++){const C=d[w],N=C.getTextContentSize();if(R(C)&&N!==0&&!(w===0&&C.__key===x&&_===N||w===f-1&&C.__key===v&&m===0)&&(S=!0,y&=C.getFormat(),y===0))break}l.format=S?y:0}}M(e,ln,void 0)})}function Si(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Vr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),o=xn(n.getElementByKey(t));return void(o!==null&&o.nodeValue!==null&&R(r)&&Sr(r,o.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
+ `){const r=L();if(O(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void M(n,dn,null)}}}wr(!0,n,e)}function Ei(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const gt=new Map;function Ti(n){const e=n.target,t=we(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=qo(t.anchorNode);if(r===null)return;Ur&&(Ur=!1,he(r,()=>{const c=Gt(),u=t.anchorNode;if(u===null)return;const h=u.nodeType;h!==It&&h!==Be||Ce(Zr(c,t,r,n))}));const o=Cr(r),i=o[o.length-1],s=i._key,l=gt.get(s),a=l||i;a!==r&&wi(t,a,!1),wi(t,r,!0),r!==i?gt.set(s,r):l&&gt.delete(s)}function ki(n){n._lexicalHandled=!0}function Ni(n){return n._lexicalHandled===!0}function zl(n){const e=n.ownerDocument,t=In.get(e);t===void 0&&D(162);const r=t-1;r>=0||D(164),In.set(e,r),r===0&&e.removeEventListener("selectionchange",Ti);const o=vn(n);xr(o)?(function(s){if(s._parentEditor!==null){const l=Cr(s),a=l[l.length-1]._key;gt.get(a)===s&&gt.delete(a)}else gt.delete(s._key)}(o),n.__lexicalEditor=null):o&&D(198);const i=Ei(n);for(let s=0;s<i.length;s++)i[s]();n.__lexicalEventHandles=[]}function Jr(n,e,t){fe();const r=n.__key,o=n.getParent();if(o===null)return;const i=function(l){const a=L();if(!O(a)||!b(l))return a;const{anchor:c,focus:u}=a,h=c.getNode(),d=u.getNode();return Tr(h,l)&&c.set(l.__key,0,"element"),Tr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(O(i)&&e){const l=i.anchor,a=i.focus;l.key===r&&(Bn(l,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Bn(a,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else xe(i)&&e&&n.isSelected()&&n.selectPrevious();if(O(i)&&e&&!s){const l=n.getIndexWithinParent();Ge(n),jn(i,o,l,-1)}else Ge(n);t||dt(o)||o.canBeEmpty()||!o.isEmpty()||Jr(o,e),e&&ie(o)&&o.isEmpty()&&o.selectEnd()}class Fn{static getType(){D(64,this.name)}static clone(e){D(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,Ol(this,e)}getType(){return this.__type}isInline(){D(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||L();if(t==null)return!1;const r=t.getNodes().some(o=>o.__key===this.__key);if(R(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const o=this.getParent();if(U(this)&&this.isInline()&&o){const i=t.isBackward()?t.focus:t.anchor,s=i.getNode();if(i.offset===s.getChildrenSize()&&s.is(o)&&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&&D(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(dt(t))return b(e)||e===this&&U(e)||D(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&D(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();b(this)&&t.unshift(this),b(e)&&r.unshift(e);const o=t.length,i=r.length;if(o===0||i===0||t[o-1]!==r[i-1])return null;const s=new Set(r);for(let l=0;l<o;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,o=0,i=this;for(;;){const s=i.getParentOrThrow();if(s===t){r=i.getIndexWithinParent();break}i=s}for(i=e;;){const s=i.getParentOrThrow();if(s===t){o=i.getIndexWithinParent();break}i=s}return r<o}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=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===e)break;const l=b(i)?t?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(a!==null){i=a;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===e)break;let u=null,h=c;do{if(h===null&&D(68),u=t?h.getNextSibling():h.getPreviousSibling(),h=h.getParent(),h===null)break;u!==null||o.has(h.__key)||r.push(h)}while(u===null);i=u}return t||r.reverse(),r}isDirty(){const e=H()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&D(113),e}getWritable(){fe();const e=Ie(),t=H(),r=e._nodeMap,o=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,l=L();if(l!==null&&l.setCachedNodes(null),s.has(o))return bn(i),i;const a=Ir(i);return s.add(o),bn(a),r.set(o,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){D(70)}updateDOM(e,t,r){D(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){D(72)}static importJSON(e){D(18,this.name)}static transform(){return null}remove(e){Jr(this,!0,e)}replace(e,t){fe();let r=L();r!==null&&(r=r.clone()),kr(this,e);const o=this.getLatest(),i=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Ge(l);const u=o.getPreviousSibling(),h=o.getNextSibling(),d=o.__prev,f=o.__next,g=o.__parent;if(Jr(o,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,h===null?a.__last=s:h.getWritable().__prev=s,l.__next=f,l.__parent=g,a.__size=c,t&&(b(this)&&b(l)||D(139),this.getChildren().forEach(_=>{l.append(_)})),O(r)){Ce(r);const _=r.anchor,m=r.focus;_.key===i&&Fi(_,l),m.key===i&&Fi(m,l)}return We()===i&&re(s),l}insertAfter(e,t=!0){fe(),kr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.getParent(),s=L();let l=!1,a=!1;if(i!==null){const f=e.getIndexWithinParent();if(Ge(o),O(s)){const g=i.__key,_=s.anchor,m=s.focus;l=_.type==="element"&&_.key===g&&_.offset===f+1,a=m.type==="element"&&m.key===g&&m.offset===f+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),h=o.__key,d=r.__next;if(c===null?u.__last=h:c.getWritable().__prev=h,u.__size++,r.__next=h,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,t&&O(s)){const f=this.getIndexWithinParent();jn(s,u,f+1);const g=u.__key;l&&s.anchor.set(g,f+2,"element"),a&&s.focus.set(g,f+2,"element")}return e}insertBefore(e,t=!0){fe(),kr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.__key;Ge(o);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=i:s.getWritable().__next=i,l.__size++,r.__prev=i,o.__prev=a,o.__next=r.__key,o.__parent=r.__parent;const u=L();return t&&O(u)&&jn(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Te()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){fe();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(b(r))return r.select();if(!R(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(e,t)}selectNext(e,t){fe();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(b(r))return r.select(0,0);if(!R(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(e,t)}markDirty(){this.getWritable()}}class Yt extends Fn{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&&kn(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&Mn(o)){const i=r.lastChild;if(i===t||i.previousSibling===t&&Mn(i))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&kn(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&Mn(o))return!1;const i=r.lastChild;if(i===t||i.previousSibling===t&&Mn(i))return!0}return!1}(e)?null:{conversion:$l,priority:0}}}static importJSON(e){return et()}exportJSON(){return{type:"linebreak",version:1}}}function $l(n){return{node:et()}}function et(){return Tn(new Yt)}function pt(n){return n instanceof Yt}function Mn(n){return n.nodeType===Be&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Yr(n,e){return 16&e?"code":e&cr?"mark":32&e?"sub":64&e?"sup":null}function qr(n,e){return 1&e?"strong":2&e?"em":"span"}function Pi(n,e,t,r,o){const i=r.classList;let s=jt(o,"base");s!==void 0&&i.add(...s),s=jt(o,"underlineStrikethrough");let l=!1;const a=e&_n&&e&pn;s!==void 0&&(t&_n&&t&pn?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(const c in Oe){const u=Oe[c];if(s=jt(o,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&i.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||i.add(...s)}else e&u&&i.remove(...s)}}function Oi(n,e,t){const r=e.firstChild,o=t.isComposing(),i=n+(o?mn:"");if(r==null)e.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||je){const[l,a,c]=function(u,h){const d=u.length,f=h.length;let g=0,_=0;for(;g<d&&g<f&&u[g]===h[g];)g++;for(;_+g<d&&_+g<f&&u[d-_-1]===h[f-_-1];)_++;return[g,d-g-_,h.slice(g,f-_)]}(s,i);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=i}}function Di(n,e,t,r,o,i){Oi(o,n,e);const s=i.theme.text;s!==void 0&&Pi(0,0,r,n,s)}function Ln(n,e){const t=document.createElement(e);return t.appendChild(n),t}class _t extends Fn{static getType(){return"text"}static clone(e){return new _t(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 bl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===We()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Oe[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return br(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,o=Yr(0,r),i=qr(0,r),s=o===null?i:o,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(a=document.createElement(i),l.appendChild(a)),Di(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const o=this.__text,i=e.__format,s=this.__format,l=Yr(0,i),a=Yr(0,s),c=qr(0,i),u=qr(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const _=t.firstChild;_==null&&D(48);const m=document.createElement(u);return Di(m,this,0,s,o,r),t.replaceChild(m,_),!1}let h=t;a!==null&&l!==null&&(h=t.firstChild,h==null&&D(49)),Oi(o,h,this);const d=r.theme.text;d!==void 0&&i!==s&&Pi(0,i,s,h,d);const f=e.__style,g=this.__style;return f!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Jl,priority:0}),b:()=>({conversion:Ul,priority:0}),code:()=>({conversion:$e,priority:0}),em:()=>({conversion:$e,priority:0}),i:()=>({conversion:$e,priority:0}),s:()=>({conversion:$e,priority:0}),span:()=>({conversion:Kl,priority:0}),strong:()=>({conversion:$e,priority:0}),sub:()=>({conversion:$e,priority:0}),sup:()=>({conversion:$e,priority:0}),u:()=>({conversion:$e,priority:0})}}static importJSON(e){const t=oe(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&&Or(t)||D(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Ln(t,"b")),this.hasFormat("italic")&&(t=Ln(t,"i")),this.hasFormat("strikethrough")&&(t=Ln(t,"s")),this.hasFormat("underline")&&(t=Ln(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"?Oe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?yl[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=br(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=xl[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){fe();let r=e,o=t;const i=L(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),o===void 0&&(o=a)}else r=0,o=0;if(!O(i))return zi(l,r,l,o,"text","text");{const a=We();a!==i.anchor.key&&a!==i.focus.key||re(l),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,o){const i=this.getWritable(),s=i.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=L();if(o&&O(c)){const h=e+l;c.setTextNodeRange(i,h,i,h)}const u=s.slice(0,a)+r+s.slice(a+t);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){fe();const t=this.getLatest(),r=t.getTextContent(),o=t.__key,i=We(),s=new Set(e),l=[],a=r.length;let c="";for(let w=0;w<a;w++)c!==""&&s.has(w)&&(l.push(c),c=""),c+=r[w];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const h=l[0],d=t.getParent();let f;const g=t.getFormat(),_=t.getStyle(),m=t.__detail;let x=!1;t.isSegmented()?(f=oe(h),f.__format=g,f.__style=_,f.__detail=m,x=!0):(f=t.getWritable(),f.__text=h);const v=L(),y=[f];let S=h.length;for(let w=1;w<u;w++){const C=l[w],N=C.length,T=oe(C).getWritable();T.__format=g,T.__style=_,T.__detail=m;const P=T.__key,j=S+N;if(O(v)){const z=v.anchor,ee=v.focus;z.key===o&&z.type==="text"&&z.offset>S&&z.offset<=j&&(z.key=P,z.offset-=S,v.dirty=!0),ee.key===o&&ee.type==="text"&&ee.offset>S&&ee.offset<=j&&(ee.key=P,ee.offset-=S,v.dirty=!0)}i===o&&re(P),S=j,y.push(T)}if(d!==null){(function(N){const T=N.getPreviousSibling(),P=N.getNextSibling();T!==null&&bn(T),P!==null&&bn(P)})(this);const w=d.getWritable(),C=this.getIndexWithinParent();x?(w.splice(C,0,y),this.remove()):w.splice(C,1,y),O(v)&&jn(v,d,C,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||D(50);const r=this.__key,o=e.__key,i=this.__text,s=i.length;We()===o&&re(r);const l=L();if(O(l)){const h=l.anchor,d=l.focus;h!==null&&h.key===o&&(Ui(h,t,r,e,s),l.dirty=!0),d!==null&&d.key===o&&(Ui(d,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+i:i+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Kl(n){return{forChild:Hr(n.style),node:null}}function Ul(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Hr(e.style,t?void 0:"bold"),node:null}}const Ri=new WeakMap;function Vl(n){return n.nodeName==="PRE"||n.nodeType===It&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function Jl(n){const e=n;n.parentElement===null&&D(129);let t=e.textContent||"";if(function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=Ri.get(i))===void 0&&!Vl(i);)s.push(i),i=i.parentNode;const l=o===void 0?i:o;for(let a=0;a<s.length;a++)Ri.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const l=r[s];l===`
35
35
  `||l===`\r
36
- `?i.push(it()):l===" "?i.push(en()):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=zo(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=zo(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 zo(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===Ft){const o=t.style.display;if(o===""&&!Rr(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===Ke)return t;if(t.nodeName==="BR")return null}}const oa={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Je(n){const e=oa[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:ri(n.style,e),node:null}}function ie(n=""){return Kt(new vt(n))}function D(n){return n instanceof vt}function ri(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=>(D(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 vt{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=en();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 en(){return Kt(new Qt)}function sa(n){return n instanceof Qt}class la{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,nn()||(Ue()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function Ee(n,e,t){return new la(n,e,t)}function ii(n,e){let t=e.__key,r=n.offset,i="element";if(D(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!C(e)){const o=e.getNextSibling();if(D(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 Ko(n,e){if(C(e)){const t=e.getLastDescendant();C(t)||D(t)?ii(n,t):ii(n,e)}else ii(n,e)}function Ye(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Un{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 Un(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(D(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 nn()||(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 He}class He{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 f=l.getDescendantByIndex(c);l=f??l}if(C(a)){let f=a.getDescendantByIndex(u);f!==null&&f!==l&&a.getChildAtIndex(u)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?C(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),nn()||(this._cachedNodes=d),d}setTextNodeRange(e,t,r,i){Ye(this.anchor,e.__key,t,"text"),Ye(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]=oi(this);let c="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(C(f)&&!f.isInline())u||(c+=`
37
- `),u=!f.isEmpty();else if(u=!1,D(f)){let h=f.getTextContent();f===t?f===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):f===r&&(h=s?h.slice(0,a):h.slice(0,l)),c+=h}else!U(f)&&!Zt(f)||f===r&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){const t=G(),r=t.getEditorState()._selection,i=qo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;Ye(this.anchor,o.key,o.offset,o.type),Ye(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new He(Ee(e.key,e.offset,e.type),Ee(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Or(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
+ `?o.push(et()):l===" "?o.push(Ht()):l!==""&&o.push(oe(l))}return{node:o}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,o=!0;for(;r!==null&&(r=Ii(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(t=t.slice(1)),o=!1;break}}o&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,o=!0;for(;r!==null&&(r=Ii(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:oe(t)}}function Ii(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const i=t.parentElement;if(i===null)return null;t=i}if(t=r,t.nodeType===It){const i=t.style.display;if(i===""&&!Dr(t)||i!==""&&!i.startsWith("inline"))return null}let o=t;for(;(o=e?t.firstChild:t.lastChild)!==null;)t=o;if(t.nodeType===Be)return t;if(t.nodeName==="BR")return null}}const Yl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function $e(n){const e=Yl[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Hr(n.style,e),node:null}}function oe(n=""){return Tn(new _t(n))}function R(n){return n instanceof _t}function Hr(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),o=t==="700"||t==="bold",i=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(R(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!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 _t{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=Ht();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){D(126)}setDetail(e){D(127)}setMode(e){D(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Ht(){return Tn(new qt)}function ql(n){return n instanceof qt}class Hl{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 o=this.offset,i=e.offset;if(b(t)){const s=t.getDescendantByIndex(o);t=s??t}if(b(r)){const s=r.getDescendantByIndex(i);r=s??r}return t===r?o<i:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&D(20),e}set(e,t,r){const o=this._selection,i=this.key;this.key=e,this.offset=t,this.type=r,Xt()||(We()===i&&re(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0))}}function Ee(n,e,t){return new Hl(n,e,t)}function Gr(n,e){let t=e.__key,r=n.offset,o="element";if(R(e)){o="text";const i=e.getTextContentSize();r>i&&(r=i)}else if(!b(e)){const i=e.getNextSibling();if(R(i))t=i.__key,r=0,o="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,o)}function Fi(n,e){if(b(e)){const t=e.getLastDescendant();b(t)||R(t)?Gr(n,t):Gr(n,e)}else Gr(n,e)}function Ke(n,e,t,r){n.key=e,n.offset=t,n.type=r}class An{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!xe(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(o=>r.has(o))}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 An(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,o=t[r-1];let i;if(R(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.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 o of t){const i=se(o);i!==null&&r.push(i)}return Xt()||(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 Ue}class Ue{constructor(e,t,r,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=o,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,o=t.isBefore(r),i=o?t:r,s=o?r:t;let l=i.getNode(),a=s.getNode();const c=i.offset,u=s.offset;if(b(l)){const d=l.getDescendantByIndex(c);l=d??l}if(b(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let h;return h=l.is(a)?b(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Xt()||(this._cachedNodes=h),h}setTextNodeRange(e,t,r,o){Ke(this.anchor,e.__key,t,"text"),Ke(this.focus,r.__key,o,"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],o=this.anchor,i=this.focus,s=o.isBefore(i),[l,a]=Xr(this);let c="",u=!0;for(let h=0;h<e.length;h++){const d=e[h];if(b(d)&&!d.isInline())u||(c+=`
37
+ `),u=!d.isEmpty();else if(u=!1,R(d)){let f=d.getTextContent();d===t?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(f=l<a?f.slice(l,a):f.slice(a,l)):f=s?f.slice(l):f.slice(a):d===r&&(f=s?f.slice(0,a):f.slice(0,l)),c+=f}else!U(d)&&!pt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=H(),r=t.getEditorState()._selection,o=Wi(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(o===null)return;const[i,s]=o;Ke(this.anchor,i.key,i.offset,i.type),Ke(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Ue(Ee(e.key,e.offset,e.type),Ee(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=br(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Oe[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],o=t.length;for(let i=0;i<o;i++){const s=t[i];s===`
38
38
  `||s===`\r
39
- `?r.push(it()):s===" "?r.push(en()):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 w=_.getNode(),k=w.getChildAtIndex(_.offset),S=ie(),P=oe(w)?Ne().append(S):S;S.setFormat(y),S.setStyle(x),k===null?w.append(P):k.insertBefore(P),_.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(),d=u.length;let f=u[0];D(f)||A(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let m=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(s.key,c,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let _=f.getNextSibling();if(D(_)&&_.canInsertTextBefore()&&!Ae(_)||(_=ie(),_.setFormat(i),_.setStyle(o),g.canInsertTextAfter()?f.insertAfter(_):g.insertAfter(_)),_.select(0,0),f=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let _=f.getPreviousSibling();if(D(_)&&!Ae(_)||(_=ie(),_.setFormat(i),g.canInsertTextBefore()?f.insertBefore(_):g.insertBefore(_)),_.select(),f=_,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const _=ie(f.getTextContent());_.setFormat(i),f.replace(_),f=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||C(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Ho(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const x=ie(e);return x.select(),void f.replace(x)}const _=f.getFormat(),v=f.getStyle();if(a!==c||_===i&&v===o){if(sa(f)){const x=ie(e);return x.setFormat(i),x.setStyle(o),x.select(),void f.replace(x)}}else{if(f.getTextContent()!==""){const x=ie(e);if(x.setFormat(i),x.setStyle(o),x.select(),a===0)f.insertBefore(x,!1);else{const[w]=f.splitText(a);w.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(o)}const y=c-a;f=f.spliceText(a,y,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...f.getParentKeys(),...m.getParentKeys()]),v=C(f)?f:f.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(D(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const E=ie(m.getTextContent());m.replace(E),m=E}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const E=m.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?m.remove():E.remove()}else _.add(m.__key);const w=y.getChildren(),k=new Set(u),S=v.is(y),P=v.isInline()&&f.getNextSibling()===null?v:f;for(let E=w.length-1;E>=0;E--){const T=w[E];if(T.is(f)||C(T)&&T.isParentOf(f))break;T.isAttached()&&(!k.has(T)||T.is(x)?S||P.insertAfter(T,!1):T.remove())}if(!S){let E=y,T=null;for(;E!==null;){const M=E.getChildren(),R=M.length;(R===0||M[R-1].is(T))&&(_.delete(E.__key),T=E),E=E.getParent()}}if(f.isToken())if(a===h)f.select();else{const E=ie(e);E.select(),f.replace(E)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let E=1;E<d;E++){const T=u[E],M=T.__key;_.has(M)||T.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)D(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,d=r[0],f=a.type==="element"?0:a.offset;if(a.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=d.getFormatFlags(e,null),g=i-1;let m=r[g];const _=c.type==="text"?c.offset:m.getTextContentSize();if(d.is(m)){if(f===_)return;if(Ae(d)||f===0&&_===d.getTextContentSize())d.setFormat(h);else{const y=d.splitText(f,_),x=f===0?y[0]:y[1];x.setFormat(h),a.type==="text"&&a.set(x.__key,0,"text"),c.type==="text"&&c.set(x.__key,_-f,"text")}return void(this.format=h)}f===0||Ae(d)||([,d]=d.splitText(f),f=0),d.setFormat(h);const v=m.getFormatFlags(e,h);_>0&&(_===m.getTextContentSize()||Ae(m)||([m]=m.splitText(_)),m.setFormat(v));for(let y=u+1;y<g;y++){const x=r[y],w=x.getFormatFlags(e,v);x.setFormat(w)}a.type==="text"&&a.set(d.__key,f,"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=F();return O(h)||A(134),h.insertNodes(e)}const t=Wr((this.isBackward()?this.focus:this.anchor).getNode(),_t),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=ai(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=ai(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=Zt(v);if(y||U(v)&&v.isInline()||C(v)&&v.isInline()||D(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)&&_t(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 w of y)x=x.insertAfter(w)}(t,c);const d=Wr(o,_t);l&&C(d)&&(l.canMergeWhenEmpty()||_t(a))&&(d.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const f=C(t)?t.getLastChild():null;Zt(f)&&d!==t&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Ne();return Z().splice(this.anchor.offset,0,[s]),s.select(),s}const e=ai(this),t=Wr(this.anchor.getNode(),_t);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=it();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]=oi(this);if(t===0)return[];if(t===1){if(D(s)&&!this.isCollapsed()){const d=a>c?c:a,f=a>c?a:c,h=s.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[s]}const u=i.isBefore(o);if(D(s)){const d=u?a:c;d===s.getTextContentSize()?e.shift():d!==0&&([,s]=s.splitText(d),e[0]=s)}if(D(l)){const d=l.getTextContent().length,f=u?c:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=zt(i,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Xo();return h.add(l.__key),void Se(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(D(f)){const h=f.__key,g=t?f.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(f)?(m=f.__key,g=t?f.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=ke(a._window);if(!c)return;const u=a._blockCursorElement,d=a._rootElement;if(d===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||$r(u,a,d),function(f,h,g,m){f.modify(h,g,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const f=c.getRangeAt(0),h=this.anchor.getNode(),g=oe(h)?h:Ul(h);if(this.applyDOMRange(f),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let y=0;y<m.length;y++){const x=m[y];Ir(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===f.startContainer&&c.anchorOffset===f.startOffset||function(y){const x=y.focus,w=y.anchor,k=w.key,S=w.offset,P=w.type;Ye(w,x.key,x.offset,x.type),Ye(x,k,S,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=zt(o,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Xo();l.add(s.__key),Se(l)}else s.remove(),G().dispatchCommand(gn,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 Vo(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 Vo(i,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,m=d.offset,_=g<m,v=_?g:m,y=_?m:g,x=y-1;v!==x&&(ao(f.getTextContent().slice(v,y))||(c?d.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 Un}function Uo(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function oi(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]:[Uo(t),Uo(r)]}function Vo(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===Ft){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],d=!1;if(u===c)u=l[o+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&o--}if(i=pt(u),D(i))o=lo(i,s);else{let f=pt(n);if(f===null)return null;if(C(f)){o=Math.min(f.getChildrenSize(),o);let h=f.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?f=h:(h=g,f=C(h)?h:h.getParentOrThrow()),o=0}D(h)?(i=h,f=null,o=lo(h,s)):h!==f&&s&&!d&&o++}else{const h=f.getIndexWithinParent();o=e===0&&U(f)&&pt(n)===f?h:h+1,f=f.getParentOrThrow()}if(C(f))return Ee(f.__key,o,"element")}}else i=pt(n);return D(i)?Ee(i.__key,o,"text"):null}function Yo(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();D(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"):D(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();D(l)&&(n.key=l.__key,n.offset=0)}}}function Ho(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Yo(n,r,i),Yo(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;Ye(n,s.key,s.offset,s.type),Ye(e,l.key,l.offset,l.type)}}}function qo(n,e,t,r,i,o){if(n===null||t===null||!Mt(i,n,t))return null;const s=Jo(n,e,O(o)?o.anchor:null,i);if(s===null)return null;const l=Jo(t,r,O(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=pt(n),c=pt(t);if(U(a)&&U(c))return null}return Ho(s,l,o),[s,l]}function si(n){return C(n)&&!n.isInline()}function Go(n,e,t,r,i,o){const s=Fe(),l=new He(Ee(n,e,i),Ee(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function aa(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new He(n,e,0,"")}function Xo(){return new Un(new Set)}function li(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=!kr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,d,f;if(O(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&O(n)&&!Mt(t,c,u))return n.clone();const h=qo(c,d,u,f,t,n);if(h===null)return null;const[g,m]=h;return new He(g,m,O(n)?n.format:0,O(n)?n.style:"")}function F(){return Fe()._selection}function tn(){return G()._editorState._selection}function Vn(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,d=u.getNode(),f=c?i:o,h=f.getNode();if(e.is(d)){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=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(a,Math.max(0,g+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(D(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(D(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(D(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Jn(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,D(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,D(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 ca(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has("collaboration")&&d!==o||d!==null&&Nr(d))return;if(!O(e))return void(n!==null&&Mt(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,m=h.key,_=On(t,g),v=On(t,m),y=f.offset,x=h.offset,w=e.format,k=e.style,S=e.isCollapsed();let P=_,E=v,T=!1;if(f.type==="text"){P=En(_);const H=f.getNode();T=H.getFormat()!==w||H.getStyle()!==k}else O(n)&&n.anchor.type==="text"&&(T=!0);var M,R,q,Y,W;if(h.type==="text"&&(E=En(v)),P!==null&&E!==null&&(S&&(n===null||T||O(n)&&(n.format!==w||n.style!==k))&&(M=w,R=k,q=y,Y=g,W=performance.now(),Po=[M,R,q,Y,W]),c!==y||u!==x||l!==P||a!==E||r.type==="Range"&&S||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{r.setBaseAndExtent(P,y,E,x)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const H=e instanceof He&&e.anchor.type==="element"?P.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(H!==null){let ce;if(H instanceof Text){const $e=document.createRange();$e.selectNode(H),ce=$e.getBoundingClientRect()}else ce=H.getBoundingClientRect();(function($e,Ge,cn){const un=cn.ownerDocument,fn=un.defaultView;if(fn===null)return;let{top:Tt,bottom:Et}=Ge,Nt=0,Pt=0,me=cn;for(;me!==null;){const ct=me===un.body;if(ct)Nt=0,Pt=jn($e).innerHeight;else{const Xe=me.getBoundingClientRect();Nt=Xe.top,Pt=Xe.bottom}let Pe=0;if(Tt<Nt?Pe=-(Nt-Tt):Et>Pt&&(Pe=Et-Pt),Pe!==0)if(ct)fn.scrollBy(0,Pe);else{const Xe=me.scrollTop;me.scrollTop+=Pe;const ut=me.scrollTop-Xe;Tt-=ut,Et-=ut}if(ct)break;me=Dn(me)}})(t,ce,o)}}Xr=!0}}function ua(n){let e=F()||tn();e===null&&(e=Z().selectEnd()),e.insertNodes(n)}function ai(n){let e=n;n.isCollapsed()||e.removeText();const t=F();O(t)&&(e=t),O(e)||A(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!_t(i);)[i,o]=fa(i,o);return o}function fa(n,e){const t=n.getParent();if(!t){const i=Ne();return Z().append(i),i.select(),[Z(),0]}if(D(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 He(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,de=!1,ci=!1,Yn=0;const es={characterData:!0,childList:!0,subtree:!0};function nn(){return de||te!==null&&te._readOnly}function he(){de&&A(13)}function ts(){Yn>99&&A(14)}function Fe(){return te===null&&A(195,ns()),te}function G(){return ne===null&&A(196,ns()),ne}function ns(){let n=0;const e=new Set,t=qn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=Tn(i);if(Pr(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 da(){return ne}function rs(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 is(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function ha(n){return ui(n,G()._nodes)}function ui(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=ui(s[l],e);o.append(a)}return o}function os(n,e,t){const r=te,i=de,o=ne;te=e,de=!0,ne=n;try{return t()}finally{te=r,de=i,ne=o}}function qe(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!==Qe,c=te,u=de,d=ne,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){ne=n,te=t,de=!1,n._updating=!0;try{const S=n._dirtyType,P=n._dirtyElements,E=n._dirtyLeaves;h.disconnect(),g=Zl(o,t,n,S,P,E)}catch(S){if(S instanceof Error&&n._onError(S),ci)throw S;return fs(n,null,r,t),Gi(n),n._dirtyType=gt,ci=!0,qe(n,o),void(ci=!1)}finally{h.observe(r,es),n._updating=f,te=c,de=u,ne=d}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,y=n._updateTags,x=n._deferred;a&&(n._dirtyType=Qe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,P){const E=S._decorators;let T=S._pendingDecorators||E;const M=P._nodeMap;let R;for(R in T)M.has(R)||(T===E&&(T=io(S)),delete T[R])}(n,t);const w=i?null:ke(n._window);if(n._editable&&w!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const S=n._blockCursorElement;S!==null&&$r(S,n,r),ca(s,l,n,w,y,r)}Vl(n,r,l),h!==null&&h.observe(r,es)}finally{ne=d,te=c}}g!==null&&function(S,P,E,T,M){const R=Array.from(S._listeners.mutation),q=R.length;for(let Y=0;Y<q;Y++){const[W,H]=R[Y],ce=P.get(H);ce!==void 0&&W(ce,{dirtyLeaves:T,prevEditorState:M,updateTags:E})}}(n,g,y,m,o),O(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(gn,void 0);const k=n._pendingDecorators;k!==null&&(n._decorators=k,n._pendingDecorators=null,rn("decorator",n,!0,k)),function(S,P,E){const T=oo(P),M=oo(E);T!==M&&rn("textcontent",S,!0,M)}(n,e||o,t),rn("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||o,tags:y}),function(S,P){if(S._deferred=[],P.length!==0){const E=S._updating;S._updating=!0;try{for(let T=0;T<P.length;T++)P[T]()}finally{S._updating=E}}}(n,x),function(S){const P=S._updates;if(P.length!==0){const E=P.shift();if(E){const[T,M]=E;as(S,T,M)}}}(n)}function rn(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 ss(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=ss(n,e,t)}),i}const r=Dr(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 ls(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 as(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 Hn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const d=te,f=de,h=ne,g=n._updating;te=c,de=!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,w=ke(y._window);return O(x)||x==null?li(x,w,y,null):x.clone()}(n));const _=n._compositionKey;e(),s=ls(n,s),function(y,x){const w=x.getEditorState()._selection,k=y._selection;if(O(k)){const S=k.anchor,P=k.focus;let E;if(S.type==="text"&&(E=S.getNode(),E.selectionTransform(w,k)),P.type==="text"){const T=P.getNode();E!==T&&T.selectionTransform(w,k)}}}(c,n),n._dirtyType!==Qe&&(s?function(y,x){const w=x._dirtyLeaves,k=y._nodeMap;for(const S of w){const P=k.get(S);D(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&Qi(P)}}(c,n):function(y,x){const w=x._dirtyLeaves,k=x._dirtyElements,S=y._nodeMap,P=Ue(),E=new Map;let T=w,M=T.size,R=k,q=R.size;for(;M>0||q>0;){if(M>0){x._dirtyLeaves=new Set;for(const Y of T){const W=S.get(Y);D(W)&&W.isAttached()&&W.isSimpleText()&&!W.isUnmergeable()&&Qi(W),W!==void 0&&is(W,P)&&rs(x,W,E),w.add(Y)}if(T=x._dirtyLeaves,M=T.size,M>0){Yn++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map;for(const Y of R){const W=Y[0],H=Y[1];if(W!=="root"&&!H)continue;const ce=S.get(W);ce!==void 0&&is(ce,P)&&rs(x,ce,E),k.set(W,H)}T=x._dirtyLeaves,M=T.size,R=x._dirtyElements,q=R.size,Yn++}x._dirtyLeaves=w,x._dirtyElements=k}(c,n),ls(n),function(y,x,w,k){const S=y._nodeMap,P=x._nodeMap,E=[];for(const[T]of k){const M=P.get(T);M!==void 0&&(M.isAttached()||(C(M)&&xo(M,T,S,P,E,k),S.has(T)||k.delete(T),E.push(T)))}for(const T of E)P.delete(T);for(const T of w){const M=P.get(T);M===void 0||M.isAttached()||(S.has(T)||w.delete(T),P.delete(T))}}(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,w=v.focus.key;y.get(x)!==void 0&&y.get(w)!==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=gt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void qe(n)}finally{te=d,de=f,ne=h,n._updating=g,Yn=0}n._dirtyType!==Qe||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,qe(n)):u&&Rl(()=>{qe(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function ge(n,e,t){n._updating?n._updates.push([e,t]):as(n,e,t)}class on extends Bn{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 Ol[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(D(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=Yi[e];return!!(this.getFormat()&t)}return!1}select(e,t){he();const r=F();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(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(D(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):Go(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!==""?Yi[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 d=null,f=o-t+i;if(e!==0)if(e===o)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let m=0;m<t;m++){g===null&&A(100);const _=g.getNextSibling(),v=g.__key;et(g.getWritable()),c.push(v),g=_}}let h=d;for(let g=0;g<i;g++){const m=r[g];h!==null&&m.is(h)&&(d=h=h.getPreviousSibling());const _=m.getWritable();_.__parent===l&&f--,et(_);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=f,c.length){const g=F();if(O(g)){const m=new Set(c),_=new Set(a),{anchor:v,focus:y}=g;cs(v,m,_)&&Jn(v,v.getNode(),this,d,u),cs(y,m,_)&&Jn(y,y.getNode(),this,d,u),f!==0||this.canBeEmpty()||mt(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 on}function cs(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 ga extends Bn{constructor(e){super(e)}decorate(e,t){A(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof ga}class sn extends on{static getType(){return"root"}static clone(){return new sn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){A(51)}getTextContent(){const e=this.__cachedText;return!nn()&&G()._dirtyType!==Qe||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=Z();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 sn}function fi(){return new Hn(new Map([["root",new sn]]))}function us(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=us(i[o]);r.push(s)}}return e}class Hn{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 os(t&&t.editor||null,this,e)}clone(e){const t=new Hn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return os(null,this,()=>({root:us(Z())}))}}class di extends on{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class bt extends on{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 bt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=Bt(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:pa,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&An(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||D(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 pa(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 Kt(new bt)}function hi(n){return n instanceof bt}const K=0,ma=4;function fs(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=fi(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Qe,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 _a(n){const e=n||{},t=da(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=fi(),l=e.namespace||(i!==null?i._config.namespace:co()),a=e.editorState,c=[sn,vt,Xt,Qt,bt,di,...e.nodes||[]],{onError:u,html:d}=e,f=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 S=_;_=S.replace,v=S.with,y=S.withKlass||null}const x=_.getType(),w=_.transform(),k=new Set;w!==null&&k.add(w),h.set(x,{exportDOM:d&&d.export?d.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:y,transforms:k})}}const g=new qn(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,y=new Set,x=w=>{Object.keys(w).forEach(k=>{let S=v.get(k);S===void 0&&(S=[],v.set(k,S)),S.push(w[k])})};return m.forEach(w=>{const k=w.klass.importDOM;if(k==null||y.has(k))return;y.add(k);const S=k.call(w.klass);S!==null&&x(S)}),_&&x(_),v}(h,d?d.import:void 0),f);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=gt),g}class qn{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=Qe,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=co(),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=ql(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=Fe();if(a.isEmpty())return;if(l==="root")return void Z().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=Bt(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,fs(this,t,e,i),t!==null&&(this._config.disableEvents||Ql(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=gt,Gi(this),this._updateTags.add("history-merge"),qe(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=Wn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",Io),Wn.set(c,(u||0)+1),l.__lexicalEditor=a;const d=Lo(l);for(let f=0;f<Gr.length;f++){const[h,g]=Gr[f],m=typeof g=="function"?_=>{Mo(_)||(Fo(_),(a.isEditable()||h==="click")&&g(_,a))}:_=>{if(Mo(_))return;Fo(_);const v=a.isEditable();switch(h){case"cut":return v&&I(a,gr,_);case"copy":return I(a,xn,_);case"paste":return v&&I(a,fr,_);case"dragstart":return v&&I(a,Bi,_);case"dragover":return v&&I(a,zi,_);case"dragend":return v&&I(a,hl,_);case"focus":return v&&I(a,ml,_);case"blur":return v&&I(a,_l,_);case"drop":return v&&I(a,Wi,_)}};l.addEventListener(h,m),d.push(()=>{l.removeEventListener(h,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;rn("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&A(38),qi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),qe(this)),this._pendingEditorState=e,this._dirtyType=gt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),qe(this)}parseEditorState(e,t){return function(r,i,o){const s=fi(),l=te,a=de,c=ne,u=i._dirtyElements,d=i._dirtyLeaves,f=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,de=!1,ne=i;try{const g=i._nodes;ui(r.root,g),o&&o(),s._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=d,i._cloneNotNeeded=f,i._dirtyType=h,te=l,de=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return qe(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=F(),o=Z();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=ke(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,rn("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}qn.version="0.17.1+prod.esm";const pu="";function ya(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xa=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.`)});const ds=j.createContext(null);function va(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function ot(){const n=j.useContext(ds);return n==null&&xa(8),n}const hs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ba=hs?j.useLayoutEffect:j.useEffect,Gn={tag:"history-merge"};function Ca({initialConfig:n,children:e}){const t=j.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=va(null,r),u=_a({editable:n.editable,html:a,namespace:i,nodes:o,onError:d=>s(d,u),theme:r});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=Z();if(h.isEmpty()){const g=Ne();h.append(g);const m=hs?document.activeElement:null;(F()!==null||m!==null&&m===d.getRootElement())&&g.select()}},Gn);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,Gn);break}case"object":d.setEditorState(f,Gn);break;case"function":d.update(()=>{Z().isEmpty()&&f(d)},Gn)}}}(u,l),[u,c]},[]);return ba(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),b.jsx(ds.Provider,{value:t,children:e})}function wa({defaultSelection:n}){const[e]=ot();return j.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 Sa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ka=Sa(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 Xn=new Map;function gs(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 gi(n){let e=Xn.get(n);return e===void 0&&(e=gs(n),Xn.set(n,e)),e}function ps(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,d]=oi(n),f=s.is(l),h=e.is(o?l:s),g=e.is(o?s:l);let m,_=0;return f?(_=u>d?d:u,m=u>d?u:d):h?(_=o?d:u,m=void 0):g&&(_=0,m=o?u:d),e.__text=e.__text.slice(_,m),e}}return e}function ms(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return C(e)||ka(177),n.offset===e.getChildrenSize()}function Ta(n){const e=n.getStyle(),t=gs(e);Xn.set(e,t)}function Ct(n,e){const t=gi("getStyle"in n?n.getStyle():n.style),r=Object.entries(e).reduce((o,[s,l])=>(typeof l=="function"?o[s]=l(t[s],n):l===null?delete o[s]:o[s]=l,o),{...t}),i=function(o){let s="";for(const l in o)l&&(s+=`${l}: ${o[l]};`);return s}(r);n.setStyle(i),Xn.set(i,r)}function Ea(n,e){const t=n.getNodes(),r=t.length,i=n.getStartEndPoints();if(i===null)return;const[o,s]=i,l=r-1;let a=t[0],c=t[l];if(n.isCollapsed()&&O(n))return void Ct(n,e);const u=a.getTextContent().length,d=s.offset;let f=o.offset;const h=o.isBefore(s);let g=h?f:d,m=h?d:f;const _=h?o.type:s.type,v=h?s.type:o.type,y=h?s.key:o.key;if(D(a)&&g===u){const x=a.getNextSibling();D(x)&&(f=0,g=0,a=x)}if(t.length===1){if(D(a)&&a.canHaveFormat()){if(g=_==="element"?0:f>d?d:f,m=v==="element"?u:f>d?f:d,g===m)return;if(Ae(a)||g===0&&m===u)Ct(a,e),a.select(g,m);else{const x=a.splitText(g,m),w=g===0?x[0]:x[1];Ct(w,e),w.select(0,m-g)}}}else{if(D(a)&&g<a.getTextContentSize()&&a.canHaveFormat()&&(g===0||Ae(a)||(a=a.splitText(g)[1],g=0,h?o.set(a.getKey(),g,"text"):s.set(a.getKey(),g,"text")),Ct(a,e)),D(c)&&c.canHaveFormat()){const x=c.getTextContent().length;c.__key!==y&&m!==0&&(m=x),m===x||Ae(c)||([c]=c.splitText(m)),m===0&&v!=="element"||Ct(c,e)}for(let x=1;x<l;x++){const w=t[x],k=w.getKey();D(w)&&w.canHaveFormat()&&k!==a.getKey()&&k!==c.getKey()&&!w.isToken()&&Ct(w,e)}}}function _s(n,e){const t=zt(n.focus,e);return U(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function Na(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ys(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function xs(n,e,t){const r=ys(n);Na(n,e,t?!r:r,"character")}function Pa(n,e,t){const r=gi(n.getStyle());return r!==null&&r[e]||t}function Oa(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=gi(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const d=i[u];if((u===0||a!==0||!d.is(c))&&D(d)){const f=Pa(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function Da(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ja=Da(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 vs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Aa=vs&&"documentMode"in document?document.documentMode:null;!(!vs||!("InputEvent"in window)||Aa)&&"getTargetRanges"in new window.InputEvent("input");function La(...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 wt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Ia(n,...e){const t=La(...e);t.length>0&&n.classList.add(...t)}function Fa(n){const e=Zn(n,t=>C(t)&&!t.isInline());return C(e)||ja(4,n.__key),e}const Zn=(n,e)=>{let t=n;for(;t!==Z()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function st(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const Qn=0,pi=1,mi=2,we=0,Ma=1,bs=2,$a=3,Ra=4;function Wa(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 Ma;if(!(O(o)&&O(s)&&s.isCollapsed()&&o.isCollapsed()))return we;const l=function(v,y,x){const w=v._nodeMap,k=[];for(const S of y){const P=w.get(S);P!==void 0&&k.push(P)}for(const[S,P]of x){if(!P)continue;const E=w.get(S);E===void 0||oe(E)||k.push(E)}return k}(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)&&D(y)&&y.__text.length===1&&o.anchor.offset===1?bs:we}const a=l[0],c=n._nodeMap.get(a.__key);if(!D(c)||!D(a)||c.__mode!==a.__mode)return we;const u=c.__text,d=a.__text;if(u===d)return we;const f=o.anchor,h=s.anchor;if(f.key!==h.key||f.type!=="text")return we;const g=f.offset,m=h.offset,_=d.length-u.length;return _===1&&m===g-1?bs:_===-1&&m===g+1?$a:_===-1&&m===g?Ra:we}function Ba(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,mi;const d=Wa(i,o,l,a,n.isComposing()),f=(()=>{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 pi;const m=o._selection;return l.size>0||a.size>0?g===!1&&d!==we&&d===r&&u<t+e&&h||l.size===1&&function(_,v,y){const x=v._nodeMap.get(_),w=y._nodeMap.get(_),k=v._selection,S=y._selection;return!(O(k)&&O(S)&&k.anchor.type==="element"&&k.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!D(x)||!D(w)||x.__parent!==w.__parent)&&JSON.stringify(v.read(()=>x.exportJSON()))===JSON.stringify(y.read(()=>w.exportJSON()))}(Array.from(l)[0],i,o)?Qn:pi:m!==null?Qn:mi})();return t=u,r=d,f}}function Cs(n){n.undoStack=[],n.redoStack=[],n.current=null}function za(n,e,t){const r=Ba(n,t);return wt(n.registerCommand(mn,()=>(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(Lt,!0)),a.length===0&&o.dispatchCommand(It,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(_n,()=>(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(It,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Lt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(gl,()=>(Cs(e),!1),K),n.registerCommand(pl,()=>(Cs(e),n.dispatchCommand(Lt,!1),n.dispatchCommand(It,!1),!0),K),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,d=e.redoStack,f=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===pi)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Lt,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(It,!0));else if(g===mi)return;e.current={editor:n,editorState:o}}))}function Ka(){return{current:null,redoStack:[],undoStack:[]}}function Ua({delay:n,externalHistoryState:e}){const[t]=ot();return function(r,i,o=1e3){const s=j.useMemo(()=>i||Ka(),[i]);j.useEffect(()=>za(r,s,o),[o,r,s])}(t,e,n),null}const Va=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?j.useLayoutEffect:j.useEffect;function Ja(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Ya(){return function(n){const[e]=ot(),t=j.useMemo(()=>n(e),[e,n]),r=j.useRef(t.initialValueFn()),[i,o]=j.useState(r.current);return Va(()=>{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}(Ja)}function Ha(){return Z().getTextContent()}function qa(n,e=!0){if(n)return!1;let t=Ha();return e&&(t=t.trim()),t===""}function Ga(n){if(!qa(n,!1))return!1;const e=Z().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(!hi(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(!D(a))return!1}}}return!0}function ws(n){return()=>Ga(n)}function Xa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}Xa(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 Za(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,d,f,h,g]=a;n.update(()=>{const m=F();if(O(m)){const _=m.anchor;let v=_.getNode(),y=0,x=0;if(D(v)&&c>=0&&u>=0&&(y=c,x=c+u,m.setTextNodeRange(v,y,v,x)),y===x&&d===""||(m.insertRawText(d),v=_.getNode()),D(v)){y=f,x=f+h;const w=v.getTextContentSize();y=y>w?w:y,x=x>w?w: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(!ks.has(s.nodeName)){const l=Ts(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof di&&s.insertAfter(it());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function ec(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=Z().getChildren();for(let i=0;i<r.length;i++)Ss(n,r[i],t,e);return t.innerHTML}function Ss(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=Br(e);h=D(h)&&r!==null?ps(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:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],m=Ss(n,g,f,r);!i&&C(e)&&m&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!o){if(An(u)&&u.append(f),t.append(u),d){const h=d.call(s,u);h&&u.replaceWith(h)}}else t.append(f);return i}const ks=new Set(["STYLE","SCRIPT"]);function Ts(n,e,t,r,i=new Map,o){let s=[];if(ks.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 w=x(g);w!==null&&(y===null||(y.priority||0)<(w.priority||0))&&(y=w)}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 d=n.childNodes;let f=[];const h=(l==null||!mt(l))&&(l!=null&&si(l)||r);for(let g=0;g<d.length;g++)f.push(...Ts(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),Ln(n)&&(f=tc(n,f,h?()=>{const g=new di;return t.push(g),g}:Ne)),l==null?f.length>0?s=s.concat(f):Ln(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Rr(g.nextSibling)&&Rr(g.previousSibling)}(n)&&(s=s.concat(it())):C(l)&&l.append(...f),s}function tc(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(si(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&si(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function nc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var er=nc(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 rc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Es=n=>rc?(n||window).getSelection():null;function ic(n,e=F()){return e==null&&er(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":ec(n,e)}function oc(n,e=F()){return e==null&&er(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(sc(n,e))}function Ns(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 Ps(t,lc(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return Ps(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=F();if(O(a)){const c=s[l];c===`
39
+ `?r.push(et()):s===" "?r.push(Ht()):r.push(oe(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,o=this.format,i=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(m,x,v,y){const S=m.getNode(),w=S.getChildAtIndex(m.offset),C=oe(),N=ie(S)?Te().append(C):C;C.setFormat(v),C.setStyle(y),w===null?S.append(N):w.insertBefore(N),m.is(x)&&x.set(C.__key,0,"text"),m.set(C.__key,0,"text")}(s,l,o,i);const a=s.offset;let c=l.offset;const u=this.getNodes(),h=u.length;let d=u[0];R(d)||D(26);const f=d.getTextContent().length,g=d.getParentOrThrow();let _=u[h-1];if(h===1&&l.type==="element"&&(c=f,l.set(s.key,c,"text")),this.isCollapsed()&&a===f&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(R(m)&&m.canInsertTextBefore()&&!ct(m)||(m=oe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(R(m)&&!ct(m)||(m=oe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==f){const m=oe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&e!==""){const m=_.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||b(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),Bi(this.anchor,this.focus,null),void this.insertText(e)}if(h===1){if(d.isToken()){const y=oe(e);return y.select(),void d.replace(y)}const m=d.getFormat(),x=d.getStyle();if(a!==c||m===o&&x===i){if(ql(d)){const y=oe(e);return y.setFormat(o),y.setStyle(i),y.select(),void d.replace(y)}}else{if(d.getTextContent()!==""){const y=oe(e);if(y.setFormat(o),y.setStyle(i),y.select(),a===0)d.insertBefore(y,!1);else{const[S]=d.splitText(a);S.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(o),d.setStyle(i)}const v=c-a;d=d.spliceText(a,v,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=x))}else{const m=new Set([...d.getParentKeys(),..._.getParentKeys()]),x=b(d)?d:d.getParentOrThrow();let v=b(_)?_:_.getParentOrThrow(),y=_;if(!x.is(v)&&v.isInline())do y=v,v=v.getParentOrThrow();while(v.isInline());if(l.type==="text"&&(c!==0||_.getTextContent()==="")||l.type==="element"&&_.getIndexWithinParent()<c)if(R(_)&&!_.isToken()&&c!==_.getTextContentSize()){if(_.isSegmented()){const T=oe(_.getTextContent());_.replace(T),_=T}ie(l.getNode())||l.type!=="text"||(_=_.spliceText(0,c,"")),m.add(_.__key)}else{const T=_.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?_.remove():T.remove()}else m.add(_.__key);const S=v.getChildren(),w=new Set(u),C=x.is(v),N=x.isInline()&&d.getNextSibling()===null?x:d;for(let T=S.length-1;T>=0;T--){const P=S[T];if(P.is(d)||b(P)&&P.isParentOf(d))break;P.isAttached()&&(!w.has(P)||P.is(y)?C||N.insertAfter(P,!1):P.remove())}if(!C){let T=v,P=null;for(;T!==null;){const j=T.getChildren(),z=j.length;(z===0||j[z-1].is(P))&&(m.delete(T.__key),P=T),T=T.getParent()}}if(d.isToken())if(a===f)d.select();else{const T=oe(e);T.select(),d.replace(T)}else d=d.spliceText(a,f-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let T=1;T<h;T++){const P=u[T],j=P.__key;m.has(j)||P.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const v of t)R(v)&&r.push(v);const o=r.length;if(o===0)return this.toggleFormat(e),void re(null);const i=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:i,c=l?i:s;let u=0,h=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===h.getTextContentSize()&&(u=1,h=r[1],d=0),h==null)return;const f=h.getFormatFlags(e,null),g=o-1;let _=r[g];const m=c.type==="text"?c.offset:_.getTextContentSize();if(h.is(_)){if(d===m)return;if(ct(h)||d===0&&m===h.getTextContentSize())h.setFormat(f);else{const v=h.splitText(d,m),y=d===0?v[0]:v[1];y.setFormat(f),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,m-d,"text")}return void(this.format=f)}d===0||ct(h)||([,h]=h.splitText(d),d=0),h.setFormat(f);const x=_.getFormatFlags(e,f);m>0&&(m===_.getTextContentSize()||ct(_)||([_]=_.splitText(m)),_.setFormat(x));for(let v=u+1;v<g;v++){const y=r[v],S=y.getFormatFlags(e,x);y.setFormat(S)}a.type==="text"&&a.set(h.__key,d,"text"),c.type==="text"&&c.set(_.__key,m,"text"),this.format=f|x}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const f=L();return O(f)||D(134),f.insertNodes(e)}const t=Rr((this.isBackward()?this.focus:this.anchor).getNode(),ft),r=e[e.length-1];if("__language"in t&&b(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const f=eo(this);t.splice(f,0,e),r.selectEnd()}return}if(!e.some(f=>(b(f)||U(f))&&!f.isInline())){b(t)||D(135);const f=eo(this);return t.splice(f,0,e),void r.selectEnd()}const o=function(f){const g=Te();let _=null;for(let m=0;m<f.length;m++){const x=f[m],v=pt(x);if(v||U(x)&&x.isInline()||b(x)&&x.isInline()||R(x)||x.isParentRequired()){if(_===null&&(_=x.createParentElementNode(),g.append(_),v))continue;_!==null&&_.append(x)}else g.append(x),_=null}return g}(e),i=o.getLastDescendant(),s=o.getChildren(),l=!b(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;b(u=c)&&ft(u)&&!u.isEmpty()&&b(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(b(t)||D(135),t.append(...c.getChildren()),c=s[1]),c&&function(f,g,_){const m=g.getParentOrThrow().getLastChild();let x=g;const v=[g];for(;x!==m;)x.getNextSibling()||D(140),x=x.getNextSibling(),v.push(x);let y=f;for(const S of v)y=y.insertAfter(S)}(t,c);const h=Rr(i,ft);l&&b(h)&&(l.canMergeWhenEmpty()||ft(a))&&(h.append(...l.getChildren()),l.remove()),b(t)&&t.isEmpty()&&t.remove(),i.selectEnd();const d=b(t)?t.getLastChild():null;pt(d)&&h!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Te();return G().splice(this.anchor.offset,0,[s]),s.select(),s}const e=eo(this),t=Rr(this.anchor.getNode(),ft);b(t)||D(136);const r=t.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(e){const t=et();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),o=t.getIndexWithinParent();r.select(o,o)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,o=this.anchor,i=this.focus;let s=e[0],l=e[r];const[a,c]=Xr(this);if(t===0)return[];if(t===1){if(R(s)&&!this.isCollapsed()){const h=a>c?c:a,d=a>c?a:c,f=s.splitText(h,d),g=h===0?f[0]:f[1];return g!=null?[g]:[]}return[s]}const u=o.isBefore(i);if(R(s)){const h=u?a:c;h===s.getTextContentSize()?e.shift():h!==0&&([,s]=s.splitText(h),e[0]=s)}if(R(l)){const h=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==h&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const o=this.focus,i=this.anchor,s=e==="move",l=Bt(o,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const f=$i();return f.add(l.__key),void Ce(f)}const d=t?l.getPreviousSibling():l.getNextSibling();if(R(d)){const f=d.__key,g=t?d.getTextContent().length:0;return o.set(f,g,"text"),void(s&&i.set(f,g,"text"))}{const f=l.getParentOrThrow();let g,_;return b(d)?(_=d.__key,g=t?d.getChildrenSize():0):(g=l.getIndexWithinParent(),_=f.__key,t||g++),o.set(_,g,"element"),void(s&&i.set(_,g,"element"))}}const a=H(),c=we(a._window);if(!c)return;const u=a._blockCursorElement,h=a._rootElement;if(h===null||u===null||!b(l)||l.isInline()||l.canBeEmpty()||Pr(u,a,h),function(d,f,g,_){d.modify(f,g,_)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),f=this.anchor.getNode(),g=ie(f)?f:Il(f);if(this.applyDOMRange(d),this.dirty=!0,!s){const _=this.getNodes(),m=[];let x=!1;for(let v=0;v<_.length;v++){const y=_[v];Tr(y,g)?m.push(y):x=!0}if(x&&m.length>0)if(t){const v=m[0];b(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{const v=m[m.length-1];b(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(v){const y=v.focus,S=v.anchor,w=S.key,C=S.offset,N=S.type;Ke(S,y.key,y.offset,y.type),Ke(y,w,C,N),v._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&b(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const o=t.getParent(),i=t.getNextSibling()||(o===null?null:o.getNextSibling());if(b(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,e))return;const i=this.focus,s=Bt(i,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&b(o)&&o.getChildrenSize()===0){o.remove();const l=$i();l.add(s.__key),Ce(l)}else s.remove(),H().dispatchCommand(ln,void 0);return}if(!e&&b(s)&&b(o)&&o.isEmpty())return o.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=i.type==="text"?i.getNode():null;if(o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=i.offset,c=l.getTextContentSize();if(l.is(o)||e&&a!==c||!e&&a!==0)return void Li(l,e,a)}else if(o!==null&&o.isSegmented()){const a=r.offset,c=o.getTextContentSize();if(o.is(l)||e&&a!==0||!e&&a!==c)return void Li(o,e,a)}(function(a,c){const u=a.anchor,h=a.focus,d=u.getNode(),f=h.getNode();if(d===f&&u.type==="text"&&h.type==="text"){const g=u.offset,_=h.offset,m=g<_,x=m?g:_,v=m?_:g,y=v-1;x!==y&&(ei(d.getTextContent().slice(x,v))||(c?h.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()&&ie(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 xe(n){return n instanceof An}function Mi(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Xr(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]:[Mi(t),Mi(r)]}function Li(n,e,t){const r=n,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,l=0;for(let c=0;c<i;c++){const u=c===i-1;if(l=s,s+=o[c].length,e&&s===t||s>t||u){o.splice(c,1),u&&(l=void 0);break}}const a=o.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function Ai(n,e,t,r){let o,i=e;if(n.nodeType===It){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;i===a&&(s=!0,i=a-1);let u=l[i],h=!1;if(u===c)u=l[i+1],h=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=ut(u),R(o))i=Zo(o,s);else{let d=ut(n);if(d===null)return null;if(b(d)){i=Math.min(d.getChildrenSize(),i);let f=d.getChildAtIndex(i);if(b(f)&&function(g,_,m){const x=g.getParent();return m===null||x===null||!x.canBeEmpty()||x!==m.getNode()}(f,0,t)){const g=s?f.getLastDescendant():f.getFirstDescendant();g===null?d=f:(f=g,d=b(f)?f:f.getParentOrThrow()),i=0}R(f)?(o=f,d=null,i=Zo(f,s)):f!==d&&s&&!h&&i++}else{const f=d.getIndexWithinParent();i=e===0&&U(d)&&ut(n)===d?f:f+1,d=d.getParentOrThrow()}if(b(d))return Ee(d.__key,i,"element")}}else o=ut(n);return R(o)?Ee(o.__key,i,"text"):null}function ji(n,e,t){const r=n.offset,o=n.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(e){if((t||!e)&&i===null&&b(s)&&s.isInline()){const l=s.getPreviousSibling();R(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else b(i)&&!t&&i.isInline()?(n.key=i.__key,n.offset=i.getChildrenSize(),n.type="element"):R(i)&&(n.key=i.__key,n.offset=i.getTextContent().length)}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(e&&b(i)&&i.isInline())n.key=i.__key,n.offset=0,n.type="element";else if((t||e)&&i===null&&b(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();R(l)&&(n.key=l.__key,n.offset=0)}}}function Bi(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),o=n.is(e);ji(n,r,o),ji(e,!r,o),o&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const i=H();if(i.isComposing()&&i._compositionKey!==n.key&&O(t)){const s=t.anchor,l=t.focus;Ke(n,s.key,s.offset,s.type),Ke(e,l.key,l.offset,l.type)}}}function Wi(n,e,t,r,o,i){if(n===null||t===null||!Ft(o,n,t))return null;const s=Ai(n,e,O(i)?i.anchor:null,o);if(s===null)return null;const l=Ai(t,r,O(i)?i.focus:null,o);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ut(n),c=ut(t);if(U(a)&&U(c))return null}return Bi(s,l,i),[s,l]}function Qr(n){return b(n)&&!n.isInline()}function zi(n,e,t,r,o,i){const s=Ie(),l=new Ue(Ee(n,e,o),Ee(t,r,i),0,"");return l.dirty=!0,s._selection=l,l}function Gl(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new Ue(n,e,0,"")}function $i(){return new An(new Set)}function Zr(n,e,t,r){const o=t._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,l=s==="selectionchange",a=!_r&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,h,d;if(O(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,h=e.anchorOffset,d=e.focusOffset,l&&O(n)&&!Ft(t,c,u))return n.clone();const f=Wi(c,h,u,d,t,n);if(f===null)return null;const[g,_]=f;return new Ue(g,_,O(n)?n.format:0,O(n)?n.style:"")}function L(){return Ie()._selection}function Gt(){return H()._editorState._selection}function jn(n,e,t,r=1){const o=n.anchor,i=n.focus,s=o.getNode(),l=i.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=o.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);o.set(a,u,"element"),i.set(a,u,"element"),Ki(n)}}else{const c=n.isBackward(),u=c?i:o,h=u.getNode(),d=c?o:i,f=d.getNode();if(e.is(h)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(f)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(a,Math.max(0,g+r),"element")}}Ki(n)}function Ki(n){const e=n.anchor,t=e.offset,r=n.focus,o=r.offset,i=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!b(i))return;const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(R(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(b(i)){const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(R(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(b(s)){const l=s.getChildrenSize(),a=o>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(o);if(R(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Bn(n,e,t,r,o){let i=null,s=0,l=null;r!==null?(i=r.__key,R(r)?(s=r.getTextContentSize(),l="text"):b(r)&&(s=r.getChildrenSize(),l="element")):o!==null&&(i=o.__key,R(o)?l="text":b(o)&&(l="element")),i!==null&&l!==null?n.set(i,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Ui(n,e,t,r,o){n.type==="text"?(n.key=t,e||(n.offset+=o)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function Xl(n,e,t,r,o,i,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,h=document.activeElement;if(o.has("collaboration")&&h!==i||h!==null&&vr(h))return;if(!O(e))return void(n!==null&&Ft(t,l,a)&&r.removeAllRanges());const d=e.anchor,f=e.focus,g=d.key,_=f.key,m=wn(t,g),x=wn(t,_),v=d.offset,y=f.offset,S=e.format,w=e.style,C=e.isCollapsed();let N=m,T=x,P=!1;if(d.type==="text"){N=xn(m);const Y=d.getNode();P=Y.getFormat()!==S||Y.getStyle()!==w}else O(n)&&n.anchor.type==="text"&&(P=!0);var j,z,ee,q,B;if(f.type==="text"&&(T=xn(x)),N!==null&&T!==null&&(C&&(n===null||P||O(n)&&(n.format!==S||n.style!==w))&&(j=S,z=w,ee=v,q=g,B=performance.now(),xi=[j,z,ee,q,B]),c!==v||u!==y||l!==N||a!==T||r.type==="Range"&&C||(h!==null&&i.contains(h)||i.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(N,v,T,y)}catch{}if(!o.has("skip-scroll-into-view")&&e.isCollapsed()&&i!==null&&i===document.activeElement){const Y=e instanceof Ue&&e.anchor.type==="element"?N.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Y!==null){let ce;if(Y instanceof Text){const Fe=document.createRange();Fe.selectNode(Y),ce=Fe.getBoundingClientRect()}else ce=Y.getBoundingClientRect();(function(Fe,Je,tn){const nn=tn.ownerDocument,rn=nn.defaultView;if(rn===null)return;let{top:bt,bottom:Ct}=Je,wt=0,St=0,pe=tn;for(;pe!==null;){const rt=pe===nn.body;if(rt)wt=0,St=En(Fe).innerHeight;else{const Ye=pe.getBoundingClientRect();wt=Ye.top,St=Ye.bottom}let Ne=0;if(bt<wt?Ne=-(wt-bt):Ct>St&&(Ne=Ct-St),Ne!==0)if(rt)rn.scrollBy(0,Ne);else{const Ye=pe.scrollTop;pe.scrollTop+=Ne;const ot=pe.scrollTop-Ye;bt-=ot,Ct-=ot}if(rt)break;pe=Sn(pe)}})(t,ce,i)}}Kr=!0}}function Ql(n){let e=L()||Gt();e===null&&(e=G().selectEnd()),e.insertNodes(n)}function eo(n){let e=n;n.isCollapsed()||e.removeText();const t=L();O(t)&&(e=t),O(e)||D(161);const r=e.anchor;let o=r.getNode(),i=r.offset;for(;!ft(o);)[o,i]=Zl(o,i);return i}function Zl(n,e){const t=n.getParent();if(!t){const o=Te();return G().append(o),o.select(),[G(),0]}if(R(n)){const o=n.splitText(e);if(o.length===0)return[t,n.getIndexWithinParent()];const i=e===0?0:1;return[t,o[0].getIndexWithinParent()+i]}if(!b(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const o=new Ue(Ee(n.__key,e,"element"),Ee(n.__key,e,"element"),0,""),i=n.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,de=!1,to=!1,Wn=0;const Vi={characterData:!0,childList:!0,subtree:!0};function Xt(){return de||te!==null&&te._readOnly}function fe(){de&&D(13)}function Ji(){Wn>99&&D(14)}function Ie(){return te===null&&D(195,Yi()),te}function H(){return ne===null&&D(196,Yi()),ne}function Yi(){let n=0;const e=new Set,t=Kn.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=vn(o);if(xr(i))n++;else if(i){let s=String(i.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 ea(){return ne}function qi(n,e,t){const r=e.__type,o=function(l,a){const c=l._nodes.get(a);return c===void 0&&D(30,a),c}(n,r);let i=t.get(r);i===void 0&&(i=Array.from(o.transforms),t.set(r,i));const s=i.length;for(let l=0;l<s&&(i[l](e),e.isAttached());l++);}function Hi(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function ta(n){return no(n,H()._nodes)}function no(n,e){const t=n.type,r=e.get(t);r===void 0&&D(17,t);const o=r.klass;n.type!==o.getType()&&D(18,o.name);const i=o.importJSON(n),s=n.children;if(b(i)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=no(s[l],e);i.append(a)}return i}function Gi(n,e,t){const r=te,o=de,i=ne;te=e,de=!0,ne=n;try{return t()}finally{te=r,de=o,ne=i}}function Ve(n,e){const t=n._pendingEditorState,r=n._rootElement,o=n._headless||r===null;if(t===null)return;const i=n._editorState,s=i._selection,l=t._selection,a=n._dirtyType!==He,c=te,u=de,h=ne,d=n._updating,f=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!o&&a&&f!==null){ne=n,te=t,de=!1,n._updating=!0;try{const C=n._dirtyType,N=n._dirtyElements,T=n._dirtyLeaves;f.disconnect(),g=Wl(i,t,n,C,N,T)}catch(C){if(C instanceof Error&&n._onError(C),to)throw C;return ns(n,null,r,t),$o(n),n._dirtyType=at,to=!0,Ve(n,i),void(to=!1)}finally{f.observe(r,Vi),n._updating=d,te=c,de=u,ne=h}}t._readOnly||(t._readOnly=!0);const _=n._dirtyLeaves,m=n._dirtyElements,x=n._normalizedNodes,v=n._updateTags,y=n._deferred;a&&(n._dirtyType=He,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(C,N){const T=C._decorators;let P=C._pendingDecorators||T;const j=N._nodeMap;let z;for(z in P)j.has(z)||(P===T&&(P=Go(C)),delete P[z])}(n,t);const S=o?null:we(n._window);if(n._editable&&S!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(f!==null&&f.disconnect(),a||l===null||l.dirty){const C=n._blockCursorElement;C!==null&&Pr(C,n,r),Xl(s,l,n,S,v,r)}Fl(n,r,l),f!==null&&f.observe(r,Vi)}finally{ne=h,te=c}}g!==null&&function(C,N,T,P,j){const z=Array.from(C._listeners.mutation),ee=z.length;for(let q=0;q<ee;q++){const[B,Y]=z[q],ce=N.get(Y);ce!==void 0&&B(ce,{dirtyLeaves:P,prevEditorState:j,updateTags:T})}}(n,g,v,_,i),O(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(ln,void 0);const w=n._pendingDecorators;w!==null&&(n._decorators=w,n._pendingDecorators=null,Qt("decorator",n,!0,w)),function(C,N,T){const P=Xo(N),j=Xo(T);P!==j&&Qt("textcontent",C,!0,j)}(n,e||i,t),Qt("update",n,!0,{dirtyElements:m,dirtyLeaves:_,editorState:t,normalizedNodes:x,prevEditorState:e||i,tags:v}),function(C,N){if(C._deferred=[],N.length!==0){const T=C._updating;C._updating=!0;try{for(let P=0;P<N.length;P++)N[P]()}finally{C._updating=T}}}(n,y),function(C){const N=C._updates;if(N.length!==0){const T=N.shift();if(T){const[P,j]=T;Zi(C,P,j)}}}(n)}function Qt(n,e,t,...r){const o=e._updating;e._updating=t;try{const i=Array.from(e._listeners[n]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{e._updating=o}}function Xi(n,e,t){if(n._updating===!1||ne!==n){let o=!1;return n.update(()=>{o=Xi(n,e,t)}),o}const r=Cr(n);for(let o=4;o>=0;o--)for(let i=0;i<r.length;i++){const s=r[i]._commands.get(e);if(s!==void 0){const l=s[o];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 Qi(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const o=t.shift();if(o){const[i,s]=o;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&&D(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}i()}}return r}function Zi(n,e,t){const r=n._updateTags;let o,i,s=!1,l=!1;t!==void 0&&(o=t.onUpdate,i=t.tag,i!=null&&r.add(i),s=t.skipTransforms||!1,l=t.discrete||!1),o&&n._deferred.push(o);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new $n(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const h=te,d=de,f=ne,g=n._updating;te=c,de=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(v){const y=v.getEditorState()._selection,S=we(v._window);return O(y)||y==null?Zr(y,S,v,null):y.clone()}(n));const m=n._compositionKey;e(),s=Qi(n,s),function(v,y){const S=y.getEditorState()._selection,w=v._selection;if(O(w)){const C=w.anchor,N=w.focus;let T;if(C.type==="text"&&(T=C.getNode(),T.selectionTransform(S,w)),N.type==="text"){const P=N.getNode();T!==P&&P.selectionTransform(S,w)}}}(c,n),n._dirtyType!==He&&(s?function(v,y){const S=y._dirtyLeaves,w=v._nodeMap;for(const C of S){const N=w.get(C);R(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&Vo(N)}}(c,n):function(v,y){const S=y._dirtyLeaves,w=y._dirtyElements,C=v._nodeMap,N=We(),T=new Map;let P=S,j=P.size,z=w,ee=z.size;for(;j>0||ee>0;){if(j>0){y._dirtyLeaves=new Set;for(const q of P){const B=C.get(q);R(B)&&B.isAttached()&&B.isSimpleText()&&!B.isUnmergeable()&&Vo(B),B!==void 0&&Hi(B,N)&&qi(y,B,T),S.add(q)}if(P=y._dirtyLeaves,j=P.size,j>0){Wn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const q of z){const B=q[0],Y=q[1];if(B!=="root"&&!Y)continue;const ce=C.get(B);ce!==void 0&&Hi(ce,N)&&qi(y,ce,T),w.set(B,Y)}P=y._dirtyLeaves,j=P.size,z=y._dirtyElements,ee=z.size,Wn++}y._dirtyLeaves=S,y._dirtyElements=w}(c,n),Qi(n),function(v,y,S,w){const C=v._nodeMap,N=y._nodeMap,T=[];for(const[P]of w){const j=N.get(P);j!==void 0&&(j.isAttached()||(b(j)&&ui(j,P,C,N,T,w),C.has(P)||w.delete(P),T.push(P)))}for(const P of T)N.delete(P);for(const P of S){const j=N.get(P);j===void 0||j.isAttached()||(C.has(P)||S.delete(P),N.delete(P))}}(a,c,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(c._flushSync=!0);const x=c._selection;if(O(x)){const v=c._nodeMap,y=x.anchor.key,S=x.focus.key;v.get(y)!==void 0&&v.get(S)!==void 0||D(19)}else xe(x)&&x._nodes.size===0&&(c._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=a,n._dirtyType=at,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ve(n)}finally{te=h,de=d,ne=f,n._updating=g,Wn=0}n._dirtyType!==He||function(m,x){const v=x.getEditorState()._selection,y=m._selection;if(y!==null){if(y.dirty||!y.is(v))return!0}else if(v!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ve(n)):u&&Nl(()=>{Ve(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Zi(n,e,t)}class zn extends Fn{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 vl[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=H()._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(R(t)&&e.push(t),b(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;b(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;b(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 i=t[r-1];return b(i)&&i.getLastDescendant()||i||null}const o=t[e];return b(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&D(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&D(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,o;if(e<t/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=e;){if(o===e)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=t-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const i=t[o];e+=i.getTextContent(),b(i)&&o!==r-1&&!i.isInline()&&(e+=Pe)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const i=t[o];e+=i.getTextContentSize(),b(i)&&o!==r-1&&!i.isInline()&&(e+=Pe.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Bo[e];return!!(this.getFormat()&t)}return!1}select(e,t){fe();const r=L();let o=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(R(a)||b(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(R(a)||b(a))return a.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const l=this.__key;return O(r)?(r.anchor.set(l,o,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):zi(l,o,l,i,"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!==""?Bo[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const o=r.length,i=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let h=null,d=i-t+o;if(e!==0)if(e===i)h=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(h=g.getPreviousSibling())}if(t>0){let g=h===null?this.getFirstChild():h.getNextSibling();for(let _=0;_<t;_++){g===null&&D(100);const m=g.getNextSibling(),x=g.__key;Ge(g.getWritable()),c.push(x),g=m}}let f=h;for(let g=0;g<o;g++){const _=r[g];f!==null&&_.is(f)&&(h=f=f.getPreviousSibling());const m=_.getWritable();m.__parent===l&&d--,Ge(m);const x=_.__key;if(f===null)s.__first=x,m.__prev=null;else{const v=f.getWritable();v.__next=x,m.__prev=v.__key}_.__key===l&&D(76),m.__parent=l,a.push(x),f=_}if(e+t===i)f!==null&&(f.getWritable().__next=null,s.__last=f.__key);else if(u!==null){const g=u.getWritable();if(f!==null){const _=f.getWritable();g.__prev=f.__key,_.__next=u.__key}else g.__prev=null}if(s.__size=d,c.length){const g=L();if(O(g)){const _=new Set(c),m=new Set(a),{anchor:x,focus:v}=g;es(x,_,m)&&Bn(x,x.getNode(),this,h,u),es(v,_,m)&&Bn(v,v.getNode(),this,h,u),d!==0||this.canBeEmpty()||dt(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 b(n){return n instanceof zn}function es(n,e,t){let r=n.getNode();for(;r;){const o=r.__key;if(e.has(o)&&!t.has(o))return!0;r=r.getParent()}return!1}class na extends Fn{constructor(e){super(e)}decorate(e,t){D(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof na}class Zt extends zn{static getType(){return"root"}static clone(){return new Zt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){D(51)}getTextContent(){const e=this.__cachedText;return!Xt()&&H()._dirtyType!==He||e===null?super.getTextContent():e}remove(){D(52)}replace(e){D(53)}insertBefore(e){D(54)}insertAfter(e){D(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];b(r)||U(r)||D(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 ie(n){return n instanceof Zt}function ro(){return new $n(new Map([["root",new Zt]]))}function ts(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&D(130,t.name),b(n)){const r=e.children;Array.isArray(r)||D(59,t.name);const o=n.getChildren();for(let i=0;i<o.length;i++){const s=ts(o[i]);r.push(s)}}return e}class $n{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 Gi(t&&t.editor||null,this,e)}clone(e){const t=new $n(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Gi(null,this,()=>({root:ts(G())}))}}class oo extends zn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class mt 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=Oe[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 mt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=jt(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:ra,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Or(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o);const i=this.getIndent();i>0&&(t.style.textIndent=20*i+"px")}return{element:t}}static importJSON(e){const t=Te();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=Te();r.setTextFormat(e.format),r.setTextStyle(e.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||R(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 ra(n){const e=Te();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 Te(){return Tn(new mt)}function io(n){return n instanceof mt}const K=0,oa=4;function ns(n,e,t,r){const o=n._keyToDOMMap;o.clear(),n._editorState=ro(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=He,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const i=n._observer;i!==null&&(i.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",o.set("root",t))}function ia(n){const e=n||{},t=ea(),r=e.theme||{},o=n===void 0?t:e.parentEditor||null,i=e.disableEvents||!1,s=ro(),l=e.namespace||(o!==null?o._config.namespace:ti()),a=e.editorState,c=[Zt,_t,Yt,qt,mt,oo,...e.nodes||[]],{onError:u,html:h}=e,d=e.editable===void 0||e.editable;let f;if(n===void 0&&t!==null)f=t._nodes;else{f=new Map;for(let _=0;_<c.length;_++){let m=c[_],x=null,v=null;if(typeof m!="function"){const C=m;m=C.replace,x=C.with,v=C.withKlass||null}const y=m.getType(),S=m.transform(),w=new Set;S!==null&&w.add(S),f.set(y,{exportDOM:h&&h.export?h.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:v,transforms:w})}}const g=new Kn(s,o,f,{disableEvents:i,namespace:l,theme:r},u||console.error,function(_,m){const x=new Map,v=new Set,y=S=>{Object.keys(S).forEach(w=>{let C=x.get(w);C===void 0&&(C=[],x.set(w,C)),C.push(S[w])})};return _.forEach(S=>{const w=S.klass.importDOM;if(w==null||v.has(w))return;v.add(w);const C=w.call(S.klass);C!==null&&y(C)}),m&&y(m),x}(f,h?h.import:void 0),d);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=at),g}class Kn{constructor(e,t,r,o,i,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=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=He,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=ti(),this._onError=i,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&&D(35);const o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(e);i===void 0&&D(36,String(e));const s=i[r];return s.add(t),()=>{s.delete(t),i.every(l=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;i.set(t,o);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,o),()=>{i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&D(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,o=Al(r).get(t.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&e(i,{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),o=[r],i=r.replaceWithKlass;if(i!=null){const a=this.registerNodeTransformToKlass(i,t);o.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),()=>{o.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 M(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=jt(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,ns(this,t,e,o),t!==null&&(this._config.disableEvents||zl(t),r!=null&&t.classList.remove(...r)),e!==null){const i=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=i,this._dirtyType=at,$o(this),this._updateTags.add("history-merge"),Ve(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=In.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",Ti),In.set(c,(u||0)+1),l.__lexicalEditor=a;const h=Ei(l);for(let d=0;d<$r.length;d++){const[f,g]=$r[d],_=typeof g=="function"?m=>{Ni(m)||(ki(m),(a.isEditable()||f==="click")&&g(m,a))}:m=>{if(Ni(m))return;ki(m);const x=a.isEditable();switch(f){case"cut":return x&&M(a,ir,m);case"copy":return M(a,fn,m);case"paste":return x&&M(a,rr,m);case"dragstart":return x&&M(a,Io,m);case"dragover":return x&&M(a,Fo,m);case"dragend":return x&&M(a,nl,m);case"focus":return x&&M(a,il,m);case"blur":return x&&M(a,sl,m);case"drop":return x&&M(a,Ro,m)}};l.addEventListener(f,_),h.push(()=>{l.removeEventListener(f,_)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=o,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()&&D(38),zo(this);const r=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;r===null||r.isEmpty()||(i!=null&&o.add(i),Ve(this)),this._pendingEditorState=e,this._dirtyType=at,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),Ve(this)}parseEditorState(e,t){return function(r,o,i){const s=ro(),l=te,a=de,c=ne,u=o._dirtyElements,h=o._dirtyLeaves,d=o._cloneNotNeeded,f=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,te=s,de=!1,ne=o;try{const g=o._nodes;no(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=h,o._cloneNotNeeded=d,o._dirtyType=f,te=l,de=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ve(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 o=L(),i=G();o!==null?o.dirty=!0:i.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?i.selectStart():i.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=we(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()}}}Kn.version="0.17.1+prod.esm";const Gc="";function sa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var la=sa(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=F.createContext(null);function aa(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function tt(){const n=F.useContext(rs);return n==null&&la(8),n}const os=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ca=os?F.useLayoutEffect:F.useEffect,Un={tag:"history-merge"};function ua({initialConfig:n,children:e}){const t=F.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:l,html:a}=n,c=aa(null,r),u=ia({editable:n.editable,html:a,namespace:o,nodes:i,onError:h=>s(h,u),theme:r});return function(h,d){if(d!==null){if(d===void 0)h.update(()=>{const f=G();if(f.isEmpty()){const g=Te();f.append(g);const _=os?document.activeElement:null;(L()!==null||_!==null&&_===h.getRootElement())&&g.select()}},Un);else if(d!==null)switch(typeof d){case"string":{const f=h.parseEditorState(d);h.setEditorState(f,Un);break}case"object":h.setEditorState(d,Un);break;case"function":h.update(()=>{G().isEmpty()&&d(h)},Un)}}}(u,l),[u,c]},[]);return ca(()=>{const r=n.editable,[o]=t;o.setEditable(r===void 0||r)},[]),E.jsx(rs.Provider,{value:t,children:e})}function da({defaultSelection:n}){const[e]=tt();return F.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 fa(){return G().getTextContent()}function ha(n,e=!0){if(n)return!1;let t=fa();return e&&(t=t.trim()),t===""}function ga(n){if(!ha(n,!1))return!1;const e=G().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const o=e[r];if(U(o))return!1;if(b(o)){if(!io(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let l=0;l<s;l++){const a=i[r];if(!R(a))return!1}}}return!0}function is(n){return()=>ga(n)}function pa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}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.`)});function _a(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ma=_a(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 ya=new Map;function va(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(e[o.trim()]=i.trim())}return e}function ss(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,o]=t,i=n.isBackward(),s=r.getNode(),l=o.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,h]=Xr(n),d=s.is(l),f=e.is(i?l:s),g=e.is(i?s:l);let _,m=0;return d?(m=u>h?h:u,_=u>h?u:h):f?(m=i?h:u,_=void 0):g&&(m=0,_=i?u:h),e.__text=e.__text.slice(m,_),e}}return e}function ls(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return b(e)||ma(177),n.offset===e.getChildrenSize()}function xa(n){const e=n.getStyle(),t=va(e);ya.set(e,t)}function as(n,e){const t=Bt(n.focus,e);return U(t)&&!t.isIsolated()||b(t)&&!t.isInline()&&!t.canBeEmpty()}function ba(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Ca(n){const e=n.anchor.getNode();return(ie(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function cs(n,e,t){const r=Ca(n);ba(n,e,t?!r:r,"character")}function wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Sa=wa(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 us=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ea=us&&"documentMode"in document?document.documentMode:null;!(!us||!("InputEvent"in window)||Ea)&&"getTargetRanges"in new window.InputEvent("input");function yt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Ta(n){const e=so(n,t=>b(t)&&!t.isInline());return b(e)||Sa(4,n.__key),e}const so=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function nt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const ds=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect;function ka({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:o,ariaExpanded:i,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:h,className:d,id:f,role:g="textbox",spellCheck:_=!0,style:m,tabIndex:x,"data-testid":v,...y},S){const[w,C]=F.useState(n.isEditable()),N=F.useCallback(P=>{P&&P.ownerDocument&&P.ownerDocument.defaultView?n.setRootElement(P):n.setRootElement(null)},[n]),T=F.useMemo(()=>function(...P){return j=>{P.forEach(z=>{typeof z=="function"?z(j):z!=null&&(z.current=j)})}}(S,N),[N,S]);return ds(()=>(C(n.isEditable()),n.registerEditableListener(P=>{C(P)})),[n]),E.jsx("div",{...y,"aria-activedescendant":w?e:void 0,"aria-autocomplete":w?t:"none","aria-controls":w?r:void 0,"aria-describedby":o,"aria-expanded":w&&g==="combobox"?!!i:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":w?c:void 0,"aria-readonly":!w||void 0,"aria-required":u,autoCapitalize:h,className:d,contentEditable:w,"data-testid":v,id:f,ref:T,role:w?g:void 0,spellCheck:_,style:m,tabIndex:x})}const Na=F.forwardRef(ka);function fs(n){return n.getEditorState().read(is(n.isComposing()))}const Pa=F.forwardRef(Oa);function Oa(n,e){const{placeholder:t,...r}=n,[o]=tt();return E.jsxs(E.Fragment,{children:[E.jsx(Na,{editor:o,...r,ref:e}),t!=null&&E.jsx(Da,{editor:o,content:t})]})}function Da({content:n,editor:e}){const t=function(s){const[l,a]=F.useState(()=>fs(s));return ds(()=>{function c(){const u=fs(s);a(u)}return c(),yt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,o]=F.useState(e.isEditable());if(F.useLayoutEffect(()=>(o(e.isEditable()),e.registerEditableListener(s=>{o(s)})),[e]),!t)return null;let i=null;return typeof n=="function"?i=n(r):n!==null&&(i=n),i===null?null:E.jsx("div",{"aria-hidden":!0,children:i})}const Vn=0,lo=1,ao=2,be=0,Ra=1,hs=2,Ia=3,Fa=4;function Ma(n,e,t,r,o){if(n===null||t.size===0&&r.size===0&&!o)return be;const i=e._selection,s=n._selection;if(o)return Ra;if(!(O(i)&&O(s)&&s.isCollapsed()&&i.isCollapsed()))return be;const l=function(x,v,y){const S=x._nodeMap,w=[];for(const C of v){const N=S.get(C);N!==void 0&&w.push(N)}for(const[C,N]of y){if(!N)continue;const T=S.get(C);T===void 0||ie(T)||w.push(T)}return w}(e,t,r);if(l.length===0)return be;if(l.length>1){const x=e._nodeMap,v=x.get(i.anchor.key),y=x.get(s.anchor.key);return v&&y&&!n._nodeMap.has(v.__key)&&R(v)&&v.__text.length===1&&i.anchor.offset===1?hs:be}const a=l[0],c=n._nodeMap.get(a.__key);if(!R(c)||!R(a)||c.__mode!==a.__mode)return be;const u=c.__text,h=a.__text;if(u===h)return be;const d=i.anchor,f=s.anchor;if(d.key!==f.key||d.type!=="text")return be;const g=d.offset,_=f.offset,m=h.length-u.length;return m===1&&_===g-1?hs:m===-1&&_===g+1?Ia:m===-1&&_===g?Fa:be}function La(n,e){let t=Date.now(),r=be;return(o,i,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=be,t=u,ao;const h=Ma(o,i,l,a,n.isComposing()),d=(()=>{const f=s===null||s.editor===n,g=c.has("history-push");if(!g&&f&&c.has("history-merge"))return Vn;if(o===null)return lo;const _=i._selection;return l.size>0||a.size>0?g===!1&&h!==be&&h===r&&u<t+e&&f||l.size===1&&function(m,x,v){const y=x._nodeMap.get(m),S=v._nodeMap.get(m),w=x._selection,C=v._selection;return!(O(w)&&O(C)&&w.anchor.type==="element"&&w.focus.type==="element"&&C.anchor.type==="text"&&C.focus.type==="text"||!R(y)||!R(S)||y.__parent!==S.__parent)&&JSON.stringify(x.read(()=>y.exportJSON()))===JSON.stringify(v.read(()=>S.exportJSON()))}(Array.from(l)[0],o,i)?Vn:lo:_!==null?Vn:ao})();return t=u,r=h,d}}function gs(n){n.undoStack=[],n.redoStack=[],n.current=null}function Aa(n,e,t){const r=La(n,t);return yt(n.registerCommand(cn,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),i.dispatchCommand(Dt,!0)),a.length===0&&i.dispatchCommand(Rt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(un,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),i.dispatchCommand(Rt,!0));const u=l.pop();l.length===0&&i.dispatchCommand(Dt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(rl,()=>(gs(e),!1),K),n.registerCommand(ol,()=>(gs(e),n.dispatchCommand(Dt,!1),n.dispatchCommand(Rt,!1),!0),K),n.registerUpdateListener(({editorState:i,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,h=e.redoStack,d=e.undoStack,f=u===null?null:u.editorState;if(u!==null&&i===f)return;const g=r(s,i,u,l,a,c);if(g===lo)h.length!==0&&(e.redoStack=[],n.dispatchCommand(Dt,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(Rt,!0));else if(g===ao)return;e.current={editor:n,editorState:i}}))}function ja(){return{current:null,redoStack:[],undoStack:[]}}function Ba({delay:n,externalHistoryState:e}){const[t]=tt();return function(r,o,i=1e3){const s=F.useMemo(()=>o||ja(),[o]);F.useEffect(()=>Aa(r,s,i),[i,r,s])}(t,e,n),null}const Wa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect;function za(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function $a(){return function(n){const[e]=tt(),t=F.useMemo(()=>n(e),[e,n]),r=F.useRef(t.initialValueFn()),[o,i]=F.useState(r.current);return Wa(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,i(a)),l(c=>{r.current=c,i(c)})},[t,n]),o}(za)}function Ka(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const o=n.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}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,h,d,f,g]=a;n.update(()=>{const _=L();if(O(_)){const m=_.anchor;let x=m.getNode(),v=0,y=0;if(R(x)&&c>=0&&u>=0&&(v=c,y=c+u,_.setTextNodeRange(x,v,x,y)),v===y&&h===""||(_.insertRawText(h),x=m.getNode()),R(x)){v=d,y=d+f;const S=x.getTextContentSize();v=v>S?S:v,y=y>S?S:y,_.setTextNodeRange(x,v,x,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Ua(n,e){const t=e.body?e.body.childNodes:[];let r=[];const o=[];for(let i=0;i<t.length;i++){const s=t[i];if(!_s.has(s.nodeName)){const l=ms(s,n,o,!1);l!==null&&(r=r.concat(l))}}return function(i){for(const s of i)s.getNextSibling()instanceof oo&&s.insertAfter(et());for(const s of i){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(o),r}function Va(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 o=0;o<r.length;o++)ps(n,r[o],t,e);return t.innerHTML}function ps(n,e,t,r=null){let o=r===null||e.isSelected(r);const i=b(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let f=Ir(e);f=R(f)&&r!==null?ss(r,f):f,s=f}const l=b(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:h}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let f=0;f<l.length;f++){const g=l[f],_=ps(n,g,d,r);!o&&b(e)&&_&&e.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if(Or(u)&&u.append(d),t.append(u),h){const f=h.call(s,u);f&&u.replaceWith(f)}}else t.append(d);return o}const _s=new Set(["STYLE","SCRIPT"]);function ms(n,e,t,r,o=new Map,i){let s=[];if(_s.has(n.nodeName))return s;let l=null;const a=function(g,_){const{nodeName:m}=g,x=_._htmlConversions.get(m.toLowerCase());let v=null;if(x!==void 0)for(const y of x){const S=y(g);S!==null&&(v===null||(v.priority||0)<(S.priority||0))&&(v=S)}return v!==null?v.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[,_]of o)if(l=_(l,i),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&o.set(n.nodeName,c.forChild)}const h=n.childNodes;let d=[];const f=(l==null||!dt(l))&&(l!=null&&Qr(l)||r);for(let g=0;g<h.length;g++)d.push(...ms(h[g],e,t,f,new Map(o),l));return u!=null&&(d=u(d)),kn(n)&&(d=Ja(n,d,f?()=>{const g=new oo;return t.push(g),g}:Te)),l==null?d.length>0?s=s.concat(d):kn(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Dr(g.nextSibling)&&Dr(g.previousSibling)}(n)&&(s=s.concat(et())):b(l)&&l.append(...d),s}function Ja(n,e,t){const r=n.style.textAlign,o=[];let i=[];for(let s=0;s<e.length;s++){const l=e[s];if(Qr(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(i.push(l),s===e.length-1||s<e.length-1&&Qr(e[s+1])){const a=t();a.setFormat(r),a.append(...i),o.push(a),i=[]}}return o}function Ya(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Jn=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.`)});const qa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ys=n=>qa?(n||window).getSelection():null;function Ha(n,e=L()){return e==null&&Jn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":Va(n,e)}function Ga(n,e=L()){return e==null&&Jn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Xa(n,e))}function vs(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 xs(t,Qa(s.nodes),e)}catch{}const o=n.getData("text/html");if(o)try{const s=new DOMParser().parseFromString(o,"text/html");return xs(t,Ua(t,s),e)}catch{}const i=n.getData("text/plain")||n.getData("text/uri-list");if(i!=null)if(O(e)){const s=i.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=L();if(O(a)){const c=s[l];c===`
40
40
  `||c===`\r
41
- `?a.insertParagraph():c===" "?a.insertNodes([en()]):a.insertText(c)}}}else e.insertRawText(o)}function Ps(n,e,t){n.dispatchCommand(sl,{nodes:e,selection:t})||t.insertNodes(e)}function Os(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=Br(t);c=D(c)&&e!==null?ps(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&er(58,d.name),C(c)){const f=u.children;Array.isArray(f)||er(59,d.name)}return u}(s);if(D(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],d=Os(n,e,u,a.children);!i&&C(t)&&d&&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 sc(n,e){const t=[],r=Z().getChildren();for(let i=0;i<r.length;i++)Os(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function lc(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=ha(r);D(i)&&Ta(i),e.push(i)}return e}let St=null;async function Ds(n,e,t){if(St!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(js(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=Es(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(xn,d=>(st(d,ClipboardEvent)&&(u(),St!==null&&(window.clearTimeout(St),St=null),a(js(n,d,t))),!0),ma);St=window.setTimeout(()=>{u(),St=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function js(n,e,t){if(t===void 0){const i=Es(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!Mt(n,o,s))return!1;const l=F();if(l===null)return!1;t=cc(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(uc(r,t),!0)}const ac=[["text/html",ic],["application/x-lexical-editor",oc]];function cc(n=F()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Yl();for(const[r,i]of ac){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function uc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function As(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 kt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fc=kt&&"documentMode"in document?document.documentMode:null,dc=!(!kt||!("InputEvent"in window)||fc)&&"getTargetRanges"in new window.InputEvent("input"),hc=kt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gc=kt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,pc=kt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),mc=kt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!pc,Ls=ol();function tr(n){let e=null;if(st(n,DragEvent)?e=n.dataTransfer:st(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 Is(n){const e=F();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=Zn(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 nr(n){const e=tt(n);return U(e)}function _c(n){return wt(n.registerCommand(Di,e=>{const t=F();return!!Ce(t)&&(t.clear(),!0)},0),n.registerCommand(Ze,e=>{const t=F();return!!O(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(jt,e=>{const t=F();return!!O(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(At,e=>{const t=F();return!!O(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(ht,e=>{const t=F();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Ns(r,t,n);else if(O(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},K),n.registerCommand(dr,()=>{const e=F();return!!O(e)&&(e.removeText(),!0)},K),n.registerCommand(fe,e=>{const t=F();return!!O(t)&&(t.formatText(e),!0)},K),n.registerCommand(_e,e=>{const t=F();if(!O(t)&&!Ce(t))return!1;const r=t.getNodes();for(const i of r){const o=Zn(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},K),n.registerCommand(dt,e=>{const t=F();return!!O(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(pn,()=>{const e=F();return!!O(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(dl,()=>(ua([en()]),!0),K),n.registerCommand(Ri,()=>Is(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(hr,()=>Is(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(Li,e=>{const t=F();if(Ce(t)&&!nr(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(O(t)){const r=zt(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(Ii,e=>{const t=F();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===Z().getChildrenSize()}(t))return e.preventDefault(),!0;const r=zt(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(Ai,e=>{const t=F();if(Ce(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!O(t))return!1;if(_s(t,!0)){const r=e.shiftKey;return e.preventDefault(),xs(t,r,!0),!0}return!1},K),n.registerCommand(ji,e=>{const t=F();if(Ce(t)&&!nr(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!!_s(t,!1)&&(e.preventDefault(),xs(t,r,!1),!0)},K),n.registerCommand(Fi,e=>{if(nr(e.target))return!1;const t=F();if(!O(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&Fa(i).getIndent()>0?n.dispatchCommand(hr,void 0):n.dispatchCommand(Ze,!0)},K),n.registerCommand($i,e=>{if(nr(e.target))return!1;const t=F();return!!O(t)&&(e.preventDefault(),n.dispatchCommand(Ze,!1))},K),n.registerCommand(yn,e=>{const t=F();if(!O(t))return!1;if(e!==null){if((gc||hc||mc)&&dc)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(dt,!1)}return n.dispatchCommand(pn,void 0)},K),n.registerCommand(Mi,()=>{const e=F();return!!O(e)&&(n.blur(),!0)},K),n.registerCommand(Wi,e=>{const[,t]=tr(e);if(t.length>0){const i=As(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=tt(s);if(l!==null){const a=aa();if(D(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=eo(a);Se(c)}n.dispatchCommand(Ls,t)}return e.preventDefault(),!0}const r=F();return!!O(r)},K),n.registerCommand(Bi,e=>{const[t]=tr(e),r=F();return!(t&&!O(r))},K),n.registerCommand(zi,e=>{const[t]=tr(e),r=F();if(t&&!O(r))return!1;const i=As(e.clientX,e.clientY);if(i!==null){const o=tt(i.node);U(o)&&e.preventDefault()}return!0},K),n.registerCommand(pr,()=>(Kl(),!0),K),n.registerCommand(xn,e=>(Ds(n,st(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(gr,e=>(async function(t,r){await Ds(r,st(t,ClipboardEvent)?t:null),r.update(()=>{const i=F();O(i)?i.removeText():Ce(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),K),n.registerCommand(fr,e=>{const[,t,r]=tr(e);return t.length>0&&!r?(n.dispatchCommand(Ls,t),!0):Nr(e.target)?!1:F()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=F(),l=st(i,InputEvent)||st(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&Ns(l,s,o)},{tag:"paste"})}(e,n),!0)},K))}const _i=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?j.useLayoutEffect:j.useEffect;function Fs(n){return n.getEditorState().read(ws(n.isComposing()))}function yc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=ot(),i=function(o,s){const[l,a]=j.useState(()=>o.getDecorators());return _i(()=>o.registerDecoratorListener(c=>{hn.flushSync(()=>{a(c)})}),[o]),j.useEffect(()=>{a(o.getDecorators())},[o]),j.useMemo(()=>{const c=[],u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d],h=b.jsx(s,{onError:m=>o._onError(m),children:b.jsx(j.Suspense,{fallback:null,children:l[f]})}),g=o.getElementByKey(f);g!==null&&c.push(hn.createPortal(h,g,f))}return c},[s,l,o])}(r,t);return function(o){_i(()=>wt(_c(o),Za(o)),[o])}(r),b.jsxs(b.Fragment,{children:[n,b.jsx(xc,{content:e}),i]})}function xc({content:n}){const[e]=ot(),t=function(i){const[o,s]=j.useState(()=>Fs(i));return _i(()=>{function l(){const a=Fs(i);s(a)}return l(),wt(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Ya();return t?typeof n=="function"?n(r):n:null}function yi(n,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},yi(n,e)}var Ms={error:null},vc=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=Ms,o.resetErrorBoundary=function(){for(var c,u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];o.props.onReset==null||(c=o.props).onReset.apply(c,d),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,yi(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Ms)},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,d=this.state.error,f=this.props.resetKeys;d!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=f)===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,f),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(Oe.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Oe.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Oe.Component);function bc({children:n,onError:e}){return b.jsx(vc,{fallback:b.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}var Me=(n=>(n.normal="96px",n.narrow="48px",n.moderate="96px 72px",n.wide="96px 192px",n))(Me||{});const Cc=j.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),xi=()=>j.useContext(Cc),mu="",lt=8,at=72,wc=16;function Sc({selectionFontSize:n,editor:e}){const[t,r]=Oe.useState(n),i=(a,c)=>{if(!c)return a;let u=a;switch(c){case 2:switch(!0){case a>at:u=at;break;case a>=48:u-=12;break;case a>=24:u-=4;break;case a>=14:u-=2;break;case a>=9:u-=1;break;default:u=lt;break}break;case 1:switch(!0){case a<lt:u=lt;break;case a<12:u+=1;break;case a<20:u+=2;break;case a<36:u+=4;break;case a<=60:u+=12;break;default:u=at;break}break}return u},o=Oe.useCallback((a,c)=>{const u=d=>(d||(d=`${wc}px`),d=d.slice(0,-2),`${i(Number(d),c)}px`);e.update(()=>{if(e.isEditable()){const d=F();d!==null&&Ea(d,{"font-size":a||u})}})},[e]),s=a=>{const c=Number(t);if(["e","E","+","-"].includes(a.key)||isNaN(c)){a.preventDefault(),r("");return}if(a.key==="Enter"){a.preventDefault();let u=c;c>at?u=at:c<lt&&(u=lt),r(String(u)),o(String(u)+"px",null)}},l=a=>{if(t!==""){const c=i(Number(t),a);o(String(c)+"px",null)}else o(null,a)};return Oe.useEffect(()=>{r(n)},[n]),b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button",disabled:n!==""&&Number(t)<=lt,onClick:()=>l(2),className:"toolbar-item font-decrement",children:b.jsx("i",{className:"format minus-icon"})}),b.jsx("input",{type:"number",value:t,className:"toolbar-item font-size-input",min:lt,max:at,onChange:a=>r(a.target.value),onKeyDown:s}),b.jsx("button",{type:"button",disabled:n!==""&&Number(t)>=at,onClick:()=>l(1),className:"toolbar-item font-increment",children:b.jsx("i",{className:"format add-icon"})})]})}const kc=new Set(["http:","https:","mailto:","sms:","tel:"]);class rr extends on{static getType(){return"link"}static clone(e){return new rr(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),Ia(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:Tc,priority:1})}}static importJSON(e){const t=vi(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(!kc.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=vi(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 Tc(n){let e=null;if(Jl(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=vi(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function vi(n,e){return Kt(new rr(n,e))}function Ec(n){return n instanceof rr}function Nc(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?ms(t)?r:i:ms(e)?r:i}const _u="";function Pc({onClose:n,children:e,title:t,closeOnClickOutside:r}){const i=j.useRef(null);return j.useEffect(()=>{i.current!==null&&i.current.focus()},[]),j.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 Oc({onClose:n,children:e,title:t,closeOnClickOutside:r=!1}){return hn.createPortal(b.jsx(Pc,{onClose:n,title:t,closeOnClickOutside:r,children:e}),document.body)}function Dc(){const[n,e]=j.useState(null),t=j.useCallback(()=>{e(null)},[]),r=j.useMemo(()=>{if(n===null)return null;const{title:o,content:s,closeOnClickOutside:l}=n;return b.jsx(Oc,{onClose:t,title:o,closeOnClickOutside:l,children:s})},[n,t]),i=j.useCallback((o,s,l=!1)=>{e({closeOnClickOutside:l,content:s(t),title:o})},[t]);return[r,i]}const $s=Oe.createContext(null),Rs=4;function pe({children:n,className:e,onClick:t,title:r}){const i=j.useRef(null),o=Oe.useContext($s);if(o===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=o;return j.useEffect(()=>{i&&i.current&&s(i)},[i,s]),b.jsx("button",{className:e,onClick:t,ref:i,title:r,type:"button",children:n})}function jc({children:n,dropDownRef:e,onClose:t}){const[r,i]=j.useState(),[o,s]=j.useState(),l=j.useCallback(u=>{i(d=>d?[...d,u]:[u])},[i]),a=u=>{if(!r)return;const d=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(d)&&u.preventDefault(),d==="Escape"||d==="Tab"?t():d==="ArrowUp"?s(f=>{if(!f)return r[0];const h=r.indexOf(f)-1;return r[h===-1?r.length-1:h]}):d==="ArrowDown"&&s(f=>f?r[r.indexOf(f)+1]:r[0])},c=j.useMemo(()=>({registerItem:l}),[l]);return j.useEffect(()=>{r&&!o&&s(r[0]),o&&o.current&&o.current.focus()},[r,o]),b.jsx($s.Provider,{value:c,children:b.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function Ws({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:i,children:o,stopCloseOnClickSelf:s}){const l=j.useRef(null),a=j.useRef(null),[c,u]=j.useState(!1),d=()=>{u(!1),a&&a.current&&a.current.focus()};return j.useEffect(()=>{const f=a.current,h=l.current;if(c&&f!==null&&h!==null){const{top:g,left:m}=f.getBoundingClientRect();h.style.top=`${g+f.offsetHeight+Rs}px`,h.style.left=`${Math.min(m,window.innerWidth-h.offsetWidth-20)}px`}},[l,a,c]),j.useEffect(()=>{const f=a.current;if(f!==null&&c){const h=g=>{const m=g.target;s&&l.current&&l.current.contains(m)||f.contains(m)||u(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[l,a,c,s]),j.useEffect(()=>{const f=()=>{if(c){const h=a.current,g=l.current;if(h!==null&&g!==null){const{top:m}=h.getBoundingClientRect(),_=m+h.offsetHeight+Rs;_!==g.getBoundingClientRect().top&&(g.style.top=`${_}px`)}}};return document.addEventListener("scroll",f),()=>{document.removeEventListener("scroll",f)}},[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&&hn.createPortal(b.jsx(jc,{dropDownRef:l,onClose:d,children:o}),document.body)]})}const yu="";function Ac(...n){return n.filter(Boolean).join(" ")}function Lc({"data-test-id":n,children:e,className:t,onClick:r,disabled:i,small:o,title:s}){return b.jsx("button",{disabled:i,className:Ac("Button__root",i&&"Button__disabled",o&&"Button__small",t),onClick:r,title:s,"aria-label":s,...n&&{"data-test-id":n},children:e})}const xu="";function Ic({"data-test-id":n,children:e}){return b.jsx("div",{className:"DialogActions","data-test-id":n,children:e})}const vu="";function ir({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 Fc=({onClose:n})=>{const{margin:e,updatePageMarginValue:t,updateCustomMargin:r}=xi(),[i,o]=Oe.useState(""),s=()=>{const{top:d,right:f,bottom:h,left:g}=e,m=(816-100)/2,_=(1156-25)/2,v=[];if(+d*96>_&&v.push(`*Top margin is too large, maximum allowed is ${(_/96).toFixed(2)} inches.`),+f*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=`${+d*96}px ${+f*96}px ${+h*96}px ${+g*96}px`;t(y),n()}};return b.jsxs(b.Fragment,{children:[b.jsx(ir,{label:"Top",onChange:r,value:e.top,"data-test-id":"custom-margin-top",type:"number",name:"top"}),b.jsx(ir,{label:"Right",onChange:r,value:e.right,"data-test-id":"table-modal-right",type:"number",name:"right"}),b.jsx(ir,{label:"Bottom",onChange:r,value:e.bottom,"data-test-id":"table-modal-bottom",type:"number",name:"bottom"}),b.jsx(ir,{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(Ic,{"data-test-id":"table-model-confirm-insert",children:b.jsx(Lc,{onClick:s,children:"Confirm"})})]})},or=n=>n?"active dropdown-item-active":"",Mc=({isEditable:n})=>{const{pageMarginValue:e,updatePageMarginValue:t}=xi(),[r,i]=Dc();return b.jsxs(b.Fragment,{children:[b.jsxs(Ws,{disabled:!n,buttonClassName:"toolbar-item spaced",buttonLabel:"Page Margin",buttonAriaLabel:"Page margin",buttonIconClassName:" plus",children:[b.jsx(pe,{onClick:()=>t(Me.normal),className:"item "+or(e===Me.normal),children:b.jsx("span",{className:"text",children:"Normal"})}),b.jsx(pe,{onClick:()=>t(Me.narrow),className:"item "+or(e===Me.narrow),children:b.jsx("span",{className:"text",children:"Narrow"})}),b.jsx(pe,{onClick:()=>t(Me.moderate),className:"item "+or(e===Me.moderate),children:b.jsx("span",{className:"text",children:"Moderate"})}),b.jsx(pe,{onClick:()=>t(Me.wide),className:"item "+or(e===Me.wide),children:b.jsx("span",{className:"text",children:"Wide"})}),b.jsx(pe,{onClick:()=>{i("Custom Margin",o=>b.jsx(Fc,{onClose:o}))},className:"item ",children:b.jsx("span",{className:"text",children:"Custom"})})]}),r]})};function $c(){return b.jsx("div",{className:"divider"})}const ln={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"}},Rc=({editor:n,value:e,isRTL:t,disabled:r=!1})=>{const i=ln[e||"left"];return b.jsxs(Ws,{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?ln.start.iconRTL:ln.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?ln.end.iconRTL:ln.end.icon}`}),b.jsx("span",{className:"text",children:"End Align"})]}),b.jsx($c,{}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(hr,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(Ri,void 0)},className:"item",children:[b.jsx("i",{className:"icon "+(t?"outdent":"indent")}),b.jsx("span",{className:"text",children:"Indent"})]})]})},bi=1;function an(){return b.jsx("div",{className:"divider"})}function Wc(){const[n]=ot(),e=j.useRef(null),[t,r]=j.useState(!1),[i,o]=j.useState(!1),[s,l]=j.useState(!1),[a,c]=j.useState(!1),[u,d]=j.useState(!1),[f,h]=j.useState(!1),[g,m]=j.useState(!1),[_,v]=j.useState(!1),[y,x]=j.useState("14px"),[w,k]=j.useState("left"),[S,P]=j.useState(!1),E=j.useCallback(()=>{const T=F();if(O(T)){const M=Nc(T),R=M.getParent();l(T.hasFormat("bold")),c(T.hasFormat("italic")),d(T.hasFormat("underline")),h(T.hasFormat("strikethrough")),m(T.hasFormat("subscript")),v(T.hasFormat("superscript")),P(ys(T)),x(Oa(T,"font-size","14px"));let q;Ec(R)&&(q=Zn(M,Y=>C(Y)&&!Y.isInline())),k(C(q)?q.getFormatType():C(M)?M.getFormatType():(R==null?void 0:R.getFormatType())||"left")}},[]);return j.useEffect(()=>wt(n.registerUpdateListener(({editorState:T})=>{T.read(()=>{E()})}),n.registerCommand(gn,(T,M)=>(E(),!1),bi),n.registerCommand(It,T=>(r(T),!1),bi),n.registerCommand(Lt,T=>(o(T),!1),bi)),[n,E]),b.jsxs("div",{className:"toolbar",ref:e,children:[b.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(mn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:b.jsx("i",{className:"format undo"})}),b.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(_n,void 0)},className:"toolbar-item","aria-label":"Redo",children:b.jsx("i",{className:"format redo"})}),b.jsx(an,{}),b.jsx(Sc,{selectionFontSize:y.slice(0,-2),editor:n}),b.jsx(an,{}),b.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:b.jsx("i",{className:"format bold"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:b.jsx("i",{className:"format italic"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:b.jsx("i",{className:"format underline"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:b.jsx("i",{className:"format strikethrough"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"subscript")},className:"toolbar-item spaced "+(g?"active":""),title:"Subscript","aria-label":"Format text with a subscript",type:"button",children:b.jsx("i",{className:"format subscript"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"superscript")},className:"toolbar-item spaced "+(_?"active":""),title:"Superscript","aria-label":"Format text with a superscript",type:"button",children:b.jsx("i",{className:"format superscript"})}),b.jsx(an,{}),b.jsx("button",{onClick:()=>{n.dispatchCommand(_e,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:b.jsx("i",{className:"format left-align"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(_e,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:b.jsx("i",{className:"format center-align"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(_e,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:b.jsx("i",{className:"format right-align"})}),b.jsx("button",{onClick:()=>{n.dispatchCommand(_e,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:b.jsx("i",{className:"format justify-align"})})," ",b.jsx(an,{}),b.jsx(Mc,{isEditable:!0}),b.jsx(an,{}),b.jsx(Rc,{value:w,editor:n,isRTL:S})]})}const bu="",Bs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?j.useLayoutEffect:j.useEffect;function Bc({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:g="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":y,...x},w){const[k,S]=j.useState(n.isEditable()),P=j.useCallback(T=>{T&&T.ownerDocument&&T.ownerDocument.defaultView?n.setRootElement(T):n.setRootElement(null)},[n]),E=j.useMemo(()=>function(...T){return M=>{T.forEach(R=>{typeof R=="function"?R(M):R!=null&&(R.current=M)})}}(w,P),[P,w]);return Bs(()=>(S(n.isEditable()),n.registerEditableListener(T=>{S(T)})),[n]),b.jsx("div",{...x,"aria-activedescendant":k?e:void 0,"aria-autocomplete":k?t:"none","aria-controls":k?r:void 0,"aria-describedby":i,"aria-expanded":k&&g==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":k?c:void 0,"aria-readonly":!k||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:k,"data-testid":y,id:h,ref:E,role:k?g:void 0,spellCheck:m,style:_,tabIndex:v})}const zc=j.forwardRef(Bc);function zs(n){return n.getEditorState().read(ws(n.isComposing()))}const Kc=j.forwardRef(Uc);function Uc(n,e){const{placeholder:t,...r}=n,[i]=ot();return b.jsxs(b.Fragment,{children:[b.jsx(zc,{editor:i,...r,ref:e}),t!=null&&b.jsx(Vc,{editor:i,content:t})]})}function Vc({content:n,editor:e}){const t=function(s){const[l,a]=j.useState(()=>zs(s));return Bs(()=>{function c(){const u=zs(s);a(u)}return c(),wt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=j.useState(e.isEditable());if(j.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 Jc({className:n,style:e}){return b.jsx(Kc,{className:n||"ContentEditable__root",style:e})}const Yc={};function Hc(n){console.error(n)}function qc(){const{pageMarginValue:n}=xi(),e={namespace:"MyEditor",theme:Yc,onError:Hc};return b.jsx(Ca,{initialConfig:e,children:b.jsxs("div",{className:"editor-shell",children:[b.jsx(Wc,{}),b.jsx("div",{className:"editor-container",children:b.jsxs("div",{className:"editor-inner",children:[b.jsx(yc,{contentEditable:b.jsx("div",{className:"editor-scroller",children:b.jsx("div",{className:"editor",children:b.jsx(Jc,{style:{margin:n}})})}),ErrorBoundary:bc}),b.jsx(Ua,{}),b.jsx(wa,{})]})})]})})}Be.Editor=qc,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})});
41
+ `?a.insertParagraph():c===" "?a.insertNodes([Ht()]):a.insertText(c)}}}else e.insertRawText(i)}function xs(n,e,t){n.dispatchCommand(qs,{nodes:e,selection:t})||t.insertNodes(e)}function bs(n,e,t,r=[]){let o=e===null||t.isSelected(e);const i=b(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Ir(t);c=R(c)&&e!==null?ss(e,c):c,s=c}const l=b(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),h=c.constructor;if(u.type!==h.getType()&&Jn(58,h.name),b(c)){const d=u.children;Array.isArray(d)||Jn(59,h.name)}return u}(s);if(R(s)){const c=s.__text;c.length>0?a.text=c:o=!1}for(let c=0;c<l.length;c++){const u=l[c],h=bs(n,e,u,a.children);!o&&b(t)&&h&&t.extractWithChild(u,e,"clone")&&(o=!0)}if(o&&!i)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 o}function Xa(n,e){const t=[],r=G().getChildren();for(let o=0;o<r.length;o++)bs(n,e,r[o],t);return{namespace:n._config.namespace,nodes:t}}function Qa(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],o=ta(r);R(o)&&xa(o),e.push(o)}return e}let vt=null;async function Cs(n,e,t){if(vt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(ws(n,e,t))})});const r=n.getRootElement(),o=n._window==null?window.document:n._window.document,i=ys(n._window);if(r===null||i===null)return!1;const s=o.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(o.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),i.removeAllRanges(),i.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(fn,h=>(nt(h,ClipboardEvent)&&(u(),vt!==null&&(window.clearTimeout(vt),vt=null),a(ws(n,h,t))),!0),oa);vt=window.setTimeout(()=>{u(),vt=null,a(!1)},50),o.execCommand("copy"),s.remove()})}function ws(n,e,t){if(t===void 0){const o=ys(n._window);if(!o)return!1;const i=o.anchorNode,s=o.focusNode;if(i!==null&&s!==null&&!Ft(n,i,s))return!1;const l=L();if(l===null)return!1;t=ec(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(tc(r,t),!0)}const Za=[["text/html",Ha],["application/x-lexical-editor",Ga]];function ec(n=L()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ml();for(const[r,o]of Za){const i=o(t,n);i!==null&&(e[r]=i)}}return e}function tc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ss(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 xt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,nc=xt&&"documentMode"in document?document.documentMode:null,rc=!(!xt||!("InputEvent"in window)||nc)&&"getTargetRanges"in new window.InputEvent("input"),oc=xt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ic=xt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,sc=xt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),lc=xt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!sc,Es=Ys();function Yn(n){let e=null;if(nt(n,DragEvent)?e=n.dataTransfer:nt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),o=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),o]}function Ts(n){const e=L();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(t.has(s))continue;const l=so(i,c=>b(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=Xe(n);return U(e)}function ac(n){return yt(n.registerCommand(wo,e=>{const t=L();return!!xe(t)&&(t.clear(),!0)},0),n.registerCommand(qe,e=>{const t=L();return!!O(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Nt,e=>{const t=L();return!!O(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(Pt,e=>{const t=L();return!!O(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(lt,e=>{const t=L();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)vs(r,t,n);else if(O(t)){const o=e.data;return o&&t.insertText(o),!0}}return!0},K),n.registerCommand(or,()=>{const e=L();return!!O(e)&&(e.removeText(),!0)},K),n.registerCommand(ge,e=>{const t=L();return!!O(t)&&(t.formatText(e),!0)},K),n.registerCommand(Ot,e=>{const t=L();if(!O(t)&&!xe(t))return!1;const r=t.getNodes();for(const o of r){const i=so(o,s=>b(s)&&!s.isInline());i!==null&&i.setFormat(e)}return!0},K),n.registerCommand(st,e=>{const t=L();return!!O(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(an,()=>{const e=L();return!!O(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(el,()=>(Ql([Ht()]),!0),K),n.registerCommand(tl,()=>Ts(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(Do,()=>Ts(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(To,e=>{const t=L();if(xe(t)&&!qn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(O(t)){const r=Bt(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(ko,e=>{const t=L();if(xe(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(O(t)){if(function(o){const i=o.focus;return i.key==="root"&&i.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Bt(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(Eo,e=>{const t=L();if(xe(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!O(t))return!1;if(as(t,!0)){const r=e.shiftKey;return e.preventDefault(),cs(t,r,!0),!0}return!1},K),n.registerCommand(So,e=>{const t=L();if(xe(t)&&!qn(e.target)){const o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!as(t,!1)&&(e.preventDefault(),cs(t,r,!1),!0)},K),n.registerCommand(No,e=>{if(qn(e.target))return!1;const t=L();if(!O(t))return!1;e.preventDefault();const{anchor:r}=t,o=r.getNode();return t.isCollapsed()&&r.offset===0&&!ie(o)&&Ta(o).getIndent()>0?n.dispatchCommand(Do,void 0):n.dispatchCommand(qe,!0)},K),n.registerCommand(Oo,e=>{if(qn(e.target))return!1;const t=L();return!!O(t)&&(e.preventDefault(),n.dispatchCommand(qe,!1))},K),n.registerCommand(dn,e=>{const t=L();if(!O(t))return!1;if(e!==null){if((ic||oc||lc)&&rc)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(st,!1)}return n.dispatchCommand(an,void 0)},K),n.registerCommand(Po,()=>{const e=L();return!!O(e)&&(n.blur(),!0)},K),n.registerCommand(Ro,e=>{const[,t]=Yn(e);if(t.length>0){const o=Ss(e.clientX,e.clientY);if(o!==null){const{offset:i,node:s}=o,l=Xe(s);if(l!==null){const a=Gl();if(R(l))a.anchor.set(l.getKey(),i,"text"),a.focus.set(l.getKey(),i,"text");else{const u=l.getParentOrThrow().getKey(),h=l.getIndexWithinParent()+1;a.anchor.set(u,h,"element"),a.focus.set(u,h,"element")}const c=Jo(a);Ce(c)}n.dispatchCommand(Es,t)}return e.preventDefault(),!0}const r=L();return!!O(r)},K),n.registerCommand(Io,e=>{const[t]=Yn(e),r=L();return!(t&&!O(r))},K),n.registerCommand(Fo,e=>{const[t]=Yn(e),r=L();if(t&&!O(r))return!1;const o=Ss(e.clientX,e.clientY);if(o!==null){const i=Xe(o.node);U(i)&&e.preventDefault()}return!0},K),n.registerCommand(sr,()=>(Rl(),!0),K),n.registerCommand(fn,e=>(Cs(n,nt(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(ir,e=>(async function(t,r){await Cs(r,nt(t,ClipboardEvent)?t:null),r.update(()=>{const o=L();O(o)?o.removeText():xe(o)&&o.getNodes().forEach(i=>i.remove())})}(e,n),!0),K),n.registerCommand(rr,e=>{const[,t,r]=Yn(e);return t.length>0&&!r?(n.dispatchCommand(Es,t),!0):vr(e.target)?!1:L()!==null&&(function(o,i){o.preventDefault(),i.update(()=>{const s=L(),l=nt(o,InputEvent)||nt(o,KeyboardEvent)?null:o.clipboardData;l!=null&&s!==null&&vs(l,s,i)},{tag:"paste"})}(e,n),!0)},K))}const co=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect;function ks(n){return n.getEditorState().read(is(n.isComposing()))}function cc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=tt(),o=function(i,s){const[l,a]=F.useState(()=>i.getDecorators());return co(()=>i.registerDecoratorListener(c=>{sn.flushSync(()=>{a(c)})}),[i]),F.useEffect(()=>{a(i.getDecorators())},[i]),F.useMemo(()=>{const c=[],u=Object.keys(l);for(let h=0;h<u.length;h++){const d=u[h],f=E.jsx(s,{onError:_=>i._onError(_),children:E.jsx(F.Suspense,{fallback:null,children:l[d]})}),g=i.getElementByKey(d);g!==null&&c.push(sn.createPortal(f,g,d))}return c},[s,l,i])}(r,t);return function(i){co(()=>yt(ac(i),Ka(i)),[i])}(r),E.jsxs(E.Fragment,{children:[n,E.jsx(uc,{content:e}),o]})}function uc({content:n}){const[e]=tt(),t=function(o){const[i,s]=F.useState(()=>ks(o));return co(()=>{function l(){const a=ks(o);s(a)}return l(),yt(o.registerUpdateListener(()=>{l()}),o.registerEditableListener(()=>{l()}))},[o]),i}(e),r=$a();return t?typeof n=="function"?n(r):n:null}function uo(n,e){return uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},uo(n,e)}var Ns={error:null},dc=function(n){var e,t;function r(){for(var i,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(i=n.call.apply(n,[this].concat(l))||this).state=Ns,i.resetErrorBoundary=function(){for(var c,u=arguments.length,h=new Array(u),d=0;d<u;d++)h[d]=arguments[d];i.props.onReset==null||(c=i.props).onReset.apply(c,h),i.reset()},i}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,uo(e,t),r.getDerivedStateFromError=function(i){return{error:i}};var o=r.prototype;return o.reset=function(){this.setState(Ns)},o.componentDidCatch=function(i,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,i,s)},o.componentDidUpdate=function(i,s){var l,a,c,u,h=this.state.error,d=this.props.resetKeys;h!==null&&s.error!==null&&((c=i.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(f,g){return!Object.is(f,u[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,i.resetKeys,d),this.reset())},o.render=function(){var i=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(i!==null){var u={error:i,resetErrorBoundary:this.resetErrorBoundary};if(kt.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return kt.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(kt.Component);function fc({children:n,onError:e}){return E.jsx(dc,{fallback:E.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}var ke=(n=>(n.normal="1px",n.narrow="48px",n.moderate="96px 72px",n.wide="96px 192px",n))(ke||{});const hc=F.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),Hn=()=>F.useContext(hc),Xc="";function gc({onClose:n,children:e,title:t,closeOnClickOutside:r}){const o=F.useRef(null);return F.useEffect(()=>{o.current!==null&&o.current.focus()},[]),F.useEffect(()=>{let i=null;const s=c=>{c.key==="Escape"&&n()},l=c=>{const u=c.target;o.current!==null&&!o.current.contains(u)&&r&&n()},a=o.current;return a!==null&&(i=a.parentElement,i!==null&&i.addEventListener("click",l)),window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s),i!==null&&(i==null||i.removeEventListener("click",l))}},[r,n]),E.jsx("div",{className:"Modal__overlay",role:"dialog",children:E.jsxs("div",{className:"Modal__modal",tabIndex:-1,ref:o,children:[E.jsx("h2",{className:"Modal__title",children:t}),E.jsx("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:n,children:"X"}),E.jsx("div",{className:"Modal__content",children:e})]})})}function pc({onClose:n,children:e,title:t,closeOnClickOutside:r=!1}){return sn.createPortal(E.jsx(gc,{onClose:n,title:t,closeOnClickOutside:r,children:e}),document.body)}function _c(){const[n,e]=F.useState(null),t=F.useCallback(()=>{e(null)},[]),r=F.useMemo(()=>{if(n===null)return null;const{title:i,content:s,closeOnClickOutside:l}=n;return E.jsx(pc,{onClose:t,title:i,closeOnClickOutside:l,children:s})},[n,t]),o=F.useCallback((i,s,l=!1)=>{e({closeOnClickOutside:l,content:s(t),title:i})},[t]);return[r,o]}const Ps=kt.createContext(null),Os=4;function en({children:n,className:e,onClick:t,title:r}){const o=F.useRef(null),i=kt.useContext(Ps);if(i===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=i;return F.useEffect(()=>{o&&o.current&&s(o)},[o,s]),E.jsx("button",{className:e,onClick:t,ref:o,title:r,type:"button",children:n})}function mc({children:n,dropDownRef:e,onClose:t}){const[r,o]=F.useState(),[i,s]=F.useState(),l=F.useCallback(u=>{o(h=>h?[...h,u]:[u])},[o]),a=u=>{if(!r)return;const h=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(h)&&u.preventDefault(),h==="Escape"||h==="Tab"?t():h==="ArrowUp"?s(d=>{if(!d)return r[0];const f=r.indexOf(d)-1;return r[f===-1?r.length-1:f]}):h==="ArrowDown"&&s(d=>d?r[r.indexOf(d)+1]:r[0])},c=F.useMemo(()=>({registerItem:l}),[l]);return F.useEffect(()=>{r&&!i&&s(r[0]),i&&i.current&&i.current.focus()},[r,i]),E.jsx(Ps.Provider,{value:c,children:E.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function yc({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:o,children:i,stopCloseOnClickSelf:s}){const l=F.useRef(null),a=F.useRef(null),[c,u]=F.useState(!1),h=()=>{u(!1),a&&a.current&&a.current.focus()};return F.useEffect(()=>{const d=a.current,f=l.current;if(c&&d!==null&&f!==null){const{top:g,left:_}=d.getBoundingClientRect();f.style.top=`${g+d.offsetHeight+Os}px`,f.style.left=`${Math.min(_,window.innerWidth-f.offsetWidth-20)}px`}},[l,a,c]),F.useEffect(()=>{const d=a.current;if(d!==null&&c){const f=g=>{const _=g.target;s&&l.current&&l.current.contains(_)||d.contains(_)||u(!1)};return document.addEventListener("click",f),()=>{document.removeEventListener("click",f)}}},[l,a,c,s]),F.useEffect(()=>{const d=()=>{if(c){const f=a.current,g=l.current;if(f!==null&&g!==null){const{top:_}=f.getBoundingClientRect(),m=_+f.offsetHeight+Os;m!==g.getBoundingClientRect().top&&(g.style.top=`${m}px`)}}};return document.addEventListener("scroll",d),()=>{document.removeEventListener("scroll",d)}},[a,l,c]),E.jsxs(E.Fragment,{children:[E.jsxs("button",{type:"button",disabled:n,"aria-label":t||e,className:r,onClick:()=>u(!c),ref:a,children:[o&&E.jsx("span",{className:o}),e&&E.jsx("span",{className:"text dropdown-button-text",children:e}),E.jsx("i",{className:"chevron-down"})]}),c&&sn.createPortal(E.jsx(mc,{dropDownRef:l,onClose:h,children:i}),document.body)]})}const Qc="";function vc(...n){return n.filter(Boolean).join(" ")}function xc({"data-test-id":n,children:e,className:t,onClick:r,disabled:o,small:i,title:s}){return E.jsx("button",{disabled:o,className:vc("Button__root",o&&"Button__disabled",i&&"Button__small",t),onClick:r,title:s,"aria-label":s,...n&&{"data-test-id":n},children:e})}const Zc="";function bc({"data-test-id":n,children:e}){return E.jsx("div",{className:"DialogActions","data-test-id":n,children:e})}const eu="";function Gn({label:n,value:e,onChange:t,placeholder:r="","data-test-id":o,type:i="text",name:s=""}){return E.jsxs("div",{className:"Input__wrapper",children:[E.jsx("label",{className:"Input__label",children:n}),E.jsx("input",{type:i,className:"Input__input",placeholder:r,value:e,name:s,onChange:l=>{t(l.target.value,l.target.name)},"data-test-id":o})]})}const Cc=({onClose:n})=>{const{margin:e,updatePageMarginValue:t,updateCustomMargin:r}=Hn(),o=()=>{const{top:i,right:s,bottom:l,left:a}=e,c=`${+i*96}px ${+s*96}px ${+l*96}px ${+a*96}px`;t(c),n()};return E.jsxs(E.Fragment,{children:[E.jsx(Gn,{label:"Top",onChange:r,value:e.top,"data-test-id":"custom-margin-top",type:"number",name:"top"}),E.jsx(Gn,{label:"Right",onChange:r,value:e.right,"data-test-id":"table-modal-right",type:"number",name:"right"}),E.jsx(Gn,{label:"Bottom",onChange:r,value:e.bottom,"data-test-id":"table-modal-bottom",type:"number",name:"bottom"}),E.jsx(Gn,{label:"Left",onChange:r,value:e.left,"data-test-id":"table-modal-left",type:"number",name:"left"}),E.jsx(bc,{"data-test-id":"table-model-confirm-insert",children:E.jsx(xc,{onClick:o,children:"Confirm"})})]})},Xn=n=>n?"active dropdown-item-active":"",wc=({isEditable:n})=>{const{pageMarginValue:e,updatePageMarginValue:t}=Hn(),[r,o]=_c();return E.jsxs(E.Fragment,{children:[E.jsxs(yc,{disabled:!n,buttonClassName:"toolbar-item spaced",buttonLabel:"Page Margin",buttonAriaLabel:"Page margin",buttonIconClassName:" plus",children:[E.jsx(en,{onClick:()=>t(ke.normal),className:"item "+Xn(e===ke.normal),children:E.jsx("span",{className:"text",children:"Normal"})}),E.jsx(en,{onClick:()=>t(ke.narrow),className:"item "+Xn(e===ke.narrow),children:E.jsx("span",{className:"text",children:"Narrow"})}),E.jsx(en,{onClick:()=>t(ke.moderate),className:"item "+Xn(e===ke.moderate),children:E.jsx("span",{className:"text",children:"Moderate"})}),E.jsx(en,{onClick:()=>t(ke.wide),className:"item "+Xn(e===ke.wide),children:E.jsx("span",{className:"text",children:"Wide"})}),E.jsx(en,{onClick:()=>{o("Custom Margin",i=>E.jsx(Cc,{onClose:i}))},className:"item ",children:E.jsx("span",{className:"text",children:"Custom"})})]}),r]})},Sc=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Ec(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),o=n.focus.getNode();return r===o?r:n.isBackward()?ls(t)?r:o:ls(e)?r:o}const fo=1;function ho(){return E.jsx("div",{className:"divider"})}function Tc(){const[n]=tt(),{updatePageMarginValue:e}=Hn(),t=F.useRef(null),[r,o]=F.useState(!1),[i,s]=F.useState(!1),[l,a]=F.useState(!1),[c,u]=F.useState(!1),[h,d]=F.useState(!1),[f,g]=F.useState(!1),[_,m]=F.useState(()=>n.isEditable());function x(y){}const v=F.useCallback(()=>{const y=L();if(O(y)){const S=Ec(y),w=S.getParent();a(y.hasFormat("bold")),u(y.hasFormat("italic")),d(y.hasFormat("underline")),g(y.hasFormat("strikethrough"));let C;pt(w)&&(C=Sc(S,N=>b(N)&&!N.isInline())),b(C)?C.getFormatType():b(S)?S.getFormatType():w!=null&&w.getFormatType(),e(ke)}},[]);return F.useEffect(()=>yt(n.registerUpdateListener(({editorState:y})=>{y.read(()=>{v()})}),n.registerCommand(ln,(y,S)=>(v(),!1),fo),n.registerCommand(Rt,y=>(o(y),!1),fo),n.registerCommand(Dt,y=>(s(y),!1),fo)),[n,v]),E.jsxs("div",{className:"toolbar",ref:t,children:[E.jsx("button",{disabled:!r,onClick:()=>{n.dispatchCommand(cn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:E.jsx("i",{className:"format undo"})}),E.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(un,void 0)},className:"toolbar-item","aria-label":"Redo",children:E.jsx("i",{className:"format redo"})}),E.jsx(ho,{}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"bold")},className:"toolbar-item spaced "+(l?"active":""),"aria-label":"Format Bold",children:E.jsx("i",{className:"format bold"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"italic")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Italics",children:E.jsx("i",{className:"format italic"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"underline")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Underline",children:E.jsx("i",{className:"format underline"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:E.jsx("i",{className:"format strikethrough"})}),E.jsx(ho,{}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:E.jsx("i",{className:"format left-align"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:E.jsx("i",{className:"format center-align"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:E.jsx("i",{className:"format right-align"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:E.jsx("i",{className:"format justify-align"})})," ",E.jsx(ho,{}),E.jsx(wc,{isEditable:_})]})}const kc={};function Nc(n){console.error(n)}function Pc(){return E.jsx("div",{className:"divider-horizontal"})}function Oc(){const{pageMarginValue:n}=Hn(),e={namespace:"MyEditor",theme:kc,onError:Nc};function t(){return E.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}return E.jsxs(ua,{initialConfig:e,children:[E.jsx("div",{className:"editor-container",children:E.jsx(Tc,{})}),E.jsxs("div",{className:"editor-container",children:[E.jsx(Pc,{}),E.jsxs("div",{className:"editor-inner",children:[E.jsx(cc,{contentEditable:E.jsx(Pa,{style:{margin:`${n}`},className:"editor-input"}),placeholder:E.jsx(t,{}),ErrorBoundary:fc}),E.jsx(Ba,{}),E.jsx(da,{})]})]})]})}Ae.Editor=Oc,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});
43
42
  //# sourceMappingURL=index.umd.js.map