cekat-ui 1.3.18 → 1.3.19

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.
@@ -0,0 +1,35 @@
1
+ (function(ln,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],R):(ln=typeof globalThis<"u"?globalThis:ln||self,R(ln.CekatUIEditor={},ln.ReactJSXRuntime,ln.React,ln.ReactDOM))})(this,(function(ln,R,m,Fr){"use strict";function o_(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const ce=o_(m);function L(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ld(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const it=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,i_=it&&"documentMode"in document?document.documentMode:null,Or=it&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),an=it&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Kr=!(!it||!("InputEvent"in window)||i_)&&"getTargetRanges"in new window.InputEvent("input"),un=it&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1),Id=it&&/Android/.test(navigator.userAgent),Io=it&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Id,Fd=it&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Hi=it&&Id&&Fd,Fo=it&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Or&&!Fd,s_=0,l_=1,a_=2,Od=128,u_=1,c_=2,d_=3,f_=4,h_=5,g_=6,Oo=Io||un||Fo?" ":"​",Wn=`
2
+
3
+ `,la=an?" ":Oo,cn={bold:1,capitalize:1024,code:16,highlight:Od,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},p_={directionless:1,unmergeable:2},ji={center:2,end:6,justify:4,left:1,right:3,start:5},m_={[c_]:"center",[g_]:"end",[f_]:"justify",[u_]:"left",[d_]:"right",[h_]:"start"},y_={normal:0,segmented:2,token:1},b_={[s_]:"normal",[a_]:"segmented",[l_]:"token"},Kd=Symbol.for("@lexical/ctrlOrOtherKey"),Nd="$config";function aa(){return Ke()._blockCursorElement}function ua(t){return t!==null&&t.nodeType===1&&t.hasAttribute("data-lexical-slot")}const v_=Fo||un||Io;function Rd(){const t=Ce().createElement("img");t.setAttribute("data-lexical-decorator-boundary","true"),t.alt="";for(const[e,n]of[["position","absolute"],["width","0px"],["height","0px"],["border","0px"],["margin","0px"],["padding","0px"]])t.style.setProperty(e,n,"important");return t}function Gi(t){return t!==null&&t.nodeType===1&&t.hasAttribute("data-lexical-decorator-boundary")}let Bd=class oa{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||null}withBefore(e){return new oa(this.element,e,this.after)}withAfter(e){return new oa(this.element,this.before,e)}withElement(e){return this.element===e?this:new oa(e,this.before,this.after)}insertChild(e){const n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&L(357),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&L(358),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&L(359),this.element.replaceChild(e,n),this}getFirstChild(){const e=this.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,n,r){if(this.element===e)return n===e&&r===0?"before":"after";const o=zd(e,this.element);if(o===null)return"after";const i=Array.prototype.indexOf.call(e.childNodes,o);if(i<0)return"after";if(n===e)return r<=i?"before":"after";const s=zd(e,n);if(s===null)return"after";const l=Array.prototype.indexOf.call(e.childNodes,s);return l>=0&&l<=i?"before":"after"}getInsertionAnchor(){return this.before}};function zd(t,e){let n=e;for(;n!==null&&n.parentNode!==t;)n=n.parentNode;return n}let Vd=class ia extends Bd{withBefore(e){return new ia(this.element,e,this.after)}withAfter(e){return new ia(this.element,this.before,e)}withElement(e){return this.element===e?this:new ia(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor("trailing")}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;for(;ua(n);)e=n,n=n.nextSibling;Gi(n)&&(e=n,n=n.nextSibling);const r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===aa()?r:e}getDecoratorBoundaryAnchor(e){let n;if(e==="leading"){const r=super.getFirstChildAnchor();for(n=r?r.nextSibling:this.element.firstChild;ua(n);)n=n.nextSibling}else n=this.before?this.before.previousSibling:this.element.lastChild,n!==null&&n===aa()&&(n=n.previousSibling);return Gi(n)?n:null}setDecoratorBoundaryAnchor(e,n){const r=this.getDecoratorBoundaryAnchor(e);if(n!==(r!==null))if(r!==null)this.element.removeChild(r);else if(e==="leading"){const o=this.getFirstChildAnchor();this.element.insertBefore(Rd(),o?o.nextSibling:this.element.firstChild)}else this.element.insertBefore(Rd(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){const n=this.element,r=this.after===null?n.firstChild:this.after.nextSibling,o=e==="empty"&&ua(r)?null:e;if(n.__lexicalLastChildKind!==o)if(n.__lexicalLastChildKind=o,o===null)this.removeManagedLineBreak();else{const i=o==="decorator"&&v_;this.insertManagedLineBreak(i)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const n=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&n.removeChild(r),n.removeChild(e),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const n=this.getManagedLineBreak();if(n){if(e===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before||this.getDecoratorBoundaryAnchor("trailing"),i=Ce().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,o),e){const s=Ce().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){const e=this.getFirstChild(),n=this.getInsertionAnchor();let r=0;for(let o=this.element.firstChild;o!==null&&o!==e&&o!==n;o=o.nextSibling)r++;return r}resolveChildIndex(e,n,r,o){if(r===this.element){const a=this.getFirstChildOffset(),u=aa(),c=this.element.childNodes,d=Math.min(o,c.length);let f=0;for(let h=a;h<d;h++)c[h]!==u&&f++;return[e,Math.min(f,e.getChildrenSize())]}const i=Ud(n,r);i.push(o);const s=Ud(n,this.element);let l=e.getIndexWithinParent();for(let a=0;a<s.length;a++){const u=i[a],c=s[a];if(u===void 0||u<c)break;if(u>c){l+=1;break}}return[e.getParentOrThrow(),l]}};function Ud(t,e){const n=[];let r=e;for(;r!==t&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==t&&L(225),n.reverse()}let Hd;try{Hd="0.50.0+prod.esm"}catch{}const jd=Hd??'"<unknown>+source"';let Ko=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const n of this._back)e.push(n);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const Jn=null;function Gd(t,e=1e3){return t instanceof ca?t.clone():t.size<e?new Map(t):new ca().init(new Map(t),void 0,t.size)}let ca=class n_{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new n_().init(this._old,this._nursery,this._size)}init(e,n,r){return this._old=e,this._nursery=n,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){const n=this._nursery&&this._nursery.get(e);return n!==void 0?n:this._old&&this._old.get(e)}get(e){const n=this.getWithTombstone(e);return n===Jn?void 0:n}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const n=new Map(this._old);for(const[r,o]of this._nursery)o!==Jn?n.set(r,o):n.delete(r);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(e,n){const r=this.getWithTombstone(e);if(r===n)return this;const o=this.getNursery();return r!==Jn&&r!==void 0||(this._size++,r===Jn&&o.delete(e)),o.set(e,n),this}delete(e){const n=this.has(e);return n&&(this.getNursery().set(e,Jn),this._size--),n}getOrInsert(e,n){const r=this.get(e);return r!==void 0?r:(this.set(e,n),n)}getOrInsertComputed(e,n){const r=this.get(e);if(r!==void 0)return r;const o=n(e);return this.set(e,o),o}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,n=this._old;if(n)for(const r of n){const o=r[0],i=e?e.get(o):void 0;i!==Jn&&(i!==void 0&&(r[1]=i),yield r)}if(e)for(const r of e)r[1]===Jn||n&&n.has(r[0])||(yield r)}forEach(e,n){n!==void 0&&(e=e.bind(n));for(const[r,o]of this.entries())e(o,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function qi(t,e,n,r,o,i){if(P(t)){let s=t.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&((P(s)||mr(s)&&s.__slots!==null)&&qi(s,l,n,r,o,i),n.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}for(const s of mr(t)&&t.__slots!==null?t.__slots.values():[]){const l=r.get(s);l!==void 0&&yr(l)&&l.__slotHost===e&&((P(l)||mr(l)&&l.__slots!==null)&&qi(l,s,n,r,o,i),n.has(s)||i.delete(s),o.push(s))}}let da=!1,fa=0;function x_(t){fa=t.timeStamp}function ha(t,e,n){const r=t.nodeName==="BR",o=e.__lexicalLineBreak;return o&&(t===o||r&&t.previousSibling===o)||r&&eo(t,n)!==void 0}function __(t,e,n){const r=ct(gt(n)),o=r&&pt(r,n._rootElement);let i=null,s=null;o!==null&&o.anchorNode===t&&(i=o.anchorOffset,s=o.focusOffset);const l=t.nodeValue;l!==null&&uu(e,l,i,s,!1)}function S_(t,e,n){if(A(t)){const r=t.anchor.getNode();if(r.is(n)&&t.format!==r.getFormat())return!1}return qt(e)&&n.isAttached()}function C_(t,e,n){for(let r=t;r&&!Pg(r);r=gr(r)){const o=eo(r,e);if(o!==void 0){const i=Te(o,n);if(i)return oe(i)||!fe(r)?void 0:[r,i]}}}function qd(t,e,n){da=!0;const r=performance.now()-fa>100;try{Et(t,()=>{const o=z()||(function(d){return d.read("latest",()=>{const f=z();return f!==null?f.clone():null})})(t),i=new Map,s=t._editorState,l=t._blockCursorElement;let a=!1,u="";for(let d=0;d<e.length;d++){const f=e[d],h=f.type,g=f.target,b=C_(g,t,s);if(!b)continue;const[p,y]=b;if(h==="characterData")r&&O(y)&&qt(g)&&S_(o,g,y)&&__(g,y,t);else if(h==="childList"){a=!0;const v=f.addedNodes;for(let C=0;C<v.length;C++){const T=v[C],k=ag(T),S=T.parentNode;if(!(S==null||T===l||k!==null||ha(T,S,t)||Gi(T)||t._slotsUsed&&fe(T)&&T.hasAttribute("data-lexical-slot")||Pg(T))){if(an){const w=(fe(T)?T.innerText:null)||T.nodeValue;w&&(u+=w)}S.removeChild(T)}}const x=f.removedNodes,_=x.length;if(_>0){let C=0;for(let T=0;T<_;T++){const k=x[T];ha(k,g,t)||l===k?(g.appendChild(k),C++):Gi(k)&&C++}_!==C&&i.set(p,y)}}}if(i.size>0)for(const[d,f]of i)f.reconcileObservedMutation(d,t);const c=n.takeRecords();if(c.length>0){for(let d=0;d<c.length;d++){const f=c[d],h=f.addedNodes,g=f.target;for(let b=0;b<h.length;b++){const p=h[b],y=p.parentNode;y==null||p.nodeName!=="BR"||ha(p,g,t)||y.removeChild(p)}}n.takeRecords()}o!==null&&(a&&ze(o),an&&bg(t)&&o.insertRawText(u))})}finally{da=!1}}function Yd(t){const e=t._observer;e!==null&&qd(t,e.takeRecords(),e)}function Zd(t){(function(e){fa===0&&gt(e).addEventListener("textInput",x_,!0)})(t),t._observer=new MutationObserver((e,n)=>{qd(t,e,n)})}const Xd="latest";let E_=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||T_).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}};function Nr(t,e){return new E_(t,e)}function Rr(t,e,n=Xd){const r=(n===Xd?t.getLatest():t).__state;return r?r.getValue(e):e.defaultValue}function No(t,e,n){let r;if(je(),typeof n=="function"){const i=t.getLatest(),s=Rr(i,e);if(r=n(s),e.isEqual(s,r))return i}else r=n;const o=t.getWritable();return Wd(o).updateFromKnown(e,r),o}function w_(t){const e=new Map,n=new Set;for(const{ownNodeConfig:r}of vu(typeof t=="function"?t:t.replace))if(r&&r.stateConfigs)for(const o of r.stateConfigs){let i;"stateConfig"in o?(i=o.stateConfig,o.flat&&n.add(i.key)):i=o,e.set(i.key,i)}return{flatKeys:n,sharedConfigMap:e}}const Qd=new Set(["__proto__","constructor","prototype"]);let k_=class r_{node;knownState;unknownState;sharedNodeState;size;constructor(e,n,r=void 0,o=new Map,i=void 0){this.node=e,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,l=i!==void 0?i:(function(a,u,c){let d=c.size;if(u)for(const f in u){const h=a.get(f);h&&c.has(h)||d++}return d})(s,r,o);this.size=l}getValue(e){const n=this.knownState.get(e);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const o=this.unknownState[e.key];o!==void 0&&(r=e.parse(o)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in e&&(n[r]=e[r],delete e[r]);return ef(e)&&(n.$=e),n}getWritable(e){if(this.node===e)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new r_(e,n,(function(i,s,l){let a;if(l)for(const[u,c]of Object.entries(l)){if(Qd.has(u))continue;const d=i.get(u);d?s.has(d)||s.set(d,d.parse(c)):(a=a||{},a[u]=c)}return a})(n.sharedConfigMap,o,r),o,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,n){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:o,unknownState:i}=this;o.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=ef(i)),this.size++),o.set(e,n)}updateFromUnknown(e,n){if(Qd.has(e))return;const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=n)}updateFromJSON(e){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,e)for(const[r,o]of Object.entries(e))this.updateFromUnknown(r,o)}};function Wd(t){const e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new k_(e,Jd(e));return e.__state=n,n}function Jd(t){return t.__state?t.__state.sharedNodeState:ig(Ke(),t.getType()).sharedNodeState}function ef(t){if(t)for(const e in t)return t}function T_(t){return t}function tf(t,e,n){for(const[r,o]of e.knownState){if(t.has(r.key))continue;t.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function nf(t,e,n){const{unknownState:r}=e,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!t.has(i)&&(t.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function rf(t,e){const n=t.__state;return n&&n.node===t?n.getWritable(e):n}function of(t,e){const n=t.__mode,r=t.__format,o=t.__style,i=e.__mode,s=e.__format,l=e.__style,a=t.__state,u=e.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===l)&&(t.__state===null||a===u||(function(c,d){if(c===d)return!0;const f=new Set;return!(c&&tf(f,c,d)||d&&tf(f,d,c)||c&&nf(f,c,d)||d&&nf(f,d,c))})(a,u))}function sf(t,e){const n=t.mergeWithSibling(e),r=ge()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function lf(t){let e,n,r=t;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&O(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(of(e,r)){r=sf(e,r);break}break}e.remove()}for(;(n=r.getNextSibling())!==null&&O(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(of(r,n)){r=sf(r,n);break}break}n.remove()}}else r.remove()}function Br(t){return af(t.anchor),af(t.focus),t}function af(t){for(;t.type==="element";){const e=t.getNode(),n=t.offset;let r,o;if(n===e.getChildrenSize()?(r=e.getChildAtIndex(n-1),o=!0):(r=e.getChildAtIndex(n),o=!1),O(r)){t.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!P(r))break;t.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}const Ro=Symbol.for("@lexical/CachedTextSize");function uf(t,e){return pa.read(()=>{let n=0,r=t;for(let o=0;o<e&&r!==null;o++){const i=Nt.get(r);if(i===void 0&&L(345,r),P(i)){const s=$e.get(r);if(s!==void 0&&P(s)&&s.__parent!==i.__parent)n+=i.getTextContentSize();else{const l=er.get(r),a=l&&l.__lexicalTextContent;typeof a!="string"&&L(346,i.getType()),n+=a.length}o<e-1&&!i.isInline()&&(n+=2)}else{const s=i[Ro];s===void 0&&L(347,i.getType(),r),n+=s}r=i.__next}return n},{editor:de})}function cf(t){P(t)||t[Ro]===void 0&&(t[Ro]=O(t)?t.__text.length:t.getTextContentSize())}const P_=4;let Bo,de,zo,ie="",Oe=null,st=null,Je=null;function jt(){return{firstTextKey:Je,format:Oe,style:st}}function St(t){t.firstTextKey!==null&&(Oe=t.format,st=t.style,Je=t.firstTextKey)}function ga(t){if(Je!==null)return;const e=t.__lexicalFirstTextKey;if(e===void 0&&L(348),e===null)return;const n=$e.get(e);O(n)&&(Oe=n.getFormat(),st=n.getStyle(),Je=e)}let Yi,Vo,Uo,Nt,pa,$e,er,ma,Ho,tr,dn=!1,Zi=!1;function Dn(t,e){const n=Nt.get(t),r=$e.has(t);if(e!==null){const o=Sa(t);o.parentNode===e&&e.removeChild(o)}if(!r){if(de._keyToDOMMap.delete(t),P(n)){const o=Ns(n,Nt);ya(o,0,o.length-1,null)}if(n!==void 0){for(const o of Ct(n).values()){const i=va(o);Dn(o,null),i!==null&&i.remove()}du(Ho,zo,Yi,n,"destroyed")}}}function ya(t,e,n,r){for(let o=e;o<=n;++o){const i=t[o];i!==void 0&&Dn(i,r)}}function nr(t,e){t.setProperty("text-align",e)}const $_="40px";function df(t,e){const n=Bo.theme.indent;if(typeof n=="string"){const r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}t.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * var(--lexical-indent-base-value, ${$_}))`),ai(t,"class"),ai(t,"style")}function ff(t,e){const n=t.style;e===0?nr(n,""):e===1?nr(n,"left"):e===2?nr(n,"center"):e===3?nr(n,"right"):e===4?nr(n,"justify"):e===5?nr(n,"start"):e===6&&nr(n,"end"),ai(t,"style")}function ba(t,e){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(Ie(r))return null;const i=r.getParent();return i===null||be(i)&&i.__dir===null?"auto":null})(e);n!==null?t.dir=n:t.removeAttribute("dir")}function hf(t){const e=Ce().createElement("div");return e.setAttribute("data-lexical-slot",t),e.style.display="none",e}function gf(t,e,n){e||t.contentEditable==="false"?JS(n,de):n.removeAttribute("contenteditable")}function pf(t,e,n){const r=ie,o=jt();ie="";let i="";const s=oe(t);for(const[l,a]of n){const u=hf(l);gf(e,s,u),e.appendChild(u),ie="";const c=jt();Mn(a,vt(t,u,de)),St(c),mf(t,l,e,u),i+=ie}return St(o),ie=r,i}function Ct(t){return mr(t)&&t.__slots!==null?t.__slots:Ag}function mf(t,e,n,r){const o=tr.$getSlotTargetElement(t,e,n,de);o!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display="")}function va(t){const e=er.get(t);return e!==void 0?e.parentElement:null}function yf(t,e,n){const r=Ct(t),o=Ct(e);for(const[c,d]of r)if(!o.has(c)){const f=va(d);Dn(d,null),f!==null&&f.remove()}const i=ie,s=jt();let l="",a=null;const u=oe(e);for(const[c,d]of o){const f=r.get(c);let h=f!==void 0?va(f):null;ie="";const g=jt();if(h===null){h=hf(c);let b=null;for(const p of n.children)if(!p.hasAttribute("data-lexical-slot")){b=p;break}n.insertBefore(h,b),Mn(d,vt(e,h,de))}else f===d?fn(d,h):(f!==void 0&&Dn(f,h),Mn(d,vt(e,h,de)));if(St(g),gf(n,u,h),mf(e,c,n,h),l+=ie,h.parentElement===n){const b=a===null?n.firstChild:a.nextSibling;b!==h&&n.insertBefore(h,b),a=h}}return St(s),ie=i,l}function Mn(t,e){const n=$e.get(t);if(n===void 0&&L(60),e!==null){const o=Nt.get(t);if(o!==void 0){const i=er.get(t);if(i!==void 0){const s=yr(o)?o.__slotHost:null,l=yr(n)?n.__slotHost:null,a=o.__parent!==n.__parent||s!==l,u=l!==null&&i.parentElement!==e.element;if(a||u)return e.insertChild(i),fn(t,e.element)}}}const r=tr.$createDOM(n,de);if((function(o,i,s){const l=s._keyToDOMMap;ug(i,s,o),l.set(o,i)})(t,r,de),O(n)?r.setAttribute("data-lexical-text","true"):oe(n)&&(r.setAttribute("data-lexical-decorator","true"),WS(r,{captureSelection:!0})),P(n)){const o=n.__indent,i=n.__size;ba(r,n),o!==0&&df(r,o);const s=Ct(n),l=s.size>0?pf(n,r,s):"";if(i===0)r.__lexicalTextContent=l,r.__lexicalFirstTextKey=null,ie+=l,s.size>0&&(r.__lexicalSlotTextLength=l.length);else{const u=ie,c=i-1;if(xa(Ns(n,$e),n,0,c,vt(n,r,de)),l!==""){const d=r.__lexicalTextContent||"";r.__lexicalTextContent=l+d,ie=u+l+d}s.size>0&&(r.__lexicalSlotTextLength=l.length)}const a=n.__format;a!==0&&ff(r,a),n.isInline()||(xf(null,n,r),vf(n,r))}else{const o=n.getTextContent();if(oe(n)){const i=n.decorate(de,Bo);i!==null&&Sf(t,i),r.contentEditable="false";const s=Ct(n);s.size>0&&pf(n,r,s)}ie+=o}return e!==null&&e.insertChild(r),tr.$decorateDOM(n,null,r,de),cf(n),du(Ho,zo,Yi,n,"created"),r}function xa(t,e,n,r,o){const i=ie,s=jt();ie="",Oe=null,st=null,Je=null;let l=n;for(;l<=r;++l){const u=jt();Mn(t[l],o);const c=$e.get(t[l]);c!==null&&O(c)?Oe===null&&(Oe=c.getFormat(),st=c.getStyle(),Je=c.__key):P(c)&&l<r&&!c.isInline()&&(ie+=Wn),St(u)}const a=de._keyToDOMMap.get(e.__key);a===void 0&&L(349,e.__key),a.__lexicalTextContent=ie,a.__lexicalFirstTextKey=Je,ie=i+ie,St(s)}function bf(t,e){if(!t)return!1;const n=e.get(t);return oe(n)&&!n.isInline()}function vf(t,e){const n=vt(t,e,de);n.setDecoratorBoundaryAnchor("leading",bf(t.__first,$e)),n.setDecoratorBoundaryAnchor("trailing",bf(t.__last,$e))}function xf(t,e,n){const r=vt(e,n,de),o=(function(i,s){if(i){const l=i.__last;if(l){const a=s.get(l);if(a)return Ze(a)?"line-break":oe(a)&&a.isInline()?"decorator":null}return"empty"}return null})(e,$e);r.setManagedLineBreak(o)}function D_(t,e,n){var r;Oe=null,st=null,Je=null,(function(o,i,s){const l=ie,a=o.__size,u=i.__size;ie="";const c=s.element,d=de._keyToDOMMap.get(i.__key);d===void 0&&L(351,i.__key);const f=u-a;if(!dn&&Math.abs(f)<=1&&a>=P_&&o.__first===i.__first&&(f!==0||!de._cloneNotNeeded.has(o.__key))){const h=d.__lexicalTextContent,g=ma.get(o.__key);if(!dn&&typeof h=="string"&&g!==void 0){const b=(function(p,y){const v=y.size;if(v===0||v>=p.__size)return null;let x=p.__last,_=null,C=0;for(;x!==null&&C<v;){if(!y.has(x))return null;_=x;const T=$e.get(x);if(T===void 0)return null;x=T.__prev,C++}return C!==v||x!==null&&y.has(x)?null:_})(i,g);if(b!==null){const p=g.size;if(f===0){const y=uf(b,p);let v=b,x=0;for(;v!==null&&x<p;){const S=$e.get(v);if(S===void 0)break;const w=jt();fn(v,c),O(S)&&Oe===null&&(Oe=S.getFormat(),st=S.getStyle(),Je=S.__key),St(w),v=S.__next,x++}let _="";for(v=b,x=0;v!==null&&x<p;){const S=$e.get(v);if(S===void 0)break;let w;if(P(S)){const D=de._keyToDOMMap.get(v),M=D&&D.__lexicalTextContent;typeof M!="string"&&L(352,S.getType()),w=M}else w=S.getTextContent();_+=w,x<p-1&&P(S)&&!S.isInline()&&(_+=Wn),v=S.__next,x++}const C=d.__lexicalSlotTextLength||0,T=C>0?h.slice(C):h,k=T.slice(0,T.length-y)+_;return d.__lexicalTextContent=k,ie=l+k,void _f(i,d,g)}if((function(y,v,x,_,C,T,k,S){if(S!==1&&S!==-1||k!==(S===1?2:1))return!1;const D=k-S;let M=y.__last;for(let q=0;q<D-1;q++){if(M===null)return!1;const ne=Nt.get(M);if(ne===void 0)return!1;M=ne.__prev}if(M===null)return!1;const B=$e.get(T),V=Nt.get(M);if(B===void 0||V===void 0||B.__prev!==V.__prev)return!1;const E=[];let F=T;for(let q=0;q<k;q++){if(F===null)return!1;E.push(F);const ne=$e.get(F);F=ne?ne.__next:null}const U=[];F=M;for(let q=0;q<D;q++){if(F===null)return!1;U.push(F);const ne=Nt.get(F);F=ne?ne.__next:null}const I=new Set(U),Q=new Set(E),$=[];let K=0,H=0;for(;K<D&&H<k;)if(E[H]===U[K])$.push({key:E[H],kind:"reconcile"}),K++,H++;else if(Q.has(U[K])){if(I.has(E[H]))return!1;$.push({key:E[H],kind:"create",nextIndex:H}),H++}else $.push({key:U[K],kind:"destroy"}),K++;for(;K<D;)$.push({key:U[K++],kind:"destroy"});for(;H<k;)$.push({key:E[H],kind:"create",nextIndex:H}),H++;const me=uf(M,D);for(const q of $){const ne=jt();if(q.kind==="reconcile")fn(q.key,x.element);else if(q.kind==="destroy")Dn(q.key,x.element);else{let Ae=null;for(let _e=q.nextIndex+1;_e<k;_e++){const Kt=de._keyToDOMMap.get(E[_e]);if(Kt!==void 0){Ae=Kt;break}}Mn(q.key,x.withBefore(Ae??x.before))}if(q.kind!=="destroy"){const Ae=$e.get(q.key);Ae&&O(Ae)&&Oe===null&&(Oe=Ae.getFormat(),st=Ae.getStyle(),Je=Ae.__key)}St(ne)}let ve="";for(let q=0;q<k;q++){const ne=$e.get(E[q]);if(ne===void 0)return!1;let Ae;if(P(ne)){const _e=de._keyToDOMMap.get(E[q]),Kt=_e&&_e.__lexicalTextContent;typeof Kt!="string"&&L(350,ne.getType()),Ae=Kt}else Ae=ne.getTextContent();ve+=Ae,q<k-1&&P(ne)&&!ne.isInline()&&(ve+=Wn)}const he=_.__lexicalSlotTextLength||0,N=he>0?C.slice(he):C;return _.__lexicalTextContent=N.slice(0,N.length-me)+ve,!0})(o,0,s,d,h,b,p,f)){const y=d.__lexicalTextContent;return typeof y!="string"&&L(353),ie=l+y,void _f(i,d,g)}}}if(f===0){let b=o.__first,p=0;for(;b!==null;){const y=$e.get(b);if(y===void 0)break;const v=dn||Uo.has(b)||Vo.has(b),x=jt();if(v)fn(b,c);else{let _,C;if(P(y)){C=er.get(b);const T=C&&C.__lexicalTextContent;typeof T!="string"&&L(354,y.getType()),_=T}else _=y.getTextContent();ie+=_,C!==void 0&&ga(C)}O(y)?Oe===null&&(Oe=y.getFormat(),st=y.getStyle(),Je=y.__key):P(y)&&p<u-1&&!y.isInline()&&(ie+=Wn),St(x),b=y.__next,p++}return d.__lexicalTextContent=ie,d.__lexicalFirstTextKey=Je,void(ie=l+ie)}}if(a===1&&u===1){const h=o.__first,g=i.__first;if(h===g)fn(h,c);else{const p=Sa(h),y=Mn(g,null);try{p.parentNode===c?c.replaceChild(y,p):s.insertChild(y)}catch(v){if(typeof v=="object"&&v!=null){const x=`${v.toString()} Parent: ${c.tagName}, new child: {tag: ${y.tagName} key: ${g}}, old child: {tag: ${p.tagName}, key: ${h}}.`;throw new Error(x)}throw v}Dn(h,null)}const b=$e.get(g);O(b)&&Oe===null&&(Oe=b.getFormat(),st=b.getStyle(),Je=b.__key)}else{const h=Ns(o,Nt),g=Ns(i,$e);if(h.length!==a&&L(227),g.length!==u&&L(228),a===0)u!==0&&xa(g,i,0,u-1,s);else if(u===0){if(a!==0){const b=s.after==null&&s.before==null&&Ct(i).size===0&&s.element.__lexicalLineBreak==null;ya(h,0,a-1,b?null:c),b&&(c.textContent="")}}else(function(b,p,y,v,x,_){const C=v-1,T=x-1;let k,S,w=_.getFirstChild(),D=0,M=0;for(;D<=C&&M<=T;){const E=p[D],F=y[M],U=jt();if(E===F)w=_a(fn(F,_.element)),D++,M++;else{if(S===void 0&&(S=Cf(y,M)),k===void 0)k=Cf(p,D);else if(!k.has(E)){D++,St(U);continue}if(!S.has(E)){w=_a(Sa(E)),Dn(E,_.element),D++,k.delete(E),St(U);continue}if(k.has(F)){const Q=ro(de,F);Q!==w&&_.withBefore(w??_.before).insertChild(Q),w=_a(fn(F,_.element)),D++,M++}else Mn(F,_.withBefore(w??_.before)),M++}const I=$e.get(F);I!==null&&O(I)?Oe===null&&(Oe=I.getFormat(),st=I.getStyle(),Je=I.__key):P(I)&&M<=T&&!I.isInline()&&(ie+=Wn),St(U)}const B=D>C,V=M>T;if(B&&!V){const E=y[T+1],F=E===void 0?null:de.getElementByKey(E);xa(y,b,M,T,_.withBefore(F??_.before))}else V&&!B&&ya(p,D,C,_.element)})(i,h,g,a,u,s)}d.__lexicalTextContent=ie,d.__lexicalFirstTextKey=Je,ie=l+ie})(t,e,vt(e,n,de)),be(e)||(r=e,Oe==null||Oe===r.__textFormat||Zi||r.setTextFormat(Oe),(function(o){st==null||st===o.__textStyle||Zi||o.setTextStyle(st)})(e))}function _f(t,e,n){const r=e.__lexicalFirstTextKey;if(r!=null){const o=t.__key;let i=r;for(;i!==null;){const s=$e.get(i);if(s===void 0){i=null;break}if(s.__parent===o)break;i=s.__parent}if(i!==null&&!n.has(i)){const s=$e.get(r);if(O(s))return Oe=s.getFormat(),void(st=s.getStyle())}}e.__lexicalFirstTextKey=Je}function fn(t,e){const n=Nt.get(t);let r=$e.get(t);n!==void 0&&r!==void 0||L(61);const o=dn||Uo.has(t)||Vo.has(t),i=ro(de,t);if(n===r&&!o){let s;if(P(n)){const l=i.__lexicalTextContent;typeof l!="string"&&L(355,n.getType()),s=l,ga(i)}else s=n.getTextContent();return ie+=s,i}if(n!==r&&o&&du(Ho,zo,Yi,r,"updated"),tr.$updateDOM(r,n,i,de)){const s=Mn(t,null);return e===null&&L(62),e.replaceChild(s,i),Dn(t,null),s}if(P(n)){P(r)||L(334,t);const s=r.__indent;(dn||s!==n.__indent)&&df(i,s);const l=r.__format;(dn||l!==n.__format)&&ff(i,l);const a=o&&(Ct(r).size>0||Ct(n).size>0)?yf(n,r,i):"";if(o){const u=ie;if(D_(n,r,i),r.isInline()||(Ie(r)||xf(0,r,i),vf(r,i)),a!==""){const c=i.__lexicalTextContent||"";i.__lexicalTextContent=a+c,ie=u+a+c,i.__lexicalSlotTextLength=a.length}else(Ct(r).size>0||Ct(n).size>0)&&(i.__lexicalSlotTextLength=0)}else{const u=i.__lexicalTextContent;typeof u!="string"&&L(356,n.getType()),ie+=u,ga(i)}if((dn||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(ba(i,r),Ie(r)&&!dn))for(const u of r.getChildren())P(u)&&ba(ro(de,u.getKey()),u)}else{const s=r.getTextContent();if(oe(r)){const l=r.decorate(de,Bo);l!==null&&Sf(t,l),o&&(Ct(r).size>0||Ct(n).size>0)&&yf(n,r,i)}ie+=s}if(!Zi&&Ie(r)){const s=r.getLatest();if(s.__cachedText!==ie){const l=s.getWritable();l.__cachedText=ie,r=l}}return tr.$decorateDOM(r,n,i,de),cf(r),i}function Sf(t,e){let n=de._pendingDecorators;const r=de._decorators;if(n===null){if(r[t]===e)return;n=cg(de)}n[t]=e}function _a(t){let e=t.nextSibling;return e!==null&&e===de._blockCursorElement&&(e=e.nextSibling),e}function Cf(t,e){const n=new Set;for(let r=e;r<t.length;r++)n.add(t[r]);return n}function M_(t,e,n,r,o,i){ie="",Oe=null,st=null,Je=null,dn=r===2,de=n,Bo=n._config,tr=n._config.dom||Ts,zo=n._nodes,Yi=de._listeners.mutation,Vo=o,Uo=i,Nt=t._nodeMap,pa=t,$e=e._nodeMap,Zi=e._readOnly,er=Gd(n._keyToDOMMap),ma=(function(){const l=new Map,a=u=>{for(const c of u){const d=$e.get(c);if(d===void 0)continue;const f=d.__parent;if(f===null)continue;let h=l.get(f);h===void 0&&(h=new Set,l.set(f,h)),h.add(c)}};return a(Vo.keys()),a(Uo),l})();const s=new Map;return Ho=s,fn("root",null),de=void 0,zo=void 0,Vo=void 0,Uo=void 0,Nt=void 0,pa=void 0,$e=void 0,Bo=void 0,er=void 0,ma=void 0,Ho=void 0,tr=Ts,s}function Sa(t){const e=er.get(t);return e===void 0&&L(75,t),e}function W(t){return{type:t}}const Ca=W("SELECTION_CHANGE_COMMAND"),A_=W("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ef=W("CLICK_COMMAND"),wf=W("BEFORE_INPUT_COMMAND"),kf=W("INPUT_COMMAND"),Tf=W("COMPOSITION_START_COMMAND"),Pf=W("COMPOSITION_END_COMMAND"),rr=W("DELETE_CHARACTER_COMMAND"),zr=W("INSERT_LINE_BREAK_COMMAND"),jo=W("INSERT_PARAGRAPH_COMMAND"),Vr=W("CONTROLLED_TEXT_INSERTION_COMMAND"),Xi=W("PASTE_COMMAND"),Qi=W("REMOVE_TEXT_COMMAND"),Go=W("DELETE_WORD_COMMAND"),Ur=W("DELETE_LINE_COMMAND"),hn=W("FORMAT_TEXT_COMMAND"),L_=W("SET_TEXT_FORMAT_COMMAND"),qo=W("UNDO_COMMAND"),Hr=W("REDO_COMMAND"),$f=W("KEYDOWN_COMMAND"),Df=W("KEY_ARROW_RIGHT_COMMAND"),Ea=W("MOVE_TO_END"),Mf=W("KEY_ARROW_LEFT_COMMAND"),wa=W("MOVE_TO_START"),Af=W("KEY_ARROW_UP_COMMAND"),Lf=W("KEY_ARROW_DOWN_COMMAND"),Wi=W("KEY_ENTER_COMMAND"),If=W("KEY_SPACE_COMMAND"),ka=W("KEY_BACKSPACE_COMMAND"),Ff=W("KEY_ESCAPE_COMMAND"),Of=W("KEY_DELETE_COMMAND"),Kf=W("KEY_TAB_COMMAND"),I_=W("INSERT_TAB_COMMAND"),F_=W("INDENT_CONTENT_COMMAND"),Nf=W("OUTDENT_CONTENT_COMMAND"),Rf=W("DROP_COMMAND"),O_=W("FORMAT_ELEMENT_COMMAND"),Bf=W("DRAGSTART_COMMAND"),zf=W("DRAGOVER_COMMAND"),K_=W("DRAGEND_COMMAND"),Ji=W("COPY_COMMAND"),Ta=W("CUT_COMMAND"),Vf=W("SELECT_ALL_COMMAND"),N_=W("CLEAR_EDITOR_COMMAND"),R_=W("CLEAR_HISTORY_COMMAND"),Yo=W("CAN_REDO_COMMAND"),Zo=W("CAN_UNDO_COMMAND"),B_=W("FOCUS_COMMAND"),z_=W("BLUR_COMMAND"),V_=W("KEY_MODIFIER_COMMAND"),or={[Kd]:"metaKey",ctrlKey:!Or,metaKey:Or},Uf={[Kd]:"altKey",altKey:Or,ctrlKey:!Or},Hf=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function Pa(t,e,n){const r=t.get(e);r?r.push(n):t.set(e,[n])}let U_=class{byKey=new Map;byCode=new Map;add(e){const{key:n,modifiers:r={}}=e;n.length>0||L(399);const o=n.toLowerCase();for(const i of(function(s){let l=[0];for(const[a,u]of Hf){const c=s[a]||!1;c==="any"?l=l.concat(l.map(d=>d|u)):c&&(l=l.map(d=>d|u))}return l})(r))Pa(this.byKey,`${i}:${o}`,e),n.length===1&&(/[0-9]/.test(n)?Pa(this.byCode,`${i}:Digit${n}`,e):/[a-z]/.test(o)&&Pa(this.byCode,`${i}:Key${o.toUpperCase()}`,e));return this}matches(e){const n=e.key;if(!n)return[];const r=(function(s){let l=0;for(const[a,u]of Hf)s[a]&&(l|=u);return l})(e),o=this.byKey.get(`${r}:${n.toLowerCase()}`),i=o?o.slice():[];if(this.byCode.size>0&&!(n.length===1&&n.charCodeAt(0)<=127)){const s=this.byCode.get(`${r}:${e.code}`);s&&i.push(...s)}return i}match(e){return this.matches(e)[0]}};function H_(t){const e=new U_;for(const n of t)e.add(n);return e}function j_(t){const e=new Map;return{dispose(){for(const n of e.values())n.dispose();e.clear()},register(n,r){let o=e.get(n);o===void 0&&(o={dispose:t(n,r),holders:new Set},e.set(n,o));const i=()=>{const s=e.get(n);s&&s.holders.delete(i)&&s.holders.size===0&&(e.delete(n),s.dispose())};return o.holders.add(i),i}}}function G_(t,e,n,r){return t.addEventListener(e,n,r),t.removeEventListener.bind(t,e,n,r)}const gn=Object.freeze({}),$a=[["keydown",function(t,e){const n=e._inputState;n.lastKeyDownTimeStamp=t.timeStamp,n.lastKeyCode=t.key,t.key!=="Backspace"&&Xo(n),!e.isComposing()&&ee(e,$f,t)}],["pointerdown",function(t,e){const n=Cg(t),r=t.pointerType;so(n)&&r!=="touch"&&r!=="pen"&&t.button===0&&Et(e,()=>{Ks(n,e)||(e._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(t,e){ee(e,Tf,t)}],["compositionend",function(t,e){const n=e._inputState;an?n.compositionPhase="ending-firefox":un||!Io&&!Fo?ee(e,Pf,t):(n.compositionPhase="ending-safari",n.compositionEndData=t.data)}],["input",function(t,e){t.stopPropagation();const n=e._inputState;Xo(n),Et(e,()=>{Wf(t,e)||e.dispatchCommand(kf,t)},{event:t}),n.unprocessedBeforeInputData=null}],["click",function(t,e){Et(e,()=>{const n=z(),r=ct(gt(e)),o=Yr();if(r){if(A(n)){const i=n.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&n.isCollapsed()&&!Ie(s)&&we().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o)&&(r.removeAllRanges(),n.dirty=!0)}else if(t.pointerType==="touch"||t.pointerType==="pen"){const i=pt(r,e._rootElement).anchorNode;(fe(i)||qt(i))&&ze(hs(o,r,e,t))}}if(an&&r!==null&&r.rangeCount===0){const i=e._rootElement;if(i!==null&&t.target===i){const s=t.clientY;let l=i.childNodes.length;for(let u=0;u<i.childNodes.length;u++){const c=i.childNodes[u];if(fe(c)){const d=c.getBoundingClientRect();if(s<=(d.top+d.bottom)/2){l=u;break}}}r.setBaseAndExtent(i,l,i,l);const a=hs(o,r,e,t);a!==null?ze(a):r.removeAllRanges()}}ee(e,Ef,t)})}],["cut",gn],["copy",gn],["dragstart",gn],["dragover",gn],["dragend",gn],["paste",gn],["focus",gn],["blur",gn],["drop",gn]];Kr&&$a.push(["beforeinput",(t,e)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||an&&bg(r)||o!=="insertCompositionText"&&Et(r,()=>{Wf(n,r)||ee(r,wf,n)},{event:n})})(t,e)]);const Da=new WeakMap,es=new WeakMap,q_=j_(t=>(t.addEventListener("selectionchange",nh),()=>t.removeEventListener("selectionchange",nh)));function jf(t,e,n,r,o,i){const s=t.anchor,l=t.focus,a=s.getNode(),u=ge();let c;if(i!==void 0)c=i;else{const b=ct(gt(u));c=b!==null?pt(b,u._rootElement):null}const d=c!==null?c.anchorNode:null,f=s.key,h=u.getElementByKey(f),g=n.length;return f!==l.key||!O(a)||(!o&&(!Kr||u._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||a.isDirty()&&g<2||hg(n))&&s.offset!==l.offset&&!a.isComposing()||wt(a)||a.isDirty()&&g>1||(o||!Kr)&&h!==null&&!a.isComposing()&&d!==In(a,h,u)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!a.isComposing()&&(a.getFormat()!==t.format||a.getStyle()!==t.style)||(function(b,p){if(p.isSegmented())return!0;if(!b.isCollapsed())return!1;const y=b.anchor.offset,v=p.getParentOrThrow(),x=Ps(p);return y===0?!p.canInsertTextBefore()||!v.canInsertTextBefore()&&!p.isComposing()||x||(function(_){const C=_.getPreviousSibling();return(O(C)||P(C)&&C.isInline())&&!C.canInsertTextAfter()})(p):y===p.getTextContentSize()&&(!p.canInsertTextAfter()||!v.canInsertTextAfter()&&!p.isComposing()||x)})(t,a)}function Gf(t,e){return qt(t)&&t.nodeValue!==null&&e!==0&&e!==t.nodeValue.length}function qf(t,e,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=pt(t,e._rootElement),l=e._inputState;if(l.isSelectionChangeFromDOMUpdate){l.isSelectionChangeFromDOMUpdate=!1;const a=l.selectionChangeFromDOMUpdatePoints;if(l.selectionChangeFromDOMUpdatePoints=null,Gf(r,o)&&Gf(i,s)&&!l.postDeleteSelectionToRestore&&(a===null||a.anchorNode===r&&a.anchorOffset===o&&a.focusNode===i&&a.focusOffset===s))return}Et(e,()=>{if(!n)return void ze(null);if(!si(e,r,i))return;let a=z();if(l.postDeleteSelectionToRestore&&A(a)&&a.isCollapsed()){const u=a.anchor,c=l.postDeleteSelectionToRestore.anchor;(u.key===c.key&&u.offset===c.offset+1||u.offset===1&&c.getNode().is(u.getNode().getPreviousSibling()))&&(a=l.postDeleteSelectionToRestore.clone(),ze(a))}if(l.postDeleteSelectionToRestore=null,A(a)){const u=a.anchor,c=u.getNode();if(a.isCollapsed()){t.type==="Range"&&r===i&&(a.dirty=!0);const d=gt(e).event,f=d?d.timeStamp:performance.now(),{format:h,style:g,offset:b,key:p,timeStamp:y}=l.collapsedSelectionFormat,v=we(),x=e.isComposing()===!1&&v.getTextContent()==="";if(f<y+200&&u.offset===b&&u.key===p)ts(a,h,g);else if(u.type==="text")O(c)||L(141),Yf(a,c);else if(u.type==="element"&&!x){P(c)||L(259);const _=u.getNode();_.isEmpty()?(function(C,T){const k=T.getTextFormat(),S=T.getTextStyle();ts(C,k,S)})(a,_):ts(a,a.format,"")}}else{const d=u.key,f=a.focus.key,h=a.getNodes(),g=h.length,b=a.isBackward(),p=b?s:o,y=b?o:s,v=b?f:d,x=b?d:f;let _=2047,C=!1;for(let T=0;T<g;T++){const k=h[T],S=k.getTextContentSize();if(O(k)&&S!==0&&!(T===0&&k.__key===v&&p===S||T===g-1&&k.__key===x&&y===0)&&(C=!0,_&=k.getFormat(),_===0))break}a.format=C?_:0}}ee(e,Ca)})}function ts(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function Yf(t,e){ts(t,e.getFormat(),e.getStyle())}function Zf(t){if(!t.getTargetRanges)return null;const e=t.getTargetRanges();return e.length===0?null:e[0]}function Xf(t){const{lastKeyCode:e}=ge()._inputState;if(t==null||t.length<=1||e==null)return;const n=e.length===1?e:e==="Enter"?`
4
+ `:e==="Tab"?" ":null;if(!n)return;const r=z();if(!A(r)||!r.isCollapsed())return;const o=r.anchor.getNode();if(!O(o))return;const{offset:i}=r.anchor;if(o.getTextContentSize()===i){const s=o.getNextSibling();if(n===`
5
+ `){if(un)return;if(Ze(s))s.selectEnd();else if(!s){const l=ke(o,fs),a=l&&l.getNextSibling();P(a)&&a.selectStart()}}else n===" "?ir(s)&&s.selectEnd():O(s)&&s.getTextContent()[0]===n&&s.select(1,1)}else o.getTextContent()[i]===n&&o.select(i+1,i+1)}function Xo(t){t.isInsertTextAfterHandledSelectionCommand=!1,t.handledSelectionCommandTimeoutId!==null&&(clearTimeout(t.handledSelectionCommandTimeoutId),t.handledSelectionCommandTimeoutId=null)}function Qf(t){Xo(t),t.isInsertTextAfterHandledSelectionCommand=!0,t.handledSelectionCommandTimeoutId=setTimeout(()=>Xo(t),0)}function Wf(t,e){const n=Cg(t);if(fe(n)&&Ks(n,e))return!0;const r=e.getRootElement();if(r===null)return!1;const o=io(r.ownerDocument);return o!==null&&r.contains(o)&&Ks(o,e)}function Y_(t){const e=t.inputType,n=Zf(t),r=ge(),o=r._inputState,i=z();if(e==="insertText"&&t.data&&o.isInsertTextAfterHandledSelectionCommand){if(Xo(o),t.preventDefault(),A(i)&&!i.isCollapsed()){const d=i.isBackward()?i.anchor:i.focus;i.anchor.set(d.key,d.offset,d.type),i.focus.set(d.key,d.offset,d.type)}return!0}if(e==="deleteContentBackward"){if(i===null){const d=Yr();if(!A(d))return!0;ze(d.clone())}if(A(i)){const d=i.anchor.key===i.focus.key;if((function(f,h){return f.lastKeyCode==="MediaLast"&&h<f.lastKeyDownTimeStamp+30})(o,t.timeStamp)&&r.isComposing()&&d){if(Xe(null),o.lastKeyDownTimeStamp=0,setTimeout(()=>{Et(r,()=>{Xe(null)})},30),A(i)){const f=i.anchor.getNode();f.markDirty(),O(f)||L(142),Yf(i,f)}}else{if(Xe(null),un&&n!==null&&!n.collapsed&&(i.applyDOMRange(n),!i.isCollapsed()))return t.preventDefault(),i.removeText(),!0;t.preventDefault();const f=i.anchor.getNode(),h=f.getTextContent(),g=f.canInsertTextAfter(),b=i.anchor.offset===0&&i.focus.offset===h.length;let p=Hi&&d&&!b&&g;if(p&&i.isCollapsed()&&(p=!oe(KS(i.anchor,!0))),!p){ee(r,rr,!0);const y=z();Hi&&A(y)&&y.isCollapsed()&&(o.postDeleteSelectionToRestore=y,setTimeout(()=>o.postDeleteSelectionToRestore=null))}}return!0}}if(!A(i))return e!=="historyUndo"&&e!=="historyRedo"||(t.preventDefault(),ee(r,e==="historyUndo"?qo:Hr)),!0;const s=t.data;o.unprocessedBeforeInputData!==null&&au(!1,r,o.unprocessedBeforeInputData),i.dirty&&o.unprocessedBeforeInputData===null||!i.isCollapsed()||Ie(i.anchor.getNode())||n===null||i.applyDOMRange(n),o.unprocessedBeforeInputData=null;const l=i.anchor,a=i.focus,u=l.getNode(),c=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(s===`
6
+ `)t.preventDefault(),ee(r,zr,!1);else if(s===Wn)t.preventDefault(),ee(r,jo);else if(s==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),i.insertRawText(d)}else s!=null&&jf(i,n,s,t.timeStamp,!0)?(t.preventDefault(),ee(r,Vr,s),Xf(s)):o.unprocessedBeforeInputData=s;return o.lastBeforeInputInsertTextTimeStamp=t.timeStamp,!0}switch(t.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ee(r,Vr,t),Xf((t.dataTransfer?t.dataTransfer.getData("text/plain"):null)??t.data);break;case"insertFromComposition":{const d=o.hadOrphanedCompositionEvents;o.hadOrphanedCompositionEvents=!1;const f=r._compositionKey;Xe(null),d||ee(r,Vr,t),ns(f);break}case"insertLineBreak":Xe(null),ee(r,zr,!1);break;case"insertParagraph":Xe(null),o.isInsertLineBreak&&!un?(o.isInsertLineBreak=!1,ee(r,zr,!1)):ee(r,jo);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ee(r,Xi,t);break;case"deleteByComposition":(function(d,f){return d!==f||P(d)||P(f)||!Ps(d)||!Ps(f)})(u,c)&&ee(r,Qi,t);break;case"deleteByDrag":pr(La),ee(r,Qi,t);break;case"deleteByCut":ee(r,Qi,t);break;case"deleteContent":ee(r,rr,!1);break;case"deleteWordBackward":ee(r,Go,!0);break;case"deleteWordForward":ee(r,Go,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ee(r,Ur,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ee(r,Ur,!1);break;case"formatStrikeThrough":ee(r,hn,"strikethrough");break;case"formatBold":ee(r,hn,"bold");break;case"formatItalic":ee(r,hn,"italic");break;case"formatUnderline":ee(r,hn,"underline");break;case"historyUndo":ee(r,qo);break;case"historyRedo":ee(r,Hr)}return!0}function Z_(t){const e=ge(),n=e._inputState,r=z(),o=t.data,i=Zf(t);let s=!1;if(o!=null&&A(r)){const l=ct(gt(e)),a=l!==null?pt(l,e._rootElement):null,u=t.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&!e.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);const c=r.anchor.getNode(),d=t.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&e.isComposing()&&O(c)&&wt(c);if(!u&&!d&&jf(r,i,o,t.timeStamp,!1,a)){if(s=!0,n.compositionPhase==="ending-firefox"){const y=rs(e,o);if(n.compositionPhase="idle",y)return pr(Wo),fg(),!0}const f=r.anchor.getNode();if(l===null||a===null)return!0;const h=r.isBackward(),g=h?r.anchor.offset:r.focus.offset,b=h?r.focus.offset:r.anchor.offset;Kr&&!r.isCollapsed()&&O(f)&&a.anchorNode!==null&&f.getTextContent().slice(0,g)+o+f.getTextContent().slice(g+b)===pg(a.anchorNode)||ee(e,Vr,o);const p=o.length;an&&p>1&&t.inputType==="insertCompositionText"&&!e.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),Hi&&e.isComposing()&&(n.lastKeyDownTimeStamp=0,Xe(null))}}return s||(au(!1,e,o!==null?o:void 0),n.compositionPhase==="ending-firefox"&&(rs(e,o||void 0),pr(Wo),n.compositionPhase="idle")),fg(),!0}function X_(t){const e=ge(),n=e._inputState,r=z();if(A(r)&&!e.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;const o=r.anchor,i=r.anchor.getNode();if(Xe(o.key),pr(dh),t.timeStamp<n.lastKeyDownTimeStamp+30||o.type==="element"||!r.isCollapsed()||!Hi&&(i.getFormat()!==r.format||O(i)&&i.getStyle()!==r.style)||O(i)&&(wt(i)||o.offset===0&&!i.canInsertTextBefore()||o.offset===i.getTextContentSize()&&!i.canInsertTextAfter())){ee(e,Vr,la);const s=z();A(s)&&Xe(s.anchor.key)}}return!0}function Q_(t){const e=ge();return e._inputState.compositionPhase="idle",rs(e,t.data),pr(Wo),!0}function ns(t){if(t===null)return;const e=Te(t);if(!O(e)||e.getType()==="text"||wt(e)||!e.isAttached())return;const n=z(),r=A(n)&&n.anchor.key===t?n.anchor.offset:null,o=He(e.getTextContent());if(o.setFormat(e.getFormat()),o.setStyle(e.getStyle()),e.replace(o),r!==null){const i=Math.min(r,o.getTextContentSize());o.select(i,i)}}function rs(t,e){const n=t._compositionKey;if(Xe(null),n!==null&&e!=null){if(e===""){const o=Te(n),i=t.getElementByKey(n),s=i!==null&&O(o)?In(o,i,t):null;if(s!==null&&s.nodeValue!==null&&O(o)){const l=ct(gt(t)),a=l&&pt(l,t._rootElement);let u=null,c=null;a!==null&&a.anchorNode===s&&(u=a.anchorOffset,c=a.focusOffset),uu(o,s.nodeValue,u,c,!0)}return ns(n),!1}if(e[e.length-1]===`
7
+ `){const o=z();if(A(o)||De(o)){if(A(o)){const i=o.focus;o.anchor.set(i.key,i.offset,i.type)}return ee(t,Wi,null),ns(n),!1}}const r=Te(n);if(r!==null&&O(r)&&wt(r)){r.markDirty();const o=z(),i=r.getTextContentSize(),s=A(o)&&o.anchor.key===n?o.anchor.offset:i;return r.select(s,s).insertText(e),!0}}return au(!0,t,e),ns(n),!1}const os={altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:"any"},Qo={ctrlKey:!0},Jf={metaKey:!0},pn={shiftKey:"any"},eh={...pn,altKey:"any"};function W_(t){const e=ge(),n=e._inputState;if(t.key==null)return!0;if(n.compositionPhase==="ending-safari"){const i=(function(s){return s.key==="Backspace"})(t);if(i&&Et(e,()=>{rs(e,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",i)return!0}let r=e._keyDownShortcuts;r===null&&(r=H_((function(){const i=(u,c,d)=>({key:u,modifiers:c,onMatch:(f,h)=>{ee(h,d,f)}}),s=(u,c,d,f)=>({key:u,modifiers:c,onMatch:(h,g)=>{h.preventDefault(),ee(g,d,f)}}),l=(u,c)=>({key:"Enter",modifiers:u,onMatch:(d,f)=>{f._inputState.isInsertLineBreak=c,ee(f,Wi,d)}}),a=(u,c)=>({key:u,modifiers:or,onMatch:(d,f)=>{const h=f._editorState._selection;h===null||A(h)||(d.preventDefault(),ee(f,c,d))}});return[i("ArrowRight",pn,Df),i("ArrowLeft",pn,Mf),i("ArrowUp",eh,Af),i("ArrowDown",eh,Lf),l({...os,shiftKey:!0},!0),l({...os,shiftKey:!1},!1),i(" ",os,If),{key:"Backspace",modifiers:pn,onMatch:(u,c)=>{ee(c,ka,u)&&Qf(c._inputState)}},i("Escape",os,Ff),i("Delete",{},Of),s("Backspace",Uf,Go,!0),s("Delete",Uf,Go,!1),s("b",or,hn,"bold"),s("u",or,hn,"underline"),s("i",or,hn,"italic"),i("Tab",pn,Kf),s("z",or,qo,void 0),s("z",{...or,shiftKey:!0},Hr,void 0),...Or?[{key:"o",modifiers:Qo,onMatch:(u,c)=>{u.preventDefault(),c._inputState.isInsertLineBreak=!0,ee(c,zr,!0)}},i("ArrowLeft",{metaKey:!0,...pn},wa),i("ArrowRight",{metaKey:!0,...pn},Ea),s("h",Qo,rr,!0),s("d",Qo,rr,!1),s("Backspace",Jf,Ur,!0),s("Delete",Jf,Ur,!1),s("k",Qo,Ur,!1)]:[i("Home",pn,wa),i("End",pn,Ea),s("y",Qo,Hr,void 0)],{key:"a",modifiers:or,onMatch:(u,c)=>{u.preventDefault(),ee(c,Vf,u)&&Qf(c._inputState)}},a("c",Ji),a("x",Ta)]})()),e._keyDownShortcuts=r);const o=r.match(t);return o&&o.onMatch(t,e),(function(i){return i.ctrlKey||i.shiftKey||i.altKey||i.metaKey})(t)&&e.dispatchCommand(V_,t),!0}function th(t){let e=t.__lexicalEventHandles;return e===void 0&&(e=[],t.__lexicalEventHandles=e),e}const jr=new Map;function nh(t){const e=zS(t.target);if(e===null)return;const n=fu(t.target);let r=null,o=null;const i=n!==null?es.get(n):void 0;if(n!==null){if(i!==void 0){const d=i.editors;let f=i.hasShadowEditor;if(f===void 0){f=!1;for(const h of d)if(h._rootElement!==null&&_n(h._rootElement.getRootNode())){f=!0;break}i.hasShadowEditor=f}if(f){let h=null,g=null;for(const b of d){const p=b._rootElement;if(p===null)continue;const y=pt(e,p).anchorNode;if(y!==null&&Wr(y)===b){if(_n(p.getRootNode())){r=b,o=y;break}h===null&&(h=b,g=y)}}r===null&&h!==null&&(r=h,o=g)}else{const h=e.anchorNode;h===null||fe(h)&&h.shadowRoot!==null||(r=Wr(h),r!==null&&(o=h))}}if(r===null){const d=io(n);r=d!==null?Wr(d):null}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(i!==void 0)for(const d of i.editors)d._inputState.isSelectionChangeFromMouseDown=!1;Et(r,()=>{const d=Yr(),f=o??pt(e,r._rootElement).anchorNode;(fe(f)||qt(f))&&ze(hs(d,e,r,t))})}const s=lu(r),l=s[s.length-1],a=l._key,u=jr.get(a),c=u||l;c!==r&&qf(e,c,!1),qf(e,r,!0),r!==l?jr.set(a,r):u&&jr.delete(a)}function rh(t){t._lexicalHandled=!0}function oh(t){return t._lexicalHandled===!0}function J_(t){const e=Da.get(t);if(e===void 0)return;const n=es.get(e);if(n===void 0)return;Da.delete(t);const r=Jr(t);li(r)?((function(i){if(i._parentEditor!==null){const s=lu(i),l=s[s.length-1]._key;jr.get(l)===i&&jr.delete(l)}else jr.delete(i._key)})(r),n.editors.delete(r),n.hasShadowEditor=void 0,t.__lexicalEditor=null):r&&L(198);const o=th(t);for(let i=0;i<o.length;i++)o[i]();t.__lexicalEventHandles=[]}function Ma(t,e,n){je();const r=t.__key,o=t.getParent();if(o===null)return void(tt(t)!==null&&L(367,r,String(tt(t))));const i=(function(l){const a=z();if(!A(a)||!P(l))return a;const{anchor:u,focus:c}=a,d=u.getNode(),f=c.getNode();return oo(d,l)&&u.set(l.__key,0,"element"),oo(f,l)&&c.set(l.__key,0,"element"),a})(t);let s=!1;if(A(i)&&e){const l=i.anchor,a=i.focus;l.key===r&&(gs(l,t,o,t.getPreviousSibling(),t.getNextSibling()),s=!0),a.key===r&&(gs(a,t,o,t.getPreviousSibling(),t.getNextSibling()),s=!0)}else De(i)&&e&&t.isSelected()&&t.selectPrevious();if(A(i)&&e&&!s&&lr(i,o)){const l=t.getIndexWithinParent();xn(t),ar(i,o,l,-1)}else xn(t);n||be(o)||o.canBeEmpty()||!o.isEmpty()||Ma(o,e),e&&i&&Ie(o)&&o.isEmpty()&&o.selectEnd()}function d3(t){return t}const ih=Symbol.for("ephemeral");function is(t){return t[ih]||!1}const sh={configurable:!0,enumerable:!1,value:void 0,writable:!0};class ft{__type;__key;__parent;__prev;__next;__state;[Ro];static getType(){const{ownNodeType:e}=bu(this);return e===void 0&&L(64,this.name),e}static clone(e){L(65,this.name)}$config(){return{}}config(e,n){const r=n.extends||Mg(this.constructor);return Object.assign(n,{extends:r}),typeof e=="string"&&Object.assign(n,{type:e}),{[e]:n}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",sh),Object.defineProperty(this,Ro,sh),lg(this,e)}getType(){return this.__type}isInline(){L(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const n=Te(e);if(n===null)break;e=n.__parent!==null?n.__parent:tt(n)}return!1}isSelected(e){const n=e||z();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(O(this))return r;if(A(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(oe(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let n=e.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Te(e)}getParentOrThrow(){const e=this.getParent();return e===null&&L(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const n=e.getParent();if(be(n)||tt(e)!==null)return P(e)||e===this&&oe(e)||L(194),e;e=n}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&L(67,this.__key),e}getParents(){const e=[];let n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){const e=[];let n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Te(e)}getPreviousSiblings(){const e=[],n=this.getParent();if(n===null)return e;let r=n.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:Te(e)}getNextSiblings(){const e=[];let n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){const n=P(this)?this:this.getParent(),r=P(e)?e:e.getParent(),o=n&&r?wu(n,r):null;return o?o.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const n=wu(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?zg(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&L(279),!1)))}isParentOf(e){return oo(e,this)}getNodesBetween(e){const n=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=P(i)?n?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}const a=n?i.getNextSibling():i.getPreviousSibling();if(a!==null){i=a;continue}const u=i.getParentOrThrow();if(o.has(u.__key)||r.push(u),u===e)break;let c=null,d=u;do{if(d===null&&L(68),c=n?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;c!==null||o.has(d.__key)||r.push(d)}while(c===null);i=c}return n||r.reverse(),r}isDirty(){const e=ge()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(is(this))return this;const e=Te(this.__key);return e===null&&L(113),e}getWritable(){if(is(this))return this;je();const e=Rt(),n=ge(),r=e._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,l=z();if(l!==null&&l.setCachedNodes(null),s.has(o))return $s(i),i;const a=Tg(i);return s.add(o),$s(a),r.set(o,a),a}getTextContent(){return Kg(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){L(70)}updateDOM(e,n,r){L(71)}getDOMSlot(e){return new Bd(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){L(18,this.name)}updateFromJSON(e){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const l of Jd(o).flatKeys)l in r&&(s!==void 0&&s!==i||(s={...i}),s[l]=r[l]);return(o.__state||s)&&Wd(n).updateFromJSON(s),o})(this,e)}static transform(){return null}remove(e){Ma(this,!0,e)}replace(e,n){je();let r=z();r!==null&&(r=r.clone()),gu(this,e);const o=this.getLatest(),i=this.__key,s=nt(o);s!==null&&L(400,i,o.getType(),s.getKey(),s.getType());const l=e.__key,a=e.getWritable(),u=this.getParentOrThrow().getWritable(),c=u.__size,d=a.getParent(),f=d!==null&&A(r)&&lr(r,d),h=f?a.getIndexWithinParent():-1;xn(a),f&&d!==null&&A(r)&&ar(r,d,h,-1);const g=o.getPreviousSibling(),b=o.getNextSibling(),p=o.__prev,y=o.__next,v=o.__parent;Ma(o,!1,!0),g===null?u.__first=l:g.getWritable().__next=l,a.__prev=p,b===null?u.__last=l:b.getWritable().__prev=l,a.__next=y,a.__parent=v,u.__size=d!==null&&d.is(u)?c-1:c;let x=0;if(n&&(P(this)&&P(a)||L(139),x=a.getChildrenSize(),a.splice(x,0,this.getChildren())),A(r)){ze(r);const _=r.anchor,C=r.focus;_.key===i&&(n&&_.type==="element"?_.set(a.__key,x+_.offset,"element"):yh(_,a)),C.key===i&&(n&&C.type==="element"?C.set(a.__key,x+C.offset,"element"):yh(C,a))}return Yt()===i&&Xe(l),a}insertAfter(e,n=!0){je(),gu(this,e);const r=this.getWritable(),o=e.getWritable();this.getParentOrThrow();const i=o.getParent(),s=z();let l=!1,a=!1,u=-1;if(i!==null&&n&&A(s)&&lr(s,i)){const g=i.__key,b=s.anchor,p=s.focus;u=e.getIndexWithinParent(),l=b.type==="element"&&b.key===g&&b.offset===u+1,a=p.type==="element"&&p.key===g&&p.offset===u+1}xn(o),u!==-1&&i!==null&&A(s)&&ar(s,i,u,-1);const c=this.getNextSibling(),d=this.getParentOrThrow().getWritable(),f=o.__key,h=r.__next;if(c===null?d.__last=f:c.getWritable().__prev=f,d.__size++,r.__next=f,o.__next=h,o.__prev=r.__key,o.__parent=r.__parent,n&&A(s)){const g=d.__key;if(l||a||lr(s,d)){const b=this.getIndexWithinParent();ar(s,d,b+1),l&&s.anchor.set(g,b+2,"element"),a&&s.focus.set(g,b+2,"element")}}return e}insertBefore(e,n=!0){je(),gu(this,e);const r=this.getWritable(),o=e.getWritable();this.getParentOrThrow();const i=o.__key,s=z(),l=o.getParent(),a=l!==null&&n&&A(s)&&lr(s,l),u=a?o.getIndexWithinParent():-1;xn(o),a&&l!==null&&A(s)&&ar(s,l,u,-1);const c=this.getPreviousSibling(),d=this.getParentOrThrow().getWritable(),f=r.__prev,h=n&&A(s)&&lr(s,d),g=h?this.getIndexWithinParent():-1;return c===null?d.__first=i:c.getWritable().__next=i,d.__size++,r.__prev=i,o.__prev=f,o.__next=r.__key,o.__parent=r.__parent,h&&A(s)&&ar(s,d,g),e}isParentRequired(){return!1}createParentElementNode(){return Se()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){je();const r=nt(this);if(r!==null)return r.selectPrevious(e,n);const o=this.getPreviousSibling(),i=this.getParentOrThrow();if(o===null)return i.select(0,0);if(P(o))return o.select();if(!O(o)){const s=o.getIndexWithinParent()+1;return i.select(s,s)}return o.select(e,n)}selectNext(e,n){je();const r=nt(this);if(r!==null)return r.selectNext(e,n);const o=this.getNextSibling(),i=this.getParentOrThrow();if(o===null)return i.select();if(P(o))return o.select(0,0);if(!O(o)){const s=o.getIndexWithinParent();return i.select(s,s)}return o.select(e,n)}markDirty(){this.getWritable()}reconcileObservedMutation(e,n){this.markDirty()}}function lh(t){return t instanceof ft}const ss="historic",ah="history-push",Gr="history-merge",uh="paste",Aa="cut",ch="collaboration",eS="skip-scroll-into-view",tS="skip-dom-selection",La="skip-selection-focus",dh="composition-start",Wo="composition-end",nS="!important";function ls(t){const e={};if(!t)return e;let n="",r="",o=null,i=!1,s=!1,l=!1,a=0;const u=t.length;let c=-1;for(let h=0;h<u;h++){const g=t[h];if(i)g==="*"&&t[h+1]==="/"&&(i=!1,h++);else if(s)c===-1&&(c=h),s=!1;else if(o===null)if(g!=="/"||t[h+1]!=="*")if(g!=='"'&&g!=="'")if(g!=="(")if(g!==")")if(l||g!==":"||a!==0){if(g===";"&&a===0){c!==-1&&(l?r+=t.slice(c,h):n+=t.slice(c,h),c=-1);const b=n.trim(),p=r.trim();b!==""&&p!==""&&(e[b]=p),n="",r="",l=!1;continue}c===-1&&(c=h)}else c!==-1&&(n+=t.slice(c,h),c=-1),l=!0;else c===-1&&(c=h),a=Math.max(0,a-1);else c===-1&&(c=h),a++;else c===-1&&(c=h),o=g;else c!==-1&&(l?r+=t.slice(c,h):n+=t.slice(c,h),c=-1),i=!0,h++;else c===-1&&(c=h),g==="\\"?s=!0:g===o&&(o=null)}c!==-1&&(l?r+=t.slice(c,u):n+=t.slice(c,u));const d=n.trim(),f=r.trim();return d!==""&&f!==""&&(e[d]=f),e}function rS(t,e,n){const r=n.trimEnd(),o=r.length-10;o>=0&&r.slice(o).toLowerCase()===nS?t.setProperty(e,r.slice(0,o).trim(),"important"):t.setProperty(e,n,"")}function qr(t,e,n=""){if(e===n)return;const r=ls(n),o=ls(e);for(const i in o)delete r[i],rS(t,i,o[i]);for(const i in r)t.removeProperty(i)}function Ia(t,e){return 16&e?"code":e&Od?"mark":32&e?"sub":64&e?"sup":null}function Fa(t,e){return 1&e?"strong":2&e?"em":"span"}function fh(t,e,n,r,o){const i=r.classList;let s=no(o,"base");s!==void 0&&i.add(...s),s=no(o,"underlineStrikethrough");let l=!1;const a=8&e&&4&e;s!==void 0&&(8&n&&4&n?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(const u in cn){const c=cn[u];if(s=no(o,u),s!==void 0)if(n&c){if(l&&(u==="underline"||u==="strikethrough")){e&c&&i.remove(...s);continue}((e&c)===0||a&&u==="underline"||u==="strikethrough")&&i.add(...s)}else e&c&&i.remove(...s)}ai(r,"class")}function hh(t,e,n){const r=n.isComposing(),o=t+(r?Oo:""),i=Ke(),s=Fs(i).$getDOMSlot(n,e,i),l=s.getFirstChild();if(l===null||l.nodeType!==Node.TEXT_NODE)return void s.insertChild(Ce().createTextNode(o));const a=l,u=a.nodeValue;if(u!==o)if(r||an){const[c,d,f]=(function(h,g){const b=h.length,p=g.length;let y=0,v=0;for(;y<b&&y<p&&h[y]===g[y];)y++;for(;v+y<b&&v+y<p&&h[b-v-1]===g[p-v-1];)v++;return[y,b-y-v,g.slice(y,p-v)]})(u,o);d!==0&&a.deleteData(c,d),a.insertData(c,f)}else a.nodeValue=o}function gh(t,e,n,r,o,i){hh(o,t,e);const s=i.theme.text;s!==void 0&&fh(0,0,r,t,s)}function as(t,e){const n=Ce().createElement(e);return n.appendChild(t),n}function Oa(t){return t!=null&&t.__isInlineFormattable===!0}class mn extends ft{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:lS,priority:0}),b:()=>({conversion:iS,priority:0}),code:()=>({conversion:yn,priority:0}),em:()=>({conversion:yn,priority:0}),i:()=>({conversion:yn,priority:0}),mark:()=>({conversion:yn,priority:0}),s:()=>({conversion:yn,priority:0}),span:()=>({conversion:oS,priority:0}),strong:()=>({conversion:yn,priority:0}),sub:()=>({conversion:yn,priority:0}),sup:()=>({conversion:yn,priority:0}),u:()=>({conversion:yn,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",n){super(n),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 b_[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Yt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const n=cn[e];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){return fr(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){const r=this.__format,o=Ia(0,r),i=Fa(0,r),s=o===null?i:o,l=Ce().createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(a=Ce().createElement(i),l.appendChild(a)),gh(a,this,0,r,this.__text,e);const u=this.__style;return u!==""&&qr(l.style,u),l}updateDOM(e,n,r){const o=this.__text,i=e.__format,s=this.__format,l=Ia(0,i),a=Ia(0,s),u=Fa(0,i),c=Fa(0,s);if((l===null?u:l)!==(a===null?c:a))return!0;if(l===a&&u!==c){const b=n.firstChild;b==null&&L(48);const p=Ce().createElement(c);return gh(p,this,0,s,o,r),n.replaceChild(p,b),!1}let d=n;a!==null&&l!==null&&(d=n.firstChild,d==null&&L(49)),hh(o,d,this);const f=r.theme.text;f!==void 0&&i!==s&&fh(0,i,s,d,f);const h=e.__style,g=this.__style;return h!==g&&(qr(n.style,g,h),ai(n,"style")),!1}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:n}=super.exportDOM(e);return fe(n)||L(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=as(n,"b")),this.hasFormat("italic")&&(n=as(n,"i")),this.hasFormat("strikethrough")&&(n=as(n,"s")),this.hasFormat("underline")&&(n=as(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,n){}setFormat(e){const n=this.getWritable();return n.__format=typeof e=="string"?cn[e]:e,n}setDetail(e){const n=this.getWritable();return n.__detail=typeof e=="string"?p_[e]:e,n}setStyle(e){const n=this.getWritable();return n.__style=e,n}toggleFormat(e){const n=fr(this.getFormat(),e,null);return this.setFormat(n)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const n=y_[e];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;const n=this.getWritable();return n.__text=e,n}select(e,n){je();let r=e,o=n;const i=z(),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(!A(i))return Ih(l,r,l,o,"text","text");{const a=Yt();a!==i.anchor.key&&a!==i.focus.key||Xe(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,n,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 u=z();if(o&&A(u)){const d=e+l;u.setTextNodeRange(i,d,i,d)}const c=s.slice(0,a)+r+s.slice(a+n);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){je();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=Yt(),s=r.length;e.sort((S,w)=>S-w),e.push(s);const l=[],a=e.length;for(let S=0,w=0;S<s&&w<=a;w++){const D=e[w];D>S&&(l.push(r.slice(S,D)),S=D)}const u=l.length;if(u===1)return[n];const c=l[0],d=n.getParent();let f;const h=n.getFormat(),g=n.getStyle(),b=n.__detail;let p=!1,y=null,v=null;const x=z();if(A(x)){const[S,w]=x.isBackward()?[x.focus,x.anchor]:[x.anchor,x.focus];S.type==="text"&&S.key===o&&(y=S),w.type==="text"&&w.key===o&&(v=w)}n.isSegmented()?(f=He(c),f.__format=h,f.__style=g,f.__detail=b,f.__state=rf(n,f),p=!0):f=n.setTextContent(c);const _=[f];for(let S=1;S<u;S++){const w=He(l[S]);w.__format=h,w.__style=g,w.__detail=b,w.__state=rf(n,w);const D=w.__key;i===o&&Xe(D),_.push(w)}const C=y?y.offset:null,T=v?v.offset:null;let k=0;for(const S of _){if(!y&&!v)break;const w=k+S.getTextContentSize();if(y!==null&&C!==null&&C<=w&&C>=k&&(y.set(S.getKey(),C-k,"text"),C<w&&(y=null)),v!==null&&T!==null&&T<=w&&T>=k){v.set(S.getKey(),T-k,"text");break}k=w}if(d!==null){(function(D){const M=D.getPreviousSibling(),B=D.getNextSibling();M!==null&&$s(M),B!==null&&$s(B)})(this);const S=d.getWritable(),w=this.getIndexWithinParent();p?(S.splice(w,0,_),this.remove()):S.splice(w,1,_),A(x)&&ar(x,d,w,u-1)}return _}mergeWithSibling(e){const n=e===this.getPreviousSibling();n||e===this.getNextSibling()||L(50);const r=this.__key,o=e.__key,i=this.__text,s=i.length;Yt()===o&&Xe(r);const l=z();if(A(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===o&&Oh(d,n,r,e,s),f!==null&&f.key===o&&Oh(f,n,r,e,s)}const a=e.__text,u=n?a+i:i+a;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function oS(t){return{forChild:Ka(t.style),node:null}}function iS(t){const e=t,n=e.style.fontWeight==="normal";return{forChild:Ka(e.style,n?void 0:"bold"),node:null}}const ph=new WeakMap;function sS(t){if(!fe(t))return!1;if(t.nodeName==="PRE")return!0;const e=t.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function lS(t){const e=t;t.parentElement===null&&L(129);let n=e.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=ph.get(i))===void 0&&!sS(i);)s.push(i),i=i.parentNode;const l=o===void 0?i:o;for(let a=0;a<s.length;a++)ph.set(s[a],l);return l})(e)!==null)return{node:Rh(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=e,o=!0;for(;r!==null&&(r=mh(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=e,o=!0;for(;r!==null&&(r=mh(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:He(n)}}function mh(t,e){let n=t;for(;;){let r;for(;(r=e?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,fe(n)){const i=n.style.display;if(i===""&&!mu(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=e?n.firstChild:n.lastChild)!==null;)n=o;if(qt(n))return n;if(n.nodeName==="BR")return null}}const aS={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function yn(t){const e=aS[t.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Ka(t.style,e),node:null}}function He(t=""){return Bt(new mn(t))}function O(t){return t instanceof mn}function Ka(t,e){const n=t.fontWeight,r=t.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=t.fontStyle==="italic",l=r.includes("underline"),a=t.verticalAlign,u=t.textTransform;return c=>((O(c)||Oa(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"),u!=="lowercase"&&u!=="uppercase"&&u!=="capitalize"||c.hasFormat(u)||c.toggleFormat(u),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class us extends mn{$config(){return this.config("tab",{extends:mn})}constructor(e=void 0){super(" ",e),this.__detail=2}createDOM(e){const n=super.createDOM(e),r=no(e.theme,"tab");return r!==void 0&&n.classList.add(...r),n}setTextContent(e){return super.setTextContent(" ")}spliceText(e,n,r,o){return r===""&&n===0||r===" "&&n===1||L(286),this}setDetail(e){return e!==2&&L(127),this}setMode(e){return e!=="normal"&&L(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Jo(){return Bt(new us)}function ir(t){return t instanceof us}class uS{key;offset;type;_selection;constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:On(et(ut(this,"next")),et(ut(e,"next")))<0}getNode(){const e=Te(this.key);return e===null&&L(20),e}set(e,n,r,o){const i=this._selection,s=this.key;o&&this.key===e&&this.offset===n&&this.type===r||(this.key=e,this.offset=n,this.type=r,ur()||(Yt()===s&&Xe(e),i!==null&&(i.setCachedNodes(null),A(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function Gt(t,e,n){return new uS(t,e,n)}function Na(t,e){let n=e.__key,r=t.offset,o="element";if(O(e)){o="text";const i=e.getTextContentSize();r>i&&(r=i)}else if(!P(e)){const i=e.getNextSibling();if(O(i))n=i.__key,r=0,o="text";else{const s=e.getParent();s&&(n=s.__key,r=e.getIndexWithinParent()+1)}}t.set(n,r,o)}function yh(t,e){if(P(e)){const n=e.getLastDescendant();P(n)||O(n)?Na(t,n):Na(t,e)}else Na(t,e)}function bh(t,e,n,r){const o=t.getNode(),i=o.getChildAtIndex(t.offset),s=He();if(s.setFormat(n),s.setStyle(r),Xr(i))i.splice(0,0,[s]);else if(i!==null){const l=be(o)?Se().append(s):s;i.insertBefore(l)}else if(be(o)){const l=o.getLastChild();P(l)&&!l.isInline()&&l.isEmpty()?l.append(s):o.append(Se().append(s))}else o.append(s);t.is(e)&&e.set(s.__key,0,"text"),t.set(s.__key,0,"text")}function vh(t,e,n,r){const o=t.anchor.getNode();O(o)||L(398);const i=t.anchor.offset,s=He(e);s.setFormat(n),s.setStyle(r);const l=o.getParentOrThrow();if(i===0)l.isInline()&&!o.__prev?l.insertBefore(s):o.insertBefore(s,!1);else if(i===o.getTextContentSize())l.isInline()&&!o.__next?l.insertAfter(s):o.insertAfter(s,!1);else{const[a]=o.splitText(i);a.insertAfter(s,!1)}o.getTextContent()===""&&o.isAttached()&&o.remove(),s.selectEnd(),s.isComposing()&&t.anchor.type==="text"&&t.anchor.set(t.anchor.key,t.anchor.offset-e.length,t.anchor.type)}class cs{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!De(e))return!1;const n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).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 cs(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const n=this.getNodes().filter(s=>tt(s)===null),r=n.length;if(r===0)return;const o=n[r-1];let i;if(O(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++)n[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const n=this._nodes,r=[];for(const o of n){const i=Te(o);i!==null&&r.push(i)}return ur()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}deleteNodes(){const e=this.getNodes().filter(n=>tt(n)===null);if((z()||Yr())===this&&e[0]){const n=ye(e[0],"next");Zr(Pt(n,n))}for(const n of e)n.remove();xh()}}function xh(){const t=we();if(t.isEmpty()){const e=Se();t.append(e),e.select()}}function cS(t){const e=(function(n){const r=n.getNode();if(n.offset>0)return n.type==="element"&&P(r)?r.getChildAtIndex(n.offset-1):null;for(let o=r;o!==null&&!Ge(o)&&!be(o);o=o.getParent()){const i=o.getPreviousSibling();if(i!==null)return i}return null})(t);return Ze(e)&&Ze(e.getPreviousSibling())}function A(t){return t instanceof sr}class sr{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,n,r,o){this.anchor=e,this.focus=n,e._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!A(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 n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const l=new Set,a=new Set;for(const u of r)if(Tt(u)){const{origin:c}=u;o.length===0?l.add(c):(a.add(c),o.push(c))}else{const{origin:c}=u;P(c)&&a.has(c)||o.push(c)}if(s&&o.push(s.caret.origin),Cn(r.focus)&&P(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let u=rt(r.focus.origin,"previous");Tt(u)&&l.has(u.origin)&&!u.origin.isEmpty()&&u.origin.is(o[o.length-1]);u=Cu(u))l.delete(u.origin),o.pop();for(;o.length>1;){const u=o[o.length-1];if(!P(u)||a.has(u)||u.isEmpty()||l.has(u))break;o.pop()}if(o.length===0&&r.isCollapsed()){const u=et(r.anchor),c=et(r.anchor.getFlipped()),d=h=>kt(h)?h.origin:h.getNodeAtCaret(),f=d(u)||d(c)||(r.anchor.getNodeAtCaret()?u.origin:c.origin);o.push(f)}return o})(oi(Es(this),"next"));return ur()||(this._cachedNodes=n),n}setTextNodeRange(e,n,r,o){return this.anchor.set(e.__key,n,"text"),this.focus.set(r.__key,o,"text"),this}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const n=e[0],r=e[e.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[l,a]=Ra(this);let u="",c=!0;for(let d=0;d<e.length;d++){const f=e[d];if(P(f)&&!f.isInline()){c||(u+=`
8
+ `);let h="";for(const g of Zt(f)){const b=lo(f,g);b!==null&&(h+=b.getTextContent())}h!==""?(u+=h,c=!1):c=!f.isEmpty()}else if(c=!1,O(f)){let h=f.getTextContent();f===n?f===r?o.type==="element"&&i.type==="element"&&i.offset!==o.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)),u+=h}else!oe(f)&&!Ze(f)||f===r&&this.isCollapsed()||(u+=f.getTextContent())}return u}applyDOMRange(e){const n=ge(),r=n.getEditorState()._selection,o=Lh(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r);if(o===null)return;const[i,s,l]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),l&&(this.dirty=!0),Br(this)}clone(){const e=this.anchor,n=this.focus;return new sr(Gt(e.key,e.offset,e.type),Gt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=fr(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const n=cn[e];return(this.format&n)!==0}insertRawText(e){this.insertNodes(Rh(e))}insertText(e){let n=this.format,r=this.style;if(!this.isCollapsed()){const d=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(O(d)&&(n=d.getFormat(),r=d.getStyle()),this.removeText(),this.format=n,this.style=r,e==="")return;if(Yt()===null)return this.anchor.type==="element"&&bh(this.anchor,this.focus,n,r),void vh(this,e,n,r)}this.anchor.type==="element"&&bh(this.anchor,this.focus,n,r);const o=this.anchor.getNode();O(o)||L(398);const i=this.anchor.offset,s=o.getParentOrThrow(),l=o.getTextContentSize();if(wt(o)||i===0&&(!o.canInsertTextBefore()||!s.canInsertTextBefore()&&!o.__prev)||i===l&&(!o.canInsertTextAfter()||!s.canInsertTextAfter()&&!o.__next)){if(o.isSegmented()&&i!==0&&i!==l){if(Yt()!==null)o.setMode("normal").setFormat(n).setStyle(r);else{const f=He(o.getTextContent());f.setFormat(n),f.setStyle(r);const h=z()===this;o.replace(f),this.setTextNodeRange(f,i,f,i),h&&z()!==this&&ze(this)}return void(e!==""&&this.insertText(e))}if(e==="")return;if(i===0){const f=o.getPreviousSibling();if(O(f)&&f.canInsertTextAfter()&&!wt(f))f.select();else{const h=He();h.setFormat(n),h.setStyle(r),s.canInsertTextBefore()?o.insertBefore(h):s.insertBefore(h),h.select()}return void this.insertText(e)}if(i===l){const f=o.getNextSibling();if(O(f)&&f.canInsertTextBefore()&&!wt(f))f.select(0,0);else{const h=He();h.setFormat(n),h.setStyle(r),s.canInsertTextAfter()?o.insertAfter(h):s.insertAfter(h),h.select(0,0)}return void this.insertText(e)}const d=He(e);return d.setFormat(n),d.setStyle(r),o.replace(d),void d.select()}if(e==="")return;const a=s.isInline()&&i===0&&!o.__prev,u=s.isInline()&&i===l&&!o.__next,c=o.getFormat()!==n||o.getStyle()!==r;if(a||u||c){if(o.getTextContent()!==""||a||u)return void vh(this,e,n,r);o.setFormat(n),o.setStyle(r)}o.spliceText(i,0,e,!0),o.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){const e=z()===this,n=this.anchor.key;Cs(this,wS(Es(this))),this.isCollapsed()&&(function(r,o){const i=r.anchor;if(i.key===o)return;const s=i.getNode();let l=0,a="";O(s)?(l=s.getFormat(),a=s.getStyle()):P(s)&&(l=s.getTextFormat(),a=s.getTextStyle()),r.format===l&&r.style===a||(r.format=l,r.style=a,r.dirty=!0)})(this,n),e&&z()!==this&&ze(this)}formatText(e,n=null){Sh(this,e,n)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();const n=this.anchor.getNode();if(this.anchor.type==="element"&&P(n)&&n.isShadowRoot()&&tt(n)!==null){let x=n.getFirstChild()??n.append(Se()).getFirstChild();if(x!==null&&!P(x)){const _=Se();x.insertBefore(_),x=_}if(x!==null){x.selectStart();const _=z();return A(_)||L(369),_.insertNodes(e)}}if(this.anchor.type==="element"&&be(n)){const x=ja(e),_=x.getLastDescendant();return n.splice(this.anchor.offset,0,x.getChildren()),void(_!==null&&_.selectEnd())}const r=this.isBackward()?this.focus:this.anchor;let o=r.getNode(),i=ke(o,Ge);const s=e[e.length-1];if(P(i)&&"__language"in i){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const[,x]=ei(this);i.splice(x,0,e),s.selectEnd()}return}if(!e.some(x=>(P(x)||oe(x))&&!x.isInline())){P(i)||L(211,o.constructor.name,o.getType());const[x,_]=ei(this,!0);return(P(x)?x:i).splice(_,0,e),void s.selectEnd()}if(P(i)&&tt(i)!==null){const[,x]=ei(this),_=Ha(e);i.splice(x,0,_);const C=_[_.length-1];return void(C!==void 0?C.selectEnd():i.select(x,x))}if(i===null){const x=ja(e),_=x.getLastDescendant();let C=ut(this.anchor,"next");for(const T of x.getChildren())C=tu(T,C);return void(_!==null&&_.selectEnd())}if(P(i)&&!i.isParentRequired()&&!be(i.getParentOrThrow())){const[,x]=ei(this),_=Ha(e);i.splice(x,0,_);const C=_[_.length-1];return void(C!==void 0?C.selectEnd():i.select(x,x))}const l=ja(e),a=l.getLastDescendant(),u=l.getChildren(),c=cS(r),d=!P(i)||!i.isEmpty()?this.insertParagraph():null;d&&!i.isAttached()&&(o=this.anchor.getNode(),i=ke(o,Ge));const f=u[u.length-1];let h=u[0];var g;g=h,c||!P(g)||!Ge(g)||g.isEmpty()||!P(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(P(i)||L(211,o.constructor.name,o.getType()),i.append(...h.getChildren()),h=u[1]),h&&(i===null&&L(212,o.constructor.name,o.getType()),(function(x,_){const C=_.getParentOrThrow().getLastChild();let T=_;const k=[_];for(;T!==C;)T.getNextSibling()||L(140),T=T.getNextSibling(),k.push(T);let S=x;for(const w of k)S=S.insertAfter(w)})(i,h));const b=ke(a,Ge),p=a.selectEnd();d&&(P(b)&&(d.canMergeWhenEmpty()||Ge(f))?(b.append(...d.getChildren()),d.remove()):d.isEmpty()&&d.remove()),P(i)&&i.isEmpty()&&i.remove();const y=P(i)?i.getLastChild():null;Ze(y)&&b!==i&&y.remove();const v=et(ut(p.anchor,"next"));bn(p.anchor,v),bn(p.focus,v)}insertParagraph(){this.isCollapsed()||this.removeText();const e=this.anchor.getNode();if(this.anchor.type==="element"&&be(e)){const l=Se();return e.splice(this.anchor.offset,0,[l]),l.select(),l}const[,n]=ei(this),r=ke(this.anchor.getNode(),Ge);if(r!==null&&tt(r)!==null)return null;P(r)||L(213);const o=r.getChildAtIndex(n),i=o?[o,...o.getNextSiblings()]:[],s=r.insertNewAfter(this,!1);return s?(s.append(...i),s.selectStart(),s):null}insertLineBreak(e){const n=Ln();if(this.insertNodes([n]),e){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const e=[...this.getNodes()],n=e.length;let r=e[0],o=e[n-1];const[i,s]=Ra(this),l=this.isBackward(),[a,u]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[c,d]=l?[s,i]:[i,s];if(n===0)return[];if(n===1){if(O(r)&&!this.isCollapsed()){const f=r.splitText(c,d),h=c===0?f[0]:f[1];return h?(a.set(h.getKey(),0,"text"),u.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(O(r)&&(c===r.getTextContentSize()?e.shift():c!==0&&([,r]=r.splitText(c),e[0]=r,a.set(r.getKey(),0,"text"))),O(o)){const f=o.getTextContent().length;d===0?e.pop():d!==f&&([o]=o.splitText(d),e[e.length-1]=o,u.set(o.getKey(),o.getTextContentSize(),"text"))}return e}modify(e,n,r){if(ms(this,e,n,r))return;const o=e==="move",i=ge(),s=ct(gt(i));if(!s)return;const l=i._blockCursorElement,a=i._rootElement,u=this.focus.getNode();a===null||l===null||!P(u)||u.isInline()||u.canBeEmpty()||As(l,i,a);const c=ro(i,this.focus.key);let d=c;if(this.focus.type==="text"&&(d=O(u)?In(u,c,i):null),this.dirty){const f=ro(i,this.anchor.key);let h=f;if(this.anchor.type==="text"){const g=this.anchor.getNode();h=O(g)?In(g,f,i):null}h&&d&&ps(s,h,this.anchor.offset,d,this.focus.offset)}if(r==="character"&&O(u)&&u.isUnmergeable()&&(n?this.focus.offset===0:this.focus.offset===u.getTextContentSize())){const f=ye(u,n?"previous":"next").getNodeAtCaret();if(O(f)){if(!o){const h=f.getTextContentSize();return n?this.focus.set(f.__key,h-1,"text"):this.focus.set(f.__key,1,"text"),void(this.dirty=!0)}{const h=i.getElementByKey(f.getKey()),g=h?In(f,h,i):null;if(g){const b=n?g.length:0;ps(s,g,b,g,b)}}}}if(kh(s,e,n?"backward":"forward",r,a),s.rangeCount>0){const f=Ls(s,i._rootElement),h=f||s.getRangeAt(0),g=this.anchor.getNode(),b=Ie(g)?g:vg(g);this.applyDOMRange(h),this.dirty=!0,!o&&(Th(this,n,b),(f?s.direction!=="backward":s.anchorNode===h.startContainer&&s.anchorOffset===h.startOffset)||wh(this))}r==="lineboundary"&&ms(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&P(n)&&e.offset===n.getChildrenSize()||e.type==="text"&&e.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(P(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,e)){const a=P(o)?o.getNextSibling():null;if(!(P(o)&&o.isEmpty()&&P(a)&&a.isShadowRoot()))return}const i=ut(r,e?"previous":"next"),s=Bs(i);if(s.getTextSlices().every(a=>a===null||a.distance===0)){if(r.type==="element"){const u=i.getNodeAtCaret();if(P(u)&&ci(u)){const c=u.getParent();u.remove();const d=Ds(c,u);return void(d!==null&&d.selectStart())}}let a={type:"initial"};for(const u of s.iterNodeCarets("shadowRoot"))if(Tt(u)){if(!u.origin.isInline()){if(u.origin.isShadowRoot()){if(a.type==="merge-block")break;if(P(s.anchor.origin)&&s.anchor.origin.isEmpty()){const c=et(u);Cs(this,Pt(c,c)),s.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:u,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Cn(u)){if(P(u.origin)){if(u.origin.isInline()){if(!u.origin.isParentOf(s.anchor.origin))break}else a={block:u.origin,type:"merge-next-block"};continue}if(oe(u.origin)){if(!u.origin.isIsolated())if(a.type==="merge-next-block"&&(u.origin.isKeyboardSelectable()||!u.origin.isInline())&&P(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();const c=Ua();c.add(u.origin.getKey()),ze(c)}else{const c=u.origin,d=c.getParent();c.remove();const f=Ds(d,c);f!==null&&f.selectStart()}return}if(Ze(u.origin))return void u.origin.remove();break}}if(a.type==="merge-block"){const{caret:u,block:c}=a;return Zt(c).length>0?void 0:u.origin.isEmpty()&&!c.isEmpty()&&u.origin.getParent()===c.getParent()?void u.origin.remove(!0):(Cs(this,Pt(!u.origin.isEmpty()&&c.isEmpty()?vn(ye(c,u.direction)):s.anchor,u)),this.removeText())}for(let u=r.getNode();u!==null;){if(tt(u)!==null)return;if(P(u)&&u.isShadowRoot())break;u=u.getParent()}}const l=this.focus;if(Ba(this,e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Eh(this,r.getNode()))return}else{const a=l.type==="text"?l.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const u=l.offset,c=a.getTextContentSize();if(a.is(o)||e&&u!==c||!e&&u!==0)return void Ph(a,e,u)}else if(o!==null&&o.isSegmented()){const u=r.offset,c=o.getTextContentSize();if(o.is(a)||e&&u!==0||!e&&u!==c)return void Ph(o,e,u)}(function(u,c){const d=u.anchor,f=u.focus,h=d.getNode(),g=f.getNode();if(h===g&&d.type==="text"&&f.type==="text"){const b=d.offset,p=f.offset,y=b<p,v=y?b:p,x=y?p:b,_=x-1;v!==_&&(function(C){return!(hg(C)||fS(C))})(h.getTextContent().slice(v,x))&&(c?f.set(f.key,_,f.type):d.set(d.key,_,d.type))}})(this,e)}}if(n||ds(this),this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Ie(r.getParent())&&r.getPreviousSibling()===null&&Eh(this,r),xh()}}deleteLine(e){const n=this.isCollapsed(),r=za(this.anchor);if(r!==null&&oe(nt(r)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&Ba(this,e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):ke(this.anchor.getNode(),Ge)!==ke(this.focus.getNode(),Ge)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):(n||ds(this),this.removeText())}deleteWord(e){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor,o=r.getNode();if(this.forwardDeletion(r,o,e))return;Ba(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):(n||ds(this),this.removeText())}isBackward(){const e=this._cachedIsBackward;if(e!==null)return e;const n=this.focus.isBefore(this.anchor);return ur()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}}function De(t){return t instanceof cs}function _h(t,e){if(De(t)){for(const y of t.getNodes())Oa(y)&&y.setFormat(e(y.getFormat()));return}if(t.isCollapsed())return t.setFormat(e(t.format)),void Xe(null);const n=[];for(const y of t.getNodes())O(y)?n.push(y):P(y)?y.setTextFormat(e(y.getTextFormat())):Oa(y)&&y.setFormat(e(y.getFormat()));const r=n.length;if(r===0)return t.setFormat(e(t.format)),void Xe(null);const o=t.anchor,i=t.focus,s=t.isBackward(),l=s?i:o,a=s?o:i;let u=0,c=n[0],d=l.type==="element"?0:l.offset;if(l.type==="text"&&d===c.getTextContentSize()&&(u=1,c=n[1],d=0),c==null)return;const f=r-1;let h=n[f];const g=a.type==="text"?a.offset:h.getTextContentSize();if(c.is(h)){if(d===g)return;const y=e(c.getFormat());if(wt(c)||d===0&&g===c.getTextContentSize())c.setFormat(y);else{const v=c.splitText(d,g),x=d===0?v[0]:v[1];x.setFormat(y),l.type==="text"&&l.set(x.__key,0,"text"),a.type==="text"&&a.set(x.__key,g-d,"text")}return void(t.format=y)}d===0||wt(c)||([,c]=c.splitText(d),d=0);const b=e(c.getFormat());c.setFormat(b);const p=e(h.getFormat());g>0&&(g===h.getTextContentSize()||wt(h)||([h]=h.splitText(g)),h.setFormat(p));for(let y=u+1;y<f;y++){const v=n[y];v.setFormat(e(v.getFormat()))}l.type==="text"&&l.set(c.__key,d,"text"),a.type==="text"&&a.set(h.__key,g,"text"),t.format=b|p}function dS(t,e){const n=[];for(const[r,o]of Object.entries(e))typeof o=="boolean"&&n.push([r,o]);n.length!==0&&_h(t,r=>{for(const[o,i]of n)r=fr(r,o,i?cn[o]:0);return r})}function Sh(t,e,n=null){const r=n===null&&A(t)?fr(t.format,e,null):n;_h(t,o=>fr(o,e,r))}function Ch(t){const e=t.offset;if(t.type==="text")return e;const n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function Ra(t){const e=t.getStartEndPoints();if(e===null)return[0,0];const[n,r]=e;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[Ch(n),Ch(r)]}function Eh(t,e){for(let n=e;n;n=n.getParent()){if(P(n)){if(n.collapseAtStart(t))return!0;if(be(n))break}if(n.getPreviousSibling())break}return!1}function ds(t){const e=we();!e.isEmpty()&&ng(e,t)&&(t.anchor.set(e.getKey(),0,"element"),t.focus.set(e.getKey(),e.getChildrenSize(),"element"))}function wh(t){const e=t.focus,n=t.anchor,r=n.key,o=n.offset,i=n.type;n.set(e.key,e.offset,e.type,!0),e.set(r,o,i,!0)}function kh(t,e,n,r,o){const i=r==="character"?pt(t,o):null,s=i&&i.focusNode,l=i?i.focusOffset:0;if(t.modify(e,n,r),i===null||!(function(u,c,d){return u!==null&&u.nodeType===3&&(d==="backward"?c>0:d==="forward"&&c<u.length)})(s,l,n))return;const a=pt(t,o);a.focusNode===s&&a.focusOffset===l&&t.modify(e,n,r)}function Th(t,e,n){const r=t.getNodes(),o=r.filter(l=>oo(l,n));if(o.length===0||o.length===r.length)return!1;const i=e?o[0]:o[o.length-1],s=P(i)?i:i.getParentOrThrow();return e?s.selectStart():s.selectEnd(),!0}function Ba(t,e,n){if(ms(t,"extend",e,n))return;const r=ge(),o=ct(gt(r));if(!o||typeof o.modify!="function")return;const i=r._blockCursorElement,s=r._rootElement,l=t.anchor,a=t.focus.getNode();s===null||i===null||!P(a)||a.isInline()||a.canBeEmpty()||As(i,r,s);const u=w=>{const D=w.getNode(),M=r.getElementByKey(w.key);return M!==null&&w.type==="text"&&O(D)?In(D,M,r):M},c=l.getNode(),d=u(l);if(d===null)return;const f=l.offset,h=t.isCollapsed(),g=t.focus,b=h?d:u(g);if(b===null)return;const p=g.offset;if(ps(o,b,p,b,p),kh(o,"move",e?"backward":"forward",n,s),o.rangeCount===0)return;const y=Ls(o,s)||o.getRangeAt(0),v=y.startContainer,x=y.startOffset;if(h&&n==="character"&&l.type==="text"&&O(c)&&c.isUnmergeable()&&f===(e?0:c.getTextContentSize())){const w=ye(c,e?"previous":"next").getNodeAtCaret();if(O(w)){const D=e?w.getTextContentSize()-1:1;return t.focus.set(w.__key,D,"text"),void(t.dirty=!0)}}if(h&&n==="character"&&l.type==="text"){const w=e?0:c.getTextContentSize(),D=v===d?x:f!==w?w:-1;if(D>=0)return void(D!==f&&(t.focus.set(l.key,D,"text"),t.dirty=!0))}const[_,C,T,k]=e?[v,x,d,f]:[d,f,v,x],S=Ie(c)?c:vg(c);t.applyDOMRange({collapsed:!1,endContainer:T,endOffset:k,startContainer:_,startOffset:C}),t.dirty=!0,!Th(t,e,S)&&e&&wh(t),n==="lineboundary"&&ms(t,"extend",e,n,"decorators")}const fS=(()=>{try{const t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Ph(t,e,n){const r=t,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,l=0;for(let u=0;u<i;u++){const c=u===i-1;if(l=s,s+=o[u].length,e&&s===n||s>n||c){o.splice(u,1),c&&(l=void 0);break}}const a=o.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function $h(t,e,n,r){let o,i=e,s=!1;if(fe(t)){let l=!1;const a=t.childNodes,u=a.length,c=r._blockCursorElement;i===u&&u>0&&(l=!0,i=u-1),eo(t,r)!==void 0||Ks(t,r)||(s=!0);let d=a[i],f=!1;if(d===c)d=a[i+1],f=!0;else if(c!==null){const h=c.parentNode;t===h&&e>Array.prototype.indexOf.call(h.children,c)&&i--}if(o=to(d),O(o))i=Xt(o,l?"next":"previous");else{let h=to(t);if(h===null)return null;if(P(h)){const g=r.getElementByKey(h.getKey());g===null&&L(214),[h,i]=vt(h,g,r).resolveChildIndex(h,g,t,e),P(h)||L(215),l&&i>=h.getChildrenSize()&&(i=Math.max(0,h.getChildrenSize()-1));let p=h.getChildAtIndex(i);if(P(p)&&(function(y,v,x){const _=y.getParent();return x===null||_===null||!_.canBeEmpty()||_!==x.getNode()})(p,0,n)){const y=l?p.getLastDescendant():p.getFirstDescendant();y===null?h=p:(p=y,h=P(p)?p:p.getParentOrThrow()),i=0}O(p)?(o=p,h=null,i=Xt(p,l?"next":"previous")):p!==h&&l&&!f&&(P(h)||L(216),i=Math.min(h.getChildrenSize(),i+1))}else{const g=nt(h),b=g!==null?g:h,p=b.getIndexWithinParent(),y=r.getElementByKey(h.getKey());let v="after";if(y!==null&&to(t)===h){const x=vt(h,y,r);x.element!==y?v=x.resolveLeafPosition(y,t,e):e===0&&oe(h)&&(v="before")}i=v==="before"?p:p+1,h=b.getParentOrThrow()}if(P(h))return[Gt(h.__key,i,"element"),s]}}else o=to(t);return O(o)?[Gt(o.__key,Xt(o,i,"clamp"),"text"),s]:null}function Dh(t,e,n){const r=t.offset,o=t.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(e){if((n||!e)&&i===null&&P(s)&&s.isInline()){const l=s.getPreviousSibling();O(l)&&t.set(l.__key,l.getTextContent().length,"text")}}else P(i)&&!n&&i.isInline()?t.set(i.__key,i.getChildrenSize(),"element"):O(i)&&!o.isUnmergeable()&&t.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(e&&P(i)&&i.isInline())t.set(i.__key,0,"element");else if((n||e)&&i===null&&P(s)&&s.isInline()&&!s.canInsertTextAfter()&&s.getTextContentSize()>1){const l=s.getNextSibling();O(l)&&t.set(l.__key,0,"text")}}}function za(t){const e=Te(t.key);return e===null?null:gi(e)}function Mh(t,e,n){const r=za(t),o=za(e);if(r===o||r!==null&&o!==null&&r.is(o))return!1;const i=n(r,o);if(r!==null)return P(r)?e.set(r.getKey(),i?r.getChildrenSize():0,"element"):e.set(r.getKey(),i?r.getTextContentSize():0,"text"),!0;const s=nt(o);if(s===null)return!1;const l=s.getParent();if(l===null)return!1;const a=s.getIndexWithinParent();return e.set(l.getKey(),i?a+1:a,"element"),!0}function Ah(t){const e=Mh(t.anchor,t.focus,(n,r)=>(function(o,i,s,l){if(s!==null&&l!==null){const c=nt(s),d=nt(l);if(c!==null&&c.is(d)){for(const f of Rs(c).values()){if(f===s.getKey())return!0;if(f===l.getKey())return!1}return!0}return c===null||d===null||c.isBefore(d)}if(s!==null){const c=nt(s),d=Te(i.key);return c===null||d===null||!(!c.is(d)&&!c.isParentOf(d))||c.isBefore(d)}const a=nt(l),u=Te(o.key);return a!==null&&u!==null&&!a.is(u)&&!a.isParentOf(u)&&u.isBefore(a)})(t.anchor,t.focus,n,r));return e&&(t.dirty=!0),e}function Lh(t,e,n,r,o,i){if(t===null||n===null||!si(o,t,n))return null;const s=$h(t,e,A(i)?i.anchor:null,o);if(s===null)return null;const l=$h(n,r,A(i)?i.focus:null,o);if(l===null)return null;const[a,u]=s,[c,d]=l;if(a.type==="element"&&c.type==="element"){const h=to(t),g=to(n);if(oe(h)&&oe(g))return null}const f=o._slotsUsed&&Mh(a,c,()=>(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return(function(h,g){if(h.type==="text"&&g.type==="text"){const b=h.isBefore(g),p=h.is(g);Dh(h,b,p),Dh(g,!b,p),p&&g.set(h.key,h.offset,h.type)}})(a,c),[a,c,u||d||f]}function fs(t){return P(t)&&!t.isInline()}function Ih(t,e,n,r,o,i){const s=Rt(),l=new sr(Gt(t,e,o),Gt(n,r,i),0,"");return l.dirty=!0,s._selection=l,l}function Va(){const t=Gt("root",0,"element"),e=Gt("root",0,"element");return new sr(t,e,0,"")}function Ua(){return new cs(new Set)}function hs(t,e,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,l=s==="selectionchange",a=!da&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let u,c,d,f;if(A(t)&&!a)return t.clone();{if(e===null)return null;const _=pt(e,n._rootElement);if(u=_.anchorNode,c=_.focusNode,d=_.anchorOffset,f=_.focusOffset,(l||s===void 0)&&A(t)&&!si(n,u,c))return t.clone()}const h=Lh(u,d,c,f,n,t);if(h===null)return null;const[g,b,p]=h;let y=0,v="";if(A(t)){const _=t.anchor;if(g.key===_.key)y=t.format,v=t.style;else{const C=g.getNode();O(C)?(y=C.getFormat(),v=C.getStyle()):P(C)&&(y=C.getTextFormat(),v=C.getTextStyle())}}const x=new sr(g,b,y,v);return p&&(x.dirty=!0),x}function z(){return Rt()._selection}function Yr(){return ge()._editorState._selection}function lr(t,e){const n=e.__key;return t.anchor.key===n||t.focus.key===n}function ar(t,e,n,r=1){if(!lr(t,e))return;const o=t.anchor,i=t.focus,s=e.__key;if(t.isCollapsed()){const l=o.offset;if(n<=l&&r>0||n<l&&r<0){const a=Math.max(0,l+r);o.set(s,a,"element"),i.set(s,a,"element"),Fh(t)}}else{const l=t.isBackward(),a=l?i:o,u=a.getNode(),c=l?o:i,d=c.getNode();if(e.is(u)){const f=a.offset;(n<=f&&r>0||n<f&&r<0)&&a.set(s,Math.max(0,f+r),"element")}if(e.is(d)){const f=c.offset;(n<=f&&r>0||n<f&&r<0)&&c.set(s,Math.max(0,f+r),"element")}}Fh(t)}function Fh(t){const e=t.anchor,n=e.offset,r=t.focus,o=r.offset,i=e.getNode(),s=r.getNode();if(t.isCollapsed()){if(!P(i))return;const l=i.getChildrenSize(),a=n>=l,u=a?i.getChildAtIndex(l-1):i.getChildAtIndex(n);if(O(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),r.set(u.__key,c,"text")}return}if(P(i)){const l=i.getChildrenSize(),a=n>=l,u=a?i.getChildAtIndex(l-1):i.getChildAtIndex(n);if(O(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(P(s)){const l=s.getChildrenSize(),a=o>=l,u=a?s.getChildAtIndex(l-1):s.getChildAtIndex(o);if(O(u)){let c=0;a&&(c=u.getTextContentSize()),r.set(u.__key,c,"text")}}}function gs(t,e,n,r,o){let i=null,s=0,l=null;r!==null?(i=r.__key,O(r)?(s=r.getTextContentSize(),l="text"):P(r)&&(s=r.getChildrenSize(),l="element")):o!==null&&(i=o.__key,O(o)?l="text":P(o)&&(l="element")),i!==null&&l!==null?t.set(i,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),t.set(n.__key,s,"element"))}function Oh(t,e,n,r,o){t.type==="text"?t.set(n,t.offset+(e?0:o),"text"):t.offset>r.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function ps(t,e,n,r,o){try{t.setBaseAndExtent(e,n,r,o)}catch{}}function Kh(t,e,n){const r=ro(t,e.getKey());if(P(e)){const o=vt(e,r,t);return[o.element,n+o.getFirstChildOffset()]}return[r,n]}function hS(t,e,n,r,o,i){const s=i.getRootNode(),l=dr(s)||_n(s)?io(s):null;if(o.has(ch)&&l!==i||l!==null&&su(l,l))return;const a=pt(r,i);let u;if(!A(e))return void(t!==null&&si(n,a.anchorNode,a.focusNode)&&r.removeAllRanges());const c=e.anchor,d=e.focus,f=c.getNode(),h=d.getNode(),[g,b]=Kh(n,f,c.offset),[p,y]=Kh(n,h,d.offset),v=e.format,x=e.style,_=e.isCollapsed();let C=g,T=p,k=!1;if(c.type==="text"?(C=O(f)?In(f,g,n):null,k=f.getFormat()!==v||f.getStyle()!==x):A(t)&&t.anchor.type==="text"&&(k=!0),d.type==="text"&&(T=O(h)?In(h,p,n):null),C!==null&&T!==null){if(_&&(t===null||k||A(t)&&(t.format!==v||t.style!==x))&&(function(S,w,D,M,B,V){S._inputState.collapsedSelectionFormat={format:w,key:B,offset:M,style:D,timeStamp:V}})(n,v,x,b,c.key,performance.now()),(r.type!=="Range"||!_)&&a.anchorOffset===b&&a.focusOffset===y&&a.anchorNode===C&&a.focusNode===T){if(l===null||!i.contains(l)){const S=l!==null?Wr(l):null;S!==null&&S!==n||o.has(La)||i.focus({preventScroll:!0})}if(c.type!=="element")return}if(ps(r,C,b,T,y),an&&e.isCollapsed()&&i!==null&&!o.has(La)){const S=Is(i);if(S===null||!i.contains(S)){const w=io(i.ownerDocument),D=w!==null?Wr(w):null;D!==null&&D!==n||i.focus({preventScroll:!0})}}if(!o.has(eS)&&e.isCollapsed()&&i!==null&&i===Is(i)){const S=A(e)&&e.anchor.type==="element"?C.childNodes[b]||null:(u===void 0&&(u=US(r,i)),u);if(S!==null){let w;if(qt(S)){const D=S.ownerDocument.createRange();D.selectNode(S),w=D.getBoundingClientRect()}else w=S.getBoundingClientRect();(function(D,M,B){const V=fu(B),E=hu(V);if(V===null||E===null)return;const F=B.getBoundingClientRect();if(M.bottom<F.top)return;let{top:U,bottom:I}=M,Q=0,$=0,K=B;for(;K!==null;){const H=K===V.body;if(H){const ve=E.visualViewport;if(ve){const ne=ve.offsetTop;Q=ne,$=ne+ve.height}else Q=0,$=gt(D).innerHeight;const he=E.getComputedStyle(V.documentElement),N=parseFloat(he.scrollPaddingTop),q=parseFloat(he.scrollPaddingBottom);isFinite(N)&&(Q+=N),isFinite(q)&&($-=q)}else{const ve=K===B?F:K.getBoundingClientRect();Q=ve.top,$=ve.bottom}let me=0;if(U<Q?me=-(Q-U):I>$&&(me=I-$),me!==0)if(H)E.scrollBy(0,me);else{const ve=K.scrollTop;K.scrollTop+=me;const he=K.scrollTop-ve;U-=he,I-=he}if(H)break;K=gr(K)}})(n,w,i)}}(function(S,w,D,M,B){const V=S._inputState;V.isSelectionChangeFromDOMUpdate=!0,V.selectionChangeFromDOMUpdatePoints=w!==void 0&&D!==void 0&&M!==void 0&&B!==void 0?{anchorNode:w,anchorOffset:D,focusNode:M,focusOffset:B}:null})(n,C,b,T,y)}}function gS(t){let e=z()||Yr();e===null&&(e=we().selectEnd()),e.insertNodes(t)}function Nh(t,e){for(const n of t.split(/(\r?\n|\t)/))n===`
9
+ `||n===`\r
10
+ `?e.linebreak():n===" "?e.tab():n!==""&&e.text(n)}function Rh(t){const e=[];return Nh(t,{linebreak:()=>e.push(Ln()),tab:()=>e.push(Jo()),text:n=>e.push(He(n))}),e}function Ha(t){const e=[];for(const n of t)Ze(n)||(!P(n)&&!oe(n)||n.isInline()?e.push(n):P(n)&&e.push(...Ha(n.getChildren())));return e}function ei(t,e=!1){let n=t;t.isCollapsed()||n.removeText();const r=z();A(r)&&(n=r),A(n)||L(161);const o=n.anchor;let i=o.getNode(),s=o.offset;for(;!Ge(i)&&tt(i)===null;){const l=i;if([i,s]=pS(i,s,e),l.is(i))break}return[i,s]}function pS(t,e,n=!1){const r=t.getParent();if(!r){const i=Se();return we().append(i),i.select(),[we(),0]}if(O(t)){const i=t.splitText(e);if(i.length===0)return[r,t.getIndexWithinParent()];const s=e===0?0:1;return[r,i[0].getIndexWithinParent()+s]}if(!P(t)||e===0)return[r,t.getIndexWithinParent()];const o=t.getChildAtIndex(e);if(o){const i=new sr(Gt(t.__key,e,"element"),Gt(t.__key,e,"element"),0,""),s=t.insertNewAfter(i);if(s)s.append(o,...o.getNextSiblings());else if(n)return[t,e]}return[r,t.getIndexWithinParent()+1]}function Bh(t){return Ze(t)||RS(t)||O(t)||t.isParentRequired()}function ja(t){const e=Se();let n=null;for(let r=0;r<t.length;r++){const o=t[r];if(Bh(o)){if(n===null){n=o.createParentElementNode(),e.append(n);const i=t[r+1];if(Ze(o)&&(i===void 0||!Bh(i)))continue}n.append(o)}else e.append(o),n=null}return e}function ms(t,e,n,r,o="decorators-and-blocks"){if(e==="move"&&r==="character"&&!t.isCollapsed()){const[d,f]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return f.set(d.key,d.offset,d.type),!0}const i=ut(t.focus,n?"previous":"next"),s=r==="lineboundary",l=e==="move";let a=i,u=o==="decorators-and-blocks",c=!1;if(!Ja(a)){for(const d of a){u=!1;const{origin:f}=d;if(oe(f)){if(f.isIsolated()){c=!0;break}if(a=d,s&&f.isInline())continue}break}if(c)return!0;if(u)for(const d of Bs(i).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(Tt(d))d.origin.isInline()||(a=d);else{if(P(d.origin))continue;oe(d.origin)&&!d.origin.isInline()&&(a=d)}break}}if(a===i)return!1;if(l&&!s&&oe(a.origin)&&a.origin.isKeyboardSelectable()){const d=Ua();return d.add(a.origin.getKey()),ze(d),!0}return a=et(a),l&&bn(t.anchor,a),bn(t.focus,a),u||!s}let Ye=null,Ne=null,ht=!1,Ga=!1,ys=!1;const qa=new Set;let bs=0;const zh={characterData:!0,childList:!0,subtree:!0};function ur(){return ht||Ye!==null&&Ye._readOnly}function je(){ht&&L(13)}function Vh(){bs>99&&L(14)}function Rt(){return Ye===null&&L(195,Uh()),Ye}function mS(t){Rt()!==null&&Ne===null&&(Ne=t),Ne!==t&&Ld(378)}function ge(){return Ne===null&&L(337,Uh()),Ne}function yS(){ge()._dirtyType=2}function Uh(){let t=0;const e=new Set,n=Qr.version;if(typeof window<"u")for(const o of _g(document)){const i=Jr(o);if(li(i))t++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Hh(){return Ne}function jh(t,e,n){const r=e.__type,o=ig(t,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let l=0;l<s&&(i[l](e),e.isAttached());l++);}function Gh(t,e){return t!==void 0&&t.__key!==e&&t.isAttached()}function qh(t,e){if(!e)return;const n=t._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const o of r)n.add(o)}function bS(t){return vs(t,ge()._nodes)}function vs(t,e){const n=t.type,r=e.get(n);r===void 0&&L(17,n);const o=r.klass;t.type!==o.getType()&&L(18,o.name);const i=o.importJSON(t),s=t.children;if(P(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const u=vs(s[a],e);i.append(u)}const l=t.$slots;if(l){mr(i)||L(379,o.name);for(const a in l)iC(i,a,vs(l[a],e))}return i}function Yh(t,e,n){const r=Ye,o=ht,i=Ne;Ye=e,ht=!0,Ne=t;try{return n()}finally{Ye=r,ht=o,Ne=i}}function An(t,e){const n=ys;ys=!0;try{(function(r,o){const i=r._pendingEditorState,s=r._rootElement,l=r._headless||s===null;if(i===null)return void(!r._updating&&r._deferred.length>0&&Xh(r,r._deferred));const a=r._editorState,u=a._selection,c=i._selection,d=r._dirtyType!==0,f=Ye,h=ht,g=Ne,b=r._updating,p=r._observer;let y=null;if(r._pendingEditorState=null,r._editorState=i,!l&&d&&p!==null){Ne=r,Ye=i,ht=!1,r._updating=!0;try{const S=r._dirtyType,w=r._dirtyElements,D=r._dirtyLeaves;p.disconnect(),y=M_(a,i,r,S,w,D)}catch(S){if(S instanceof Error&&r._onError(S),Ga)throw S;return rg(r,null,s,i),Zd(r),r._dirtyType=2,Ga=!0,An(r,a),void(Ga=!1)}finally{p.observe(s,zh),r._updating=b,Ye=f,ht=h,Ne=g}}i._readOnly||(i._readOnly=!0);const v=r._dirtyLeaves,x=r._dirtyElements,_=r._normalizedNodes,C=r._updateTags;d&&(r._dirtyType=0,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set),r._updateTags=new Set,(function(S,w){const D=S._decorators;let M=S._pendingDecorators||D;const B=w._nodeMap;let V;for(V in M)B.has(V)||(M===D&&(M=cg(S)),delete M[V])})(r,i);const T=l?null:ct(gt(r));if(r._editable&&T!==null&&(d||c===null||c.dirty||!c.is(u))&&s!==null&&!C.has(tS)){Ne=r,Ye=i;try{if(p!==null&&p.disconnect(),d||c===null||c.dirty){const S=r._blockCursorElement;S!==null&&As(S,r,s),hS(u,c,r,T,C,s)}(function(S,w,D){let M=S._blockCursorElement;if(A(D)&&D.isCollapsed()&&D.anchor.type==="element"&&w.contains(Is(w))){const B=D.anchor,V=B.getNode(),E=B.offset;let F=!1,U=null;if(E===V.getChildrenSize())ci(V.getChildAtIndex(E-1))&&(F=!0);else{const I=V.getChildAtIndex(E);I!==null&&ci(I)&&(F=!0,U=S.getElementByKey(I.__key))}if(F){const I=vt(V,S.getElementByKey(V.__key),S).element;return M===null&&(S._blockCursorElement=M=(function(Q){const $=Q.theme,K=Ce().createElement("div");K.contentEditable="false",K.setAttribute("data-lexical-cursor","true");let H=$.blockCursor;if(H!==void 0){if(typeof H=="string"){const me=Qt(H);H=$.blockCursor=me}H!==void 0&&K.classList.add(...H)}return K})(S._config)),w.style.caretColor="transparent",void(U===null?I.appendChild(M):I.insertBefore(M,U))}}M!==null&&As(M,S,w)})(r,s,c)}finally{p!==null&&p.observe(s,zh),Ne=g,Ye=f}}y!==null&&(function(S,w,D,M,B){const V=Array.from(S._listeners.mutation),E=V.length;for(let F=0;F<E;F++){const[U,I]=V[F];for(const Q of I){const $=w.get(Q);$!==void 0&&U($,{dirtyLeaves:M,prevEditorState:B,updateTags:D})}}})(r,y,C,v,a),A(c)||c===null||u!==null&&u.is(c)||r.dispatchCommand(Ca);const k=r._pendingDecorators;k!==null&&(r._decorators=k,r._pendingDecorators=null,ti("decorator",r,!0,k)),(function(S,w,D){const M=dg(w),B=dg(D);M!==B&&ti("textcontent",S,!0,B)})(r,o||a,i),ti("update",r,!0,{dirtyElements:x,dirtyLeaves:v,editorState:i,mutatedNodes:y,normalizedNodes:_,prevEditorState:o||a,tags:C}),!b&&Xh(r,r._deferred),(function(S){const w=S._updates;if(w.length===0)return void(S._cascadeCount=0);if((function(M){qa.has(M)||(qa.add(M),setTimeout(()=>{qa.delete(M),M._cascadeCount=0},0))})(S),S._cascadeCount++>99)return S._updates=[],S._cascadeCount=0,void S._onWarn(new Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${S._config.namespace}`));const D=w.shift();if(D){const[M,B]=D;ni(S,M,B)}})(r)})(t,e)}finally{ys=n}}function ti(t,e,n,...r){const o=e._updating;e._updating=n;try{const i=e._listeners[t],s=Array.from(i);for(const[l,a]of s){a&&a();const u=l(...r),c=typeof u=="function"?u:void 0;i.has(l)?i.set(l,c):c&&c()}}finally{e._updating=o}}function Zh(t,e,n,r){const o=lu(t);let i;if(!ys)for(let s=0;s<o.length;s++)o[s]._updating||(o[s]._cascadeCount=0);for(let s=4;s>=0;s--)for(let l=0;l<o.length;l++){const a=o[l];if(l>0&&a._updating){i=a;break}const u=a._commands.get(e);if(u!==void 0){const c=u[s];if(c.size>0){let d=!1;if(Et(a,()=>{for(const f of c)if(f(n,r))return void(d=!0)}),d)return d}}}return i&&i.update(()=>{Zh(i,e,n,r)}),!1}function Xh(t,e){if(t._deferred=[],e.length!==0){const n=t._updating;t._updating=!0;try{for(let r=0;r<e.length;r++)e[r]()}finally{t._updating=n}}}function Qh(t,e){const n=t._updates;let r=e||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,l=t._pendingEditorState;let a;s!==void 0&&(a=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(l===null&&L(191),l._flushSync=!0),a&&t._deferred.push(a),qh(t,s.tag)),l==null?ni(t,i,s):i()}}return r}function vS(){const t=Rt();je(),t._flushSync=!0}function ni(t,e,n){const r=t._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,qh(t,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&t._deferred.push(o);const l=t._editorState;let a=t._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=t._pendingEditorState=Jh(a||l),u=!0),a._flushSync=s;const c=Ye,d=ht,f=Ne,h=t._updating;Ye=a,ht=!1,t._updating=!0,Ne=t;const g=t._headless||t.getRootElement()===null;ru(null);try{u&&(g?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=(function(v,x){const _=v.getEditorState()._selection,C=ct(gt(v));return A(_)||_==null?hs(_,C,v,x):_.clone()})(t,n&&n.event||null));const p=t._compositionKey;e(),i=Qh(t,i),(function(v,x){const _=x.getEditorState()._selection,C=v._selection;if(A(C)){const T=C.anchor,k=C.focus;let S;if(T.type==="text"&&(S=T.getNode(),S.selectionTransform(_,C)),k.type==="text"){const w=k.getNode();S!==w&&w.selectionTransform(_,C)}}})(a,t),t._dirtyType!==0&&(i?(function(v,x){const _=x._dirtyLeaves,C=v._nodeMap;for(const T of _){const k=C.get(T);O(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&lf(k)}})(a,t):(function(v,x){const _=x._dirtyLeaves,C=x._dirtyElements,T=v._nodeMap,k=Yt(),S=new Map;let w=_,D=w.size,M=C,B=M.size;for(;D>0||B>0;){if(D>0){x._dirtyLeaves=new Set;for(const V of w){const E=T.get(V);O(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&lf(E),E!==void 0&&Gh(E,k)&&jh(x,E,S),_.add(V)}if(w=x._dirtyLeaves,D=w.size,D>0){bs++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,M.delete("root")&&M.set("root",!0);for(const V of M){const E=V[0],F=V[1];if(C.set(E,F),!F)continue;const U=T.get(E);U!==void 0&&Gh(U,k)&&jh(x,U,S)}w=x._dirtyLeaves,D=w.size,M=x._dirtyElements,B=M.size,bs++}x._dirtyLeaves=_,x._dirtyElements=C})(a,t),Qh(t),(function(v,x,_,C){const T=v._nodeMap,k=x._nodeMap,S=[];for(const[M]of C){const B=k.get(M);B!==void 0&&(B.isAttached()||(P(B)&&qi(B,M,T,k,S,C),T.has(M)||C.delete(M),S.push(M)))}for(const M of _){const B=k.get(M);B===void 0||B.isAttached()||(mr(B)&&B.__slots!==null&&qi(B,M,T,k,S,_),T.has(M)||_.delete(M),S.push(M))}for(const M of S)k.delete(M);const w=ge(),D=w._compositionKey;D===null||k.has(D)||(w._compositionKey=null)})(l,a,t._dirtyLeaves,t._dirtyElements)),p!==t._compositionKey&&(a._flushSync=!0);const y=a._selection;if(A(y)){t._slotsUsed&&Ah(y);const v=a._nodeMap,x=y.anchor.key,_=y.focus.key;v.get(x)!==void 0&&v.get(_)!==void 0||L(19)}else De(y)&&y._nodes.size===0&&(a._selection=null)}catch(p){return p instanceof Error&&t._onError(p),t._pendingEditorState=l,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void An(t)}finally{Ye=c,ht=d,Ne=f,t._updating=h,bs=0}t._dirtyType!==0||t._deferred.length>0||(function(p,y){const v=y.getEditorState()._selection,x=p._selection;if(x!==null){if(x.dirty||!x.is(v))return!0}else if(v!==null)return!0;return!1})(a,t)?a._flushSync?(a._flushSync=!1,An(t)):u&&IS(()=>{An(t)}):(a._flushSync=!1,u&&(r.clear(),t._deferred=[],t._pendingEditorState=null))}function Et(t,e,n){Ne===t&&n===void 0?ur()?ni(t,e,n):e():ni(t,e,n)}function xS(t){if(be(t)){let e=null;for(const n of t.getChildren())e=n.isInline()?(e||n.replace(n.createParentElementNode())).append(n):null}}class Be extends ft{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:xS,extends:ft})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&L(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return m_[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){const e=[];let n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Zt(this).length===0}isDirty(){const e=ge()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){const e=[];for(const r of Zt(this)){const o=lo(this,r);if(P(o))for(const i of o.getAllTextNodes())e.push(i)}let n=this.getFirstChild();for(;n!==null;){if(O(n)&&e.push(n),P(n))for(const r of n.getAllTextNodes())e.push(r);n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;P(e);){const n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;P(e);){const n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){const n=this.getChildren(),r=n.length;if(e>=r){const i=n[r-1];return P(i)&&i.getLastDescendant()||i||null}const o=n[e];return P(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Te(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&L(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Te(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&L(96,this.__key),e}getChildAtIndex(e){const n=this.getChildrenSize();let r,o;if(e<n/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=n-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e=Kg(this);const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];e+=i.getTextContent(),P(i)&&o!==r-1&&!i.isInline()&&(e+=Wn)}return e}getTextContentSize(){let e=(function(o){let i=0;for(const s of Zt(o)){const l=lo(o,s);l!==null&&(i+=l.getTextContentSize())}return i})(this);const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];e+=i.getTextContentSize(),P(i)&&o!==r-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const n=ji[e];return(this.getFormat()&n)!==0}return!1}hasTextFormat(e){const n=cn[e];return(this.getTextFormat()&n)!==0}getFormatFlags(e,n){return fr(this.getLatest().__textFormat,e,n)}getTextStyle(){return this.getLatest().__textStyle}select(e,n){je();const r=z();let o=e,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){const a=this.getFirstChild();if(O(a)||P(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||n!==void 0&&n!==s)){const a=this.getLastChild();if(O(a)||P(a))return a.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const l=this.__key;return A(r)?(r.anchor.set(l,o,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):Ih(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(n=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""&&ji[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const n=this.getWritable();return n.__textFormat=e,n}setTextStyle(e){const n=this.getWritable();return n.__textStyle=e,n}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){is(this)&&L(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();e+n<=o||L(226,String(e),String(n),String(o));for(const h of r);const s=i.__key,l=[],a=[];let u=this.getChildAtIndex(e+n),c=null,d=o-n+r.length;if(e!==0)if(e===o)c=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(c=h.getPreviousSibling())}if(n>0){let h=c===null?this.getFirstChild():c.getNextSibling();for(let g=0;g<n;g++){h===null&&L(100);const b=h.getNextSibling(),p=h.__key;xn(h.getWritable()),a.push(p),h=b}}let f=c;for(const h of r){f!==null&&h.is(f)&&(c=f=f.getPreviousSibling()),u!==null&&h.is(u)&&(u=u.getNextSibling());const g=h.getWritable();g.__parent===s&&d--,xn(g);const b=h.__key;if(f===null)i.__first=b,g.__prev=null;else{const p=f.getWritable();p.__next=b,g.__prev=p.__key}h.__key===s&&L(76),g.__parent=s,l.push(b),f=h}if(u===null)f!==null&&(f.getWritable().__next=null,i.__last=f.__key);else{const h=u.getWritable();if(f!==null){const g=f.getWritable();h.__prev=f.__key,g.__next=u.__key}else h.__prev=null}if(i.__size=d,a.length){const h=z();if(A(h)){const g=new Set(a),b=new Set(l),{anchor:p,focus:y}=h;Wh(p,g,b)&&gs(p,p.getNode(),this,c,u),Wh(y,g,b)&&gs(y,y.getNode(),this,c,u),d!==0||this.canBeEmpty()||be(this)||this.remove()}}return i}getDOMSlot(e){return new Vd(e)}exportDOM(e){const{element:n}=super.exportDOM(e);if(fe(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px",n.setAttribute("data-lexical-indent",String(r)));const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||be(this)||this.getChildren().some(O)||(n!==0&&(e.textFormat=n),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,n){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,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,n){const r=vt(this,e,n);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function P(t){return t instanceof Be}function Wh(t,e,n){let r=t.getNode();for(;r;){const o=r.__key;if(e.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class Ya extends ft{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&L(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function oe(t){return t instanceof Ya}class xs extends Be{__cachedText;$config(){return this.config("root",{extends:Be})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){L(51)}getTextContent(){const e=this.__cachedText;return e===null||!ur()&&ge()._dirtyType!==0?super.getTextContent():e}remove(){L(52)}replace(e){L(53)}insertBefore(e){L(54)}insertAfter(e){L(55)}updateDOM(e,n){return!1}splice(e,n,r){for(const o of r)P(o)||oe(o)||L(282);return super.splice(e,n,r)}static importJSON(e){return we().updateFromJSON(e)}collapseAtStart(){return!0}}function Ie(t){return t instanceof xs}function Jh(t){return new ri(Gd(t._nodeMap),null,t._slotsUsed)}function Za(){return new ri(new Map([["root",new xs]]),null,!1)}function Xa(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&L(130,n.name),P(t)){const o=e.children;Array.isArray(o)||L(59,n.name);const i=t.getChildren();for(let s=0;s<i.length;s++){const l=Xa(i[s]);o.push(l)}}const r=Zt(t);if(r.length>0){const o={};for(const i of r){const s=lo(t,i);s===null&&L(366,n.name,i),o[i]=Xa(s)}e.$slots=o}return e}function _S(t){return t instanceof ri}class ri{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,n=null,r=!1){this._nodeMap=e,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=r}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,n){return Yh(n&&n.editor||null,this,e)}clone(e){const n=new ri(this._nodeMap,e===void 0?this._selection:e,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(){return Yh(null,this,()=>({root:Xa(we())}))}}class Qa extends Be{$config(){return this.config("artificial",{extends:Be})}createDOM(e){return Ce().createElement("div")}}class _s extends ft{$config(){return this.config("linebreak",{importDOM:{br:e=>CS(e)||ES(e)?null:{conversion:SS,priority:0}}})}getTextContent(){return`
11
+ `}createDOM(){return Ce().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function SS(t){return{node:Ln()}}function Ln(){return Bt(new _s)}function Ze(t){return t instanceof _s}function CS(t){const e=t.parentElement;if(e!==null&&di(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&Ss(n)){const r=e.lastChild;if(r===t||r.previousSibling===t&&Ss(r))return!0}}return!1}function ES(t){const e=t.parentElement;if(e!==null&&di(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&Ss(n))return!1;const r=e.lastChild;if(r===t||r.previousSibling===t&&Ss(r))return!0}return!1}function Ss(t){return qt(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function ut(t,e){const{type:n,key:r,offset:o}=t,i=BS(t.key);return n==="text"?(O(i)||L(266,i.getType(),r),Fn(i,e,o)):(P(i)||L(267,i.getType(),r),eu(i,t.offset,e))}function bn(t,e){const{origin:n,direction:r}=e,o=r==="next";kt(e)?t.set(n.getKey(),e.offset,"text"):Cn(e)?O(n)?t.set(n.getKey(),Xt(n,r),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(Tt(e)&&P(n)||L(268),t.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function Zr(t){const e=z(),n=A(e)?e:Va();return Cs(n,t),ze(n),n}function Cs(t,e){bn(t.anchor,e.anchor),bn(t.focus,e.focus)}function Es(t){const{anchor:e,focus:n}=t,r=ut(e,"next"),o=ut(n,"next"),i=On(r,o)<=0?"next":"previous";return Pt(zt(r,i),zt(o,i))}function vn(t){const{direction:e,origin:n}=t,r=ye(n,Sn(e)).getNodeAtCaret();return r?ye(r,e):rt(n.getParentOrThrow(),e)}function eg(t,e="root"){const n=[t];for(let r=Tt(t)?t.getParentCaret(e):t.getSiblingCaret();r!==null;r=r.getParentCaret(e))n.push(vn(r));return n}function Wa(t){return!!t&&t.origin.isAttached()}function wS(t,e="removeEmptySlices"){if(t.isCollapsed())return t;const n="root",r="next";let o=e;const i=oi(t,r);let s=i.anchor.origin;for(;s!==null&&!be(s);)s=s.getParent();const l=P(s)?s.getFirstChild():null,a=eg(i.anchor,n),u=eg(i.focus.getFlipped(),n),c=new Set,d=[];for(const y of i.iterNodeCarets(n))if(Tt(y))c.add(y.origin.getKey());else if(Cn(y)){const{origin:v}=y;P(v)&&!c.has(v.getKey())||d.push(v)}const f=new Set;for(const y of d){const v=y.getParent();v===null||c.has(v.getKey())||f.add(v),xn(y)}for(const y of f)!y.canBeEmpty()&&!be(y)&&y.isEmpty()&&y.isAttached()&&y.remove();for(const y of i.getTextSlices()){if(!y)continue;const{origin:v}=y.caret,x=v.getTextContentSize(),_=vn(ye(v,r)),C=v.getMode();if(Math.abs(y.distance)===x&&o==="removeEmptySlices"||C==="token"&&y.distance!==0)_.remove();else if(y.distance!==0){o="removeEmptySlices";let T=y.removeTextSlice();const k=y.caret.origin;if(C==="segmented"){const S=T.origin,w=He(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());_.replaceOrInsert(w),T=Fn(w,r,T.offset)}k.is(a[0].origin)&&(a[0]=T),k.is(u[0].origin)&&(u[0]=T.getFlipped())}}let h,g;for(const y of a)if(Wa(y)){h=et(y);break}for(const y of u)if(Wa(y)){g=et(y);break}const b=(function(y,v,x){if(!y||!v)return null;const _=y.getParentAtCaret(),C=v.getParentAtCaret();if(!_||!C)return null;const T=_.getParents().reverse();T.push(_);const k=C.getParents().reverse();k.push(C);const S=Math.min(T.length,k.length);let w;for(w=0;w<S&&T[w]===k[w];w++);const D=(V,E)=>{let F;for(let U=w;U<V.length;U++){const I=V[U];if(be(I))return;!F&&E(I)&&(F=I)}return F},M=D(T,Ge),B=M&&D(k,V=>x.has(V.getKey())&&Ge(V));return B&&Zt(B).length>0?null:M&&B?[M,B]:null})(h,g,c);if(b){const[y,v]=b;rt(y,"previous").splice(0,v.getChildren());let x=v.getParent();for(v.remove(!0);x&&x.isEmpty();){const _=x;x=x.getParent(),_.remove(!0)}}else if(g){const y=(function(_){if(Tt(_)){const C=_.origin;if(Ge(C))return C}else{const C=_.getParentAtCaret();if(C&&Ge(C))return C}return null})(g),v=y&&y.getParent(),x=y&&y.getParents().findLast(ui);if(y&&v&&!Ie(v)&&y.isEmpty()&&c.has(y.getKey())&&Zt(y).length===0&&(!x||c.has(x.getKey()))){y.remove(!0);let _=v;for(;_&&!Ie(_)&&_.isEmpty();){const C=_.getParent();if(C&&Ie(C)&&C.getChildrenSize()<=1)break;const T=_;_=C,T.remove(!0)}}}Ds(s,l)===null&&Ds(we(),null);const p=[h,g,...a,...u].find(Wa);if(p)return zs(zt(et(p),t.direction));L(269,JSON.stringify(a.map(y=>y.origin.__key)))}function et(t){const e=(function(o){let i=o;for(;Tt(i);){const s=Cu(i);if(!Tt(s))break;i=s}return i})(t.getLatest()),{direction:n}=e;if(O(e.origin))return kt(e)?e:Fn(e.origin,n,n);const r=e.getAdjacentCaret();return Cn(r)&&O(r.origin)?Fn(r.origin,n,Sn(n)):e}function Ja(t){return kt(t)&&t.offset!==Xt(t.origin,t.direction)}function oi(t,e){return t.direction===e?t:Pt(zt(t.focus,e),zt(t.anchor,e))}function eu(t,e,n){let r=rt(t,"next");for(let o=0;o<e;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return zt(r,n)}function kS(t){const{origin:e,offset:n,direction:r}=t;if(n===Xt(e,r))return t.getSiblingCaret();if(n===Xt(e,Sn(r)))return vn(t.getSiblingCaret());const[o]=e.splitText(n);return O(o)||L(281),zt(ye(o,"next"),r)}function TS(t,e){return!0}function tg(t,{$copyElementNode:e=Qe,$splitTextPointCaretNext:n=kS,rootMode:r="shadowRoot",$shouldSplit:o=TS,removeEmptyDestination:i=!1}={}){if(kt(t))return n(t);const s=t.getParentCaret(r);if(s){const{origin:l}=s;if(Tt(t)){const u=vn(s);if(i&&l.isEmpty())return l.remove(),u;if(!l.canBeEmpty()||!o(l,"first"))return u}const a=(function(u){const c=[];for(let d=u.getAdjacentCaret();d;d=d.getAdjacentCaret())c.push(d.origin);return c})(t);(a.length>0||!i&&l.canBeEmpty()&&o(l,"last"))&&s.insert(e(l).splice(0,0,a))}return s}function tu(t,e,n){let r=zt(e,"next");kt(r)&&(r.offset===0?r=ye(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=ye(r.origin,"next"))),r.origin.is(t)&&(Cn(r)||L(342,t.getKey(),t.getType()),r=vn(r)),(t.is(r.getNodeAtCaret())||t.is(r.getFlipped().getNodeAtCaret()))&&t.remove(!0);for(let o=r;o;o=tg(o,n))r=o;return kt(r)&&L(283),r.insert(t.isInline()?Se().append(t):t),zt(ye(t.getLatest(),"next"),e.direction)}function ng(t,e){const n=oi(A(e)?Es(e):e,"next"),r=gi(n.anchor.origin),o=gi(t.getLatest());if(r===null?o!==null:!r.is(o))return!1;const i=et(rt(t,"next")),s=zt(et(rt(t,"previous")),"next");return On(n.anchor,i)<=0&&On(n.focus,s)>=0}class ws extends Be{$config(){return this.config("paragraph",{extends:Be,importDOM:{p:()=>({conversion:PS,priority:0})}})}createDOM(e){const n=Ce().createElement("p"),r=no(e.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(e,n,r){return!1}exportDOM(e){const{element:n}=super.exportDOM(e);if(fe(n)){this.isEmpty()&&n.append(Ce().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const n=this.getChildren().find(O);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}extractWithChild(e,n,r){if(!A(n)||this.getFormatType()===""&&this.getIndent()===0&&this.getStyle()==="")return!1;if(ng(this,n)){const o=this.getTextContent();return o!==""&&n.getTextContent()===o}return!1}insertNewAfter(e,n){const r=Se();r.setTextFormat(e.format),r.setTextStyle(e.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){if(this.getChildren().every(e=>O(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function PS(t){const e=Se();if(Os(e,t),yu(t,e),e.getFormatType()===""){const n=t.getAttribute("align");n&&n&&n in ji&&e.setFormat(n)}return fi(e,t),{node:e}}function Se(){return Bt(new ws)}function Xr(t){return t instanceof ws}function $S(t){console.warn(t)}const re=0,cr=1,ks=4,DS=-8;function rg(t,e,n,r,o){const i=t._keyToDOMMap;i.clear(),t._editorState=Za(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,o&&o.preserveUpdateQueue||(t._updateTags=new Set,t._updates=[],t._cascadeCount=0),t._blockCursorElement=null,t._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(t._inputState.handledSelectionCommandTimeoutId),t._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};const s=t._observer;s!==null&&(s.disconnect(),t._observer=null),e!==null&&(e.textContent="",(function(l,a){const u=`__lexicalKey_${a._key}`;delete l[u]})(e,t)),n!==null&&(n.textContent="",i.set("root",n),ug(n,t,"root"))}function MS(t){const e=new Set,n=new Set;for(const{klass:r,ownNodeConfig:o}of vu(t)){const i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&e.add(s)}if(o){const s=o.$transform;s&&e.add(s)}}return e}const Ts={$createDOM:(t,e)=>t.createDOM(e._config,e),$decorateDOM:(t,e,n,r)=>{},$exportDOM:(t,e)=>{const n=iu(e,t.getType());return n&&n.exportDOM!==void 0?n.exportDOM(e,t):t.exportDOM(e)},$extractWithChild:(t,e,n,r,o)=>P(t)&&t.extractWithChild(e,n,r),$getDOMSlot:(t,e,n)=>t.getDOMSlot(e),$getSlotTargetElement:(t,e,n,r)=>null,$shouldExclude:(t,e,n)=>P(t)&&t.excludeFromCopy("html"),$shouldInclude:(t,e,n)=>!e||t.isSelected(e),$updateDOM:(t,e,n,r)=>t.updateDOM(e,n,r._config)};function og(t){const e=t||{},n=Hh(),r=e.theme||{},o=t===void 0?n:e.parentEditor||null,i=e.disableEvents||!1,s=Za(),l=e.namespace||(o!==null?o._config.namespace:gg()),a=e.editorState,u=[xs,mn,_s,us,ws,Qa,...e.nodes||[]],{onError:c,onWarn:d,html:f}=e,h=e.editable===void 0||e.editable;let g;if(t===void 0&&n!==null)g=n._nodes;else{g=new Map;for(let p=0;p<u.length;p++){let y=u[p],v=null,x=null;if(y&&typeof y=="object"){const T=y;y=T.replace,v=T.with,x=T.withKlass||null}if(typeof y!="function"||!y.prototype||!(y===ft||y.prototype instanceof ft)){let T="<unknown>";try{T=JSON.parse(jd)}catch{}L(365,String(p-u.length+(e.nodes?e.nodes.length:0)),typeof y=="function"?`${y.name}${typeof y.getType=="function"?` (type ${String(y.getType())})`:""}`:String(y),String(T))}bu(y);const _=y.getType(),C=MS(y);g.set(_,{exportDOM:f&&f.export?f.export.get(y):void 0,klass:y,replace:v,replaceWithKlass:x,sharedNodeState:w_(u[p]),transforms:C})}}const b=new Qr(s,o,g,{disableEvents:i,dom:{...Ts,...t&&t.dom},namespace:l,theme:r},c||console.error,d||$S,(function(p,y){const v=new Map,x=new Set,_=C=>{Object.keys(C).forEach(T=>{let k=v.get(T);k===void 0&&(k=[],v.set(T,k)),k.push(C[T])})};return p.forEach(C=>{const T=C.klass.importDOM;if(T==null||x.has(T))return;x.add(T);const k=T.call(C.klass);k!==null&&_(k)}),y&&_(y),v})(g,f?f.import:void 0),h,t);return a!==void 0&&(b._pendingEditorState=a,b._dirtyType=2),(function(p){p.registerCommand(wf,Y_,re),p.registerCommand(kf,Z_,re),p.registerCommand(Tf,X_,re),p.registerCommand(Pf,Q_,re),p.registerCommand($f,W_,re)})(b),b}function AS(t,e){const n=t.get(e);t.delete(e),n&&n()}function ii(t,e,n){return t.set(e,n),AS.bind(null,t,e)}class Qr{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_createEditorArgs;constructor(e,n,r,o,i,s,l,a,u){this._createEditorArgs=u,this._parentEditor=n,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new ca,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,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=gg(),this._onError=i,this._onWarn=s,this._htmlConversions=l,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return ii(this._listeners.update,e)}registerEditableListener(e){return ii(this._listeners.editable,e)}registerDecoratorListener(e){return ii(this._listeners.decorator,e)}registerTextContentListener(e){return ii(this._listeners.textcontent,e)}registerRootListener(e){const n=this._listeners.root;return xt(ii(n,e,e(this._rootElement,null)||void 0),()=>(function(r,o,i){const s=r.get(o);s&&s(),r.set(o,o(...i)||void 0)})(n,e,[null,this._rootElement]))}registerCommand(e,n,r){r===void 0&&L(35);const o=this._commands;o.has(e)||o.set(e,[new Ko,new Ko,new Ko,new Ko,new Ko]);const i=o.get(e);i===void 0&&L(36,String(e));const s=(function(a){return 7&a})(r),l=i[s];return s!==r?l.addFront(n):l.addBack(n),()=>{l.delete(n),i.every(a=>a.size===0)&&o.delete(e)}}registerMutationListener(e,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(e){const n=this._nodes.get(e.getType());return n===void 0&&L(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){const r=this._editorState,o=kg(r).get(n.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,n){const r=this.getRegisteredNode(e);return r.transforms.add(n),r}registerNodeTransform(e,n){const r=this.registerNodeTransformToKlass(e,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,l){const a=kg(s.getEditorState()),u=[];for(const c of l){const d=a.get(c);d&&u.push(d)}u.length!==0&&s.update(()=>{for(const c of u)for(const d of c.keys()){const f=Te(d);f&&f.markDirty()}},s._pendingEditorState===null?{tag:Gr}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...n){return ee(this,e,...n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const n=this._rootElement;if(e!==n){const r=no(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,rg(this,n,e,o,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||J_(n),r!=null&&n.classList.remove(...r)),e!==null){const i=hu(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=2,Zd(this),this._updateTags.add(Gr),An(this),this._config.disableEvents||(function(l,a){const u=l.ownerDocument;Da.set(l,u);let c=es.get(u);c===void 0&&(c={editors:new Set,hasShadowEditor:void 0},es.set(u,c)),c.editors.add(a),c.hasShadowEditor=void 0,l.__lexicalEditor=a;const d=th(l);d.push(q_.register(u));for(let f=0;f<$a.length;f++){const[h,g]=$a[f],b=typeof g=="function"?p=>{oh(p)||(rh(p),(a.isEditable()||h==="click")&&g(p,a))}:p=>{if(oh(p))return;rh(p);const y=a.isEditable();switch(h){case"cut":return y&&ee(a,Ta,p);case"copy":return ee(a,Ji,p);case"paste":return y&&ee(a,Xi,p);case"dragstart":return y&&ee(a,Bf,p);case"dragover":return y&&ee(a,zf,p);case"dragend":return y&&ee(a,K_,p);case"focus":return y&&ee(a,B_,p);case"blur":return y&&ee(a,z_,p);case"drop":return y&&ee(a,Rf,p)}};d.push(G_(l,h,b))}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Gr),An(this);ti("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&L(38);let r=e;r._readOnly&&(r=Jh(e),r._selection=e._selection?e._selection.clone():null),Yd(this);const o=this._pendingEditorState,i=n!==void 0?n.tag:null;o===null||o.isEmpty()||(i!=null&&this._updateTags.add(i),An(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Et(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(const[s,l]of r._nodeMap.entries())P(l)?this._dirtyElements.set(s,!0):this._dirtyLeaves.add(s)},{discrete:!this._updating||void 0})}parseEditorState(e,n){return(function(r,o,i){const s=Za(),l=Ye,a=ht,u=Ne,c=o._dirtyElements,d=o._dirtyLeaves,f=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Ye=s,ht=!1,Ne=o,ru(null);try{const g=o._nodes;vs(r.root,g),i&&i(),s._readOnly=!0,s._parsed=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=c,o._dirtyLeaves=d,o._cloneNotNeeded=f,o._dirtyType=h,Ye=l,ht=a,Ne=u}return s})(typeof e=="string"?JSON.parse(e):e,this,n)}read(...e){const[n,r]=e.length===1?["force-commit",e[0]]:e;return n==="force-commit"&&An(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(r,{editor:this})}update(e,n){(function(r,o,i){r._updating?r._updates.push([o,i]):ni(r,o,i)})(this,e,n)}focus(e,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Et(this,()=>{const o=z(),i=we();o!==null?o.dirty||ze(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),pr("focus"),NS(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const n=ct(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ti("editable",this,!0,e),this._slotsUsed&&this.update(()=>yS()))}toJSON(){return{editorState:this._editorState.toJSON()}}}Qr.version=jd;let nu=null;function ru(t){nu=t}const ou=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM");let LS=1;function ig(t,e){const n=iu(t,e);return n===void 0&&L(30,e),n}function iu(t,e){return t._nodes.get(e)}const IS=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)};function su(t,e){const n=e!==void 0?e:(()=>{const i=t.getRootNode();return dr(i)||_n(i)?io(i):null})();if(!fe(n)||n.hasAttribute("data-lexical-slot"))return!1;const r=hr(n),o=n.nodeName;return lh(r)&&(o==="INPUT"||o==="TEXTAREA"||n.contentEditable==="true"&&Jr(n)==null)}function si(t,e,n){const r=t.getRootElement();if(!r)return!1;try{if(!e||!r.contains(e)||!r.contains(n))return!1}catch{return!1}return Wr(e)===t&&t.read("latest",()=>!su(e))}function li(t){return t instanceof Qr}function Wr(t){let e=t;for(;e!=null;){const n=Jr(e);if(li(n))return n;e=gr(e)}return null}function Jr(t){return t?t.__lexicalEditor:null}function Ps(t){return ir(t)||t.isToken()}function wt(t){return Ps(t)||t.isSegmented()}function qt(t){return so(t)&&t.nodeType===3}function dr(t){return so(t)&&t.nodeType===9}function FS(t){let e=t;for(;e!=null;){if(qt(e))return e;e=e.firstChild}return null}function fr(t,e,n){const r=cn[e];if(n!==null&&(t&r)===(n&r))return t;let o=t^r;return e==="subscript"?o&=-65:e==="superscript"?o&=-33:e==="lowercase"?(o&=-513,o&=-1025):e==="uppercase"?(o&=-257,o&=-1025):e==="capitalize"&&(o&=-257,o&=-513),o}function sg(t){return O(t)||Ze(t)||oe(t)}function lg(t,e){const n=(function(){const s=nu;return nu=null,s})();if((e=e||n&&n.__key)!=null)return void(t.__key=e);je(),Vh();const r=ge(),o=Rt(),i=""+LS++;o._nodeMap.set(i,t),P(t)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType===0&&(r._dirtyType=1),t.__key=i}function xn(t){tt(t)!==null&&L(380,t.__key,String(tt(t)));const e=t.getParent();if(e!==null){const n=t.getWritable(),r=e.getWritable(),o=t.getPreviousSibling(),i=t.getNextSibling(),s=i!==null?i.__key:null,l=o!==null?o.__key:null,a=o!==null?o.getWritable():null,u=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=l),a!==null&&(a.__next=s),u!==null&&(u.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function $s(t){Vh(),is(t)&&L(323,t.__key,t.__type);const e=t.getLatest(),n=e.__parent!==null?e.__parent:yr(e)?e.__slotHost:null,r=Rt(),o=ge(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(a,u,c){let d=a;for(;d!==null;){if(c.has(d))return;const f=u.get(d);if(f===void 0)break;c.set(d,!1),d=f.__parent!==null?f.__parent:yr(f)?f.__slotHost:null}})(n,i,s);const l=e.__key;o._dirtyType===0&&(o._dirtyType=1),P(t)?s.set(l,!0):o._dirtyLeaves.add(l)}function Xe(t){je();const e=ge(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,n!==null){const r=Te(n);r!==null&&r.getWritable()}if(t!==null){const r=Te(t);r!==null&&r.getWritable()}}}function Yt(){return ur()?null:ge()._compositionKey}function Te(t,e){const n=(e||Rt())._nodeMap.get(t);return n===void 0?null:n}function ag(t,e){const n=eo(t,ge());return n!==void 0?Te(n,e):null}function ug(t,e,n){t[`__lexicalKey_${e._key}`]=n}function eo(t,e){return t[`__lexicalKey_${e._key}`]}function hr(t,e){let n=t;for(;n!=null;){const r=ag(n,e);if(r!==null)return r;n=gr(n)}return null}function cg(t){const e=t._decorators,n=Object.assign({},e);return t._pendingDecorators=n,n}function dg(t){return t.read(()=>we().getTextContent())}function we(){return Rt()._nodeMap.get("root")}function Ds(t,e){if(!(be(t)&&t.isAttached()&&t.isEmpty()&&(Ie(t)||e!==null&&Ge(e))))return null;const n=Se();return t.append(n),n}function ze(t){je();const e=Rt();t!==null&&(t.dirty=!0,t.setCachedNodes(null),A(t)&&ge()._slotsUsed&&Ah(t)),e._selection=t}function fg(){je(),Yd(ge())}function to(t){const e=(function(n,r){let o=n;for(;o!=null;){const i=eo(o,r);if(i!==void 0)return i;o=gr(o)}return null})(t,ge());return e===null?null:Te(e)}function hg(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function lu(t){const e=[];for(let n=t;n!==null;n=n._parentEditor)e.push(n);return e}function gg(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function pg(t){return qt(t)?t.nodeValue:null}function au(t,e,n){const r=ct(gt(e));if(r===null)return;const o=pt(r,e._rootElement),i=o.anchorNode;let{anchorOffset:s,focusOffset:l}=o;if(i!==null){let a=pg(i);const u=hr(i);if(a!==null&&O(u)){if((a===Oo||a===la)&&n){const c=n.length;a=n,s=c,l=c}a!==null&&uu(u,a,s,l,t)}}}function uu(t,e,n,r,o){let i=t;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();if(i.isToken()&&s)return;let l=e;if((s||o)&&(e.endsWith(Oo)&&(l=e.slice(0,-Oo.length)),o)){const u=la;let c;for(;(c=l.indexOf(u))!==-1;)l=l.slice(0,c)+l.slice(c+u.length),n!==null&&n>c&&(n=Math.max(c,n-u.length)),r!==null&&r>c&&(r=Math.max(c,r-u.length))}const a=i.getTextContent();if(o||l!==a){const u=z();if(l===""){if(Xe(null),Io||un||Fo)i.remove();else{const b=ge();cu(i,"",u),setTimeout(()=>{b.update(()=>{i.isAttached()&&i.getTextContent()===""&&i.remove()})},20)}return}const c=i.getParent(),d=Yr(),f=i.getTextContentSize(),h=Yt(),g=i.getKey();if(i.isToken()&&!s||h!==null&&g===h&&!s||A(d)&&(c!==null&&!c.canInsertTextBefore()&&d.anchor.offset===0||d.anchor.key===t.__key&&d.anchor.offset===0&&!i.canInsertTextBefore()&&!s||d.focus.key===t.__key&&d.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();if(!A(u)||n===null||r===null)return void cu(i,l,u);if(u.setTextNodeRange(i,n,i,r),i.isSegmented()){const b=He(i.getTextContent());i.replace(b),i=b}cu(i,l,u)}}}function cu(t,e,n){if(t.setTextContent(e),A(n)){const r=t.getKey();let o=!1;for(const i of["anchor","focus"]){const s=n[i];s.type==="text"&&s.key===r&&(s.offset=Xt(t,s.offset,"clamp"),o=!0)}o&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function mg(t){let e=t;for(;e!==null;){const n=e.getParent();if(n===null)return null;if(Ie(n))return e;e=n}return null}function Ms(t,e){const{anchor:n,focus:r}=t,o=n.key,i=n.offset,s=n.type,l=r.key,a=r.offset,u=r.type;if(Br(t),!Ie(e))return t;const c=mg(n.getNode());return P(c)&&c.isShadowRoot()&&c.is(mg(r.getNode()))&&(n.set(o,i,s),r.set(l,a,u)),t}function OS(t){const e=we();if(A(t)){const n=t.anchor,r=t.focus,o=n.getNode();if(Ie(o))return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Ms(t,o),t;const i=o.getTopLevelElementOrThrow(),s=i.getParent();return s===null?(P(i)&&(n.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),Ms(t,i)),t):(n.set(s.getKey(),0,"element"),r.set(s.getKey(),s.getChildrenSize(),"element"),Ms(t,s),t)}{const n=e.select(0,e.getChildrenSize());return ze(Ms(n,e)),n}}function ai(t,e){t.getAttribute(e)===""&&t.removeAttribute(e)}function no(t,e){t.__lexicalClassNameCache===void 0&&(t.__lexicalClassNameCache={});const n=t.__lexicalClassNameCache,r=n[e];if(r!==void 0)return r;const o=t[e];if(typeof o=="string"){const i=Qt(o);return n[e]=i,i}return o}function du(t,e,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,l=e.get(i);l===void 0&&L(33,i);const a=l.klass;let u=t.get(a);u===void 0&&(u=new Map,t.set(a,u));const c=u.get(s),d=c==="destroyed"&&o==="created";(c===void 0||d)&&u.set(s,d?"updated":o)}function yg(t,e,n){const r=t.getParent();let o=n,i=t;return r!==null&&(n===0&&(o=i.getIndexWithinParent(),i=r)),i.getChildAtIndex(o-1)}function KS(t,e){const n=t.offset;if(t.type==="element")return yg(t.getNode(),e,n);{const r=t.getNode();if(n===0||!e){const o=r.getPreviousSibling();return o===null?yg(r.getParentOrThrow(),e,r.getIndexWithinParent()+0):o}}return null}function bg(t){const e=gt(t).event,n=e&&e.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function ee(t,e,...n){return Zh(t,e,n[0],t)}function ro(t,e){const n=t._keyToDOMMap.get(e);return n===void 0&&L(75,e),n}function gr(t){const e=t.assignedSlot||t.parentElement;if(e!==null)return e;const n=t.parentNode;return _n(n)?n.host:null}function fu(t){return dr(t)?t:fe(t)?t.ownerDocument:null}function pr(t){je(),ge()._updateTags.add(t)}function NS(t){je(),ge()._deferred.push(t)}function oo(t,e){let n=t.getParent();for(;n!==null;){if(n.is(e))return!0;n=n.getParent()}return!1}function hu(t){const e=fu(t);return e?e.defaultView:null}function gt(t){const e=t._window;return e===null&&L(78),e}function RS(t){return P(t)&&t.isInline()||oe(t)&&t.isInline()}function vg(t){let e=t.getLatest();for(;e!==null;){if(tt(e)!==null&&P(e))return e;const n=e.getParentOrThrow();if(be(n))return n;e=n}return e}function ui(t){return P(t)&&t.isShadowRoot()}function be(t){return Ie(t)||ui(t)}function Qe(t,e=!1){const n=t.constructor.clone(t,ou);return lg(n,null),n.afterCloneFrom(t),e||n.resetOnCopyNodeFrom(t),n}function Bt(t){const e=ge(),n=t.getType(),r=iu(e,n);r===void 0&&L(200,t.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(t),l=s.constructor;return i!==null?s instanceof i||L(201,i.name,i.getType(),l.name,l.getType(),t.constructor.name,n):s instanceof t.constructor&&l!==t.constructor||L(202,l.name,l.getType(),t.constructor.name,n),s.__key===t.__key&&L(203,t.constructor.name,n,l.name,l.getType()),s}return t}function gu(t,e){!Ie(t.getParent())||P(e)||oe(e)||L(99)}function BS(t){const e=Te(t);return e===null&&L(63,t),e}function ci(t){if(!t||t.isInline())return!1;if(oe(t))return!0;if(P(t)){if(t.isShadowRoot()){const e=t.getParent();return!(P(e)&&e.isShadowRoot())}return!t.canBeEmpty()}return!1}function As(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=t.parentElement;r!==null&&r.removeChild(t)}function ct(t){return it?(t||window).getSelection():null}function zS(t){const e=hu(t);return e?e.getSelection():null}function _n(t){return pu(t)&&"host"in t}const VS=[];function xg(t){const e=t.getRootNode();if(e===t||!_n(e))return VS;const n=[e];let r=e.host;for(;;){const o=r.getRootNode();if(o===r||!_n(o))break;n.push(o),r=o.host}return n}function*_g(t){const e=[t];let n;for(;n=e.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');const r=(dr(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);let o;for(;o=r.nextNode();)o.shadowRoot&&e.push(o.shadowRoot)}}function Sg(t){return t!==null?t.ownerDocument:document}function Ce(){const t=Hh();return Sg(t!==null?t._rootElement:null)}function Ls(t,e){if(e===null||typeof t.getComposedRanges!="function")return null;const n=xg(e);if(n.length===0)return null;const r=t.getComposedRanges;try{const o=r.call(t,{shadowRoots:n})[0];if(o!==void 0)return o}catch{}try{const o=r.apply(t,n)[0];if(o!==void 0)return o}catch{}return null}function US(t,e){const n=Ls(t,e);if(n!==null){const r=HS(n);if(r!==null)return r}return t.rangeCount>0?t.getRangeAt(0):null}function pt(t,e){const n=Ls(t,e);return n===null?t:jS(n,GS(t))}function HS(t){const e=t.startContainer.ownerDocument;if(e===null)return null;const n=e.createRange();try{return n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset),n}catch{return null}}function jS(t,e){const{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t;return e==="backward"?{anchorNode:o,anchorOffset:i,direction:e,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:e,focusNode:o,focusOffset:i}}function GS(t){return t.direction}function Is(t){const e=t.getRootNode();return dr(e)||_n(e)?e.activeElement:null}function io(t){let e=t.activeElement;for(;e!==null&&e.shadowRoot!==null;){const n=e.shadowRoot.activeElement;if(n===null)break;e=n}return e}function Cg(t){const e=t.target;if(e!==null&&fe(e)&&e.shadowRoot!==null&&typeof t.composedPath=="function"){const n=t.composedPath();if(n.length>0)return n[0]}return e}function Eg(t){return fe(t)&&t.tagName==="A"}function fe(t){return so(t)&&t.nodeType===1}function so(t){return typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeType=="number"}function pu(t){return so(t)&&t.nodeType===11}const qS=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function mu(t){return!(!fe(t)||!t.style.display.startsWith("inline"))||qS.test(t.nodeName)}const YS=/^(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;function di(t){return(!fe(t)||!t.style.display.startsWith("inline"))&&YS.test(t.nodeName)}function Ge(t){if(oe(t)&&!t.isInline())return!0;if(!P(t)||be(t))return!1;const e=t.getFirstChild(),n=e===null||Ze(e)||O(e)||e.isInline();return!t.isInline()&&t.canBeEmpty()!==!1&&n}function Ke(){return ge()}function Fs(t=Ke()){return t._config.dom||Ts}function vt(t,e,n=Ke()){const r=Fs(n).$getDOMSlot(t,e,n);return P(t)&&(ZS(r)||L(344,t.getKey(),t.getType())),r}function ZS(t){return t instanceof Vd}function In(t,e,n=Ke()){return FS(vt(t,e,n).element)}const wg=new WeakMap,XS=new Map;function kg(t){if(!t._readOnly&&t.isEmpty())return XS;t._readOnly||L(192);let e=wg.get(t);return e||(e=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let l=r.get(s);l||(l=new Map,r.set(s,l)),l.set(o,i)}return r})(t),wg.set(t,e)),e}function Tg(t){const e=t.constructor.clone(t,ou);return e.afterCloneFrom(t),e}function QS(t){return(e=Tg(t))[ih]=!0,e;var e}function yu(t,e){const n=t.getAttribute("data-lexical-indent");if(n!==null){const i=parseInt(n,10);if(Number.isFinite(i)&&i>=0)return void e.setIndent(i)}const r=parseInt(t.style.paddingInlineStart,10)||0,o=Math.round(r/40);e.setIndent(o)}function fi(t,e){const n=e.getAttribute("dir");return n==="ltr"||n==="rtl"?t.setDirection(n):t}function Os(t,e){const n=e.style.textAlign;return n&&n in ji?t.setFormat(n):t}function WS(t,e){t.__lexicalUnmanaged=!0,e&&e.captureSelection!==void 0&&(t.__lexicalCapturedSelection=e.captureSelection)}function Pg(t){return t.__lexicalUnmanaged===!0}function JS(t,e=Ke()){const n=e.isEditable();t.contentEditable=n?"true":"false",n?t.__lexicalEditor=e:delete t.__lexicalEditor}function Ks(t,e){let n=t;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(fe(n)&&n.hasAttribute("data-lexical-slot")||eo(n,e)!==void 0)return!1;n=gr(n)}return!1}function hi(t,e){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(t,e)&&t[e]!==ft[e]}const $g=new WeakMap,Dg=Symbol("lexical.synthesizedGetType");function bu(t){const e=$g.get(t);if(e)return e;const n=t.prototype!=null&&Nd in t.prototype?t.prototype[Nd]():void 0,r=(function(u){if(!(u===ft||u.prototype instanceof ft)){let c="<unknown>",d="<unknown>";try{c=u.getType()}catch{}try{Qr.version&&(d=JSON.parse(Qr.version))}catch{}L(290,u.name,c,d)}return u===Ya||u===Be||u===ft})(t),o=!r&&hi(t,"getType")?t.getType:void 0,i=o&&!(Dg in o)?o.call(t):void 0;let s,l=i;if(n)if(i)s=n[i];else{for(const[u,c]of Object.entries(n))l=u,s=c;if(!s)for(const u of Object.getOwnPropertySymbols(n)){const c=n[u];if(c){s=c;break}}}if(!r&&l){if(!hi(t,"getType")){const u=t,c=function(){return this!==u?ft.getType.call(this):l};c[Dg]=!0,t.getType=c}if(hi(t,"clone")||(t.clone=(u,c)=>{ru(u);const d=new t;return c!==ou&&d.afterCloneFrom(u),d}),hi(t,"importJSON")||(t.importJSON=s&&s.$importJSON||(u=>xu(t).updateFromJSON(u))),!hi(t,"importDOM")&&s){const{importDOM:u}=s;u&&(t.importDOM=()=>u)}}const a={klass:t,ownNodeConfig:s,ownNodeType:l};return $g.set(t,a),a}function*vu(t){for(let e=t;e&&(e===ft||lh(e.prototype));){const n=bu(e);yield n,e=n.ownNodeConfig&&n.ownNodeConfig.extends||Mg(e)}}function xu(t){const e=Ke();je();const n=e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(t)),r=new n.klass;return n.replace===null?r:Bt(r)}const ke=(t,e)=>{let n=t;for(;n!=null&&!Ie(n);){if(e(n))return n;n=n.getParent()}return null};function Ns(t,e){const n=[];let r=t.__first;for(;r!==null;){const o=e===null?Te(r):e.get(r);o==null&&L(174),n.push(r),r=o.__next}return n}function Mg(t){const e=Object.getPrototypeOf(t);if(typeof e=="function"&&e!==Function.prototype)return e;const n=t.prototype&&Object.getPrototypeOf(t.prototype);return n?n.constructor:null}const Ag=new Map;function mr(t){return P(t)||oe(t)}function yr(t){return P(t)||oe(t)}function tt(t){const e=t.getLatest();return yr(e)?e.__slotHost:null}function nt(t){const e=tt(t);if(e===null)return null;const n=Te(e);return P(n)||oe(n)||L(370),n}function eC(t){const e=nt(t);if(e===null)return null;const n=t.getLatest().__key;for(const[r,o]of Rs(e))if(o===n)return r;return null}function gi(t){let e=t.getLatest();for(;e!==null;){if(tt(e)!==null)return e;e=e.getParent()}return null}function Lg(t){if(t===null)return null;const e=A(t)?t.anchor.getNode():t.getNodes()[0]??null;return e===null?null:gi(e)}function Rs(t){const e=t.getLatest();return mr(e)&&e.__slots!==null?e.__slots:Ag}function Zt(t){return Array.from(Rs(t).keys())}function lo(t,e){const n=Rs(t).get(e);return n===void 0?null:Te(n)}const tC=["__proto__","constructor","prototype"],Ig=Symbol("slotMapOwner");function Fg(t){let e=t.__slots;return e!==null&&e[Ig]===t||(e=new Map(e),e[Ig]=t,t.__slots=e),e}const Og=new WeakMap,nC=[];function rC(t){for(const{ownNodeConfig:e}of vu(t)){const n=e&&e.slots;if(n)return n}return nC}function Kg(t){let e="";for(const n of Zt(t)){const r=lo(t,n);r!==null&&(e+=r.getTextContent())}return e}function Ng(t,e,n){const r=n.get(t),o=n.get(e);return r!==void 0?o!==void 0?r-o:-1:o!==void 0?1:t<e?-1:t>e?1:0}function oC(t){const e=t.__slots;if(e===null||e.size<2)return;const n=(function(s){let l=Og.get(s);if(l===void 0){const a=rC(s),u=new Map;for(const c of a)tC.includes(c)&&L(371,s.name,c),u.has(c)&&L(372,s.name,c),u.set(c,u.size);l=u,Og.set(s,l)}return l})(t.constructor);let r=null,o=!0;for(const s of e.keys()){if(r!==null&&Ng(r,s,n)>0){o=!1;break}r=s}if(o)return;const i=Array.from(e).sort(([s],[l])=>Ng(s,l,n));e.clear();for(const[s,l]of i)e.set(s,l)}function iC(t,e,n){e!=="__proto__"&&e!=="constructor"&&e!=="prototype"||L(373,e);const r=t.getLatest();if(r.__slots!==null&&r.__slots.get(e)===n.getLatest().__key)return r;(!P(n)&&!oe(n)||n.isInline())&&L(374,n.__key);const o=t.getWritable(),i=Fg(o),s=i.get(e);s!==void 0&&sC(s);const l=n.getWritable(),a=nt(l);if(a!==null){const u=eC(l);u!==null&&Fg(a.getWritable()).delete(u),l.__slotHost=null}return xn(l),l.__slotHost=o.__key,i.set(e,l.__key),oC(o),ge()._slotsUsed=!0,Rt()._slotsUsed=!0,o}function f3(t,e){}function sC(t){const e=Te(t);if(e===null)return;const n=e.getWritable();yr(n)||L(377,t),n.__slotHost=null,n.remove()}const lC={next:"previous",previous:"next"};class _u{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Bg({hasNext:Cn,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ye(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ye(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,n){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,n)),this}splice(e,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),l=new Map;for(let a=i.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){const u=a.origin.getWritable();l.set(u.getKey(),u)}for(const a of o){if(l.size>0){const u=i.getNodeAtCaret();if(u){if(l.delete(u.getKey()),l.delete(a.getKey()),!(u.is(a)||i.origin.is(a))){const c=a.getParent();c&&c.is(s)&&a.remove(),u.replace(a)}}else u===null&&L(263,Array.from(l).join(" "))}else i.insert(a);i=ye(a,this.direction)}for(const a of l.values())a.remove();return this}}class pi extends _u{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:rt(e,this.direction)}getParentCaret(e="root"){return ye(Su(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Sn(this.direction);return ye(this.getNodeAtCaret(),e)||rt(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof pi&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const aC={root:Ie,shadowRoot:be};function Sn(t){return lC[t]}function Su(t,e="root"){return t===null||aC[e](t)?null:tt(t)===null?t:null}class br extends _u{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ye(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return P(this.origin)?rt(this.origin,this.direction):null}getParentCaret(e="root"){return ye(Su(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Sn(this.direction);return ye(this.getNodeAtCaret(),e)||rt(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof br&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof br||e instanceof vr)&&this.direction===e.direction&&this.origin.is(e.origin)}}class vr extends _u{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Fn(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ye(Su(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Fn(this.origin,Sn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof vr&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof br||e instanceof vr)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ye(this.origin,this.direction)}}function kt(t){return t instanceof vr}function Cn(t){return t instanceof br}function Tt(t){return t instanceof pi}const uC={next:class extends vr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends vr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},cC={next:class extends br{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends br{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},dC={next:class extends pi{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends pi{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function ye(t,e){return t?new cC[e](t):null}function Fn(t,e,n){return t?new uC[e](t,Xt(t,n)):null}function Xt(t,e,n="error"){const r=t.getTextContentSize();let o=e==="next"?r:e==="previous"?0:e;return(o<0||o>r)&&(n!=="clamp"&&Ld(284,String(e),String(r),t.getKey()),o=o<0?0:r),o}function Rg(t,e){return new hC(t,e)}function rt(t,e){return P(t)?new dC[e](t):null}function fC(t){return t&&t.getChildCaret()||t}function Cu(t){return t&&fC(t.getAdjacentCaret())}class Eu{type="node-caret-range";direction;anchor;focus;constructor(e,n,r){this.anchor=e,this.focus=n,this.direction=r}getLatest(){const e=this.anchor.getLatest(),n=this.focus.getLatest();return e===this.anchor&&n===this.focus?this:new Eu(e,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=o=>{const i=this[o].getLatest();return kt(i)?(function(s,l){const{direction:a,origin:u}=s,c=Xt(u,l==="focus"?Sn(a):a);return Rg(s,c-s.offset)})(i,o):null},n=e("anchor"),r=e("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[Rg(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(e="root"){const n=kt(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=kt(r),i=s=>s.isSameNodeCaret(r)?null:Cu(s)||s.getParentCaret(e);return Bg({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class hC{type="slice";caret;distance;constructor(e,n){this.caret=e,this.distance=n}getSliceIndices(){const{distance:e,caret:{offset:n}}=this,r=n+e;return r<n?[r,n]:[n,r]}getTextContent(){const[e,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:n}}=this,[r,o]=this.getSliceIndices(),i=e.getTextContent();return Fn(e.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function zt(t,e){return t.direction===e?t:t.getFlipped()}function Bs(t){return Pt(t,zt(rt(we(),Sn(t.direction)),t.direction))}function zs(t){return Pt(t,t)}function Pt(t,e){return t.direction!==e.direction&&L(265),new Eu(t,e,t.direction)}function Bg(t){const{initial:e,hasNext:n,step:r,map:o}=t;let i=e;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function On(t,e){const n=wu(t.origin,e.origin);switch(n===null&&L(275,t.origin.getKey(),e.origin.getKey()),n.type){case"same":{const r=t.type==="text",o=e.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(t.offset,e.offset):t.type===e.type?0:r?-1:o?1:t.type==="child"?-1:1}case"ancestor":return t.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return zg(n)}}function zg(t){const{a:e,b:n}=t,r=e.__key,o=n.__key;let i=e,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function Vs(t,e){return e.is(t)}function Vg(t){return P(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function wu(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};const n=new Map;for(let[r,o]=Vg(t);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=Vg(e);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(Vs(t,r)||L(276),{commonAncestor:r,type:"ancestor"}):o===null?(Vs(e,r)||L(277),{commonAncestor:r,type:"descendant"}):((P(i)||Vs(t,i))&&(P(o)||Vs(e,o))&&r.is(i.getParent())&&r.is(o.getParent())||L(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function gC(t,e){if(!e||t===e)return t;for(const n in e)if(t[n]!==e[n])return{...t,...e};return t}function Qt(...t){const e=[];for(const n of t)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))e.push(r);return e}function Wt(t,...e){const n=Qt(...e);n.length>0&&t.classList.add(...n)}function ku(t,...e){const n=Qt(...e);n.length>0&&t.classList.remove(...n)}function xt(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}const Ug=m.createContext(null);function pC(t,e){return{getTheme:function(){return e??null}}}function Vt(){const t=m.useContext(Ug);return t==null&&(function(e,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),t}const mC=it?m.useLayoutEffect:m.useEffect,Us={tag:Gr};function yC({initialConfig:t,children:e}){const n=m.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,onWarn:l,editorState:a,html:u}=t,c=pC(null,r),d=og({editable:t.editable,html:u,namespace:o,nodes:i,onError:f=>s(f,d),...l?{onWarn:f=>l(f,d)}:{},theme:r});return(function(f,h){if(h!==null){if(h===void 0)f.update(()=>{const g=we();if(g.isEmpty()){const b=Se();g.append(b);const p=f.getRootElement(),y=it&&p!==null?Is(p):null;(z()!==null||y!==null&&y===p)&&b.select()}},Us);else if(h!==null)switch(typeof h){case"string":{const g=f.parseEditorState(h);f.setEditorState(g,Us);break}case"object":f.setEditorState(h,Us);break;case"function":f.update(()=>{we().isEmpty()&&h(f)},Us)}}})(d,a),[d,c]},[]);return mC(()=>{const r=t.editable,[o]=n;o.setEditable(r===void 0||r)},[]),R.jsx(Ug.Provider,{value:n,children:e})}function bC(){return we().getTextContent()}function vC(t,e=!0){if(t)return!1;let n=bC();return e&&(n=n.trim()),n===""}function xC(t){if(!vC(t,!1))return!1;const e=we().getChildren(),n=e.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=e[r];if(oe(o))return!1;if(P(o)){if(!Xr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let l=0;l<s;l++){const a=i[l];if(!O(a))return!1}}}return!0}function Hg(t){return()=>xC(t)}const Tu=it?m.useLayoutEffect:m.useEffect;function _C({editor:t,ariaActiveDescendant:e,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:u,ariaMultiline:c,ariaOwns:d,ariaRequired:f,autoCapitalize:h,className:g,id:b,role:p="textbox",spellCheck:y=!0,style:v,tabIndex:x,"data-testid":_,...C},T){const[k,S]=m.useState(t.isEditable()),w=m.useCallback(M=>{M&&M.ownerDocument&&M.ownerDocument.defaultView?t.setRootElement(M):t.setRootElement(null)},[t]),D=m.useMemo(()=>(function(...M){return B=>{for(const V of M)typeof V=="function"?V(B):V!=null&&(V.current=B)}})(T,w),[w,T]);return Tu(()=>(S(t.isEditable()),t.registerEditableListener(M=>{S(M)})),[t]),R.jsx("div",{"aria-activedescendant":k?e:void 0,"aria-autocomplete":k?n:"none","aria-controls":k?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":k&&p==="combobox"?!!s:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":u,"aria-multiline":c,"aria-owns":k?d:void 0,"aria-readonly":!k||void 0,"aria-required":f,autoCapitalize:h,className:g,contentEditable:k,"data-testid":_,id:b,ref:D,role:p,spellCheck:y,style:v,tabIndex:x??(k?void 0:-1),...C})}const SC=m.forwardRef(_C);function jg(t){return t.read("latest",Hg(t.isComposing()))}const CC=m.forwardRef(EC);function EC(t,e){const{placeholder:n,...r}=t,[o]=Vt();return R.jsxs(R.Fragment,{children:[R.jsx(SC,{editor:o,...r,ref:e}),n!=null&&R.jsx(wC,{editor:o,content:n})]})}function wC({content:t,editor:e}){const n=(function(s){const[l,a]=m.useState(()=>jg(s));return Tu(()=>{function u(){const c=jg(s);a(c)}return u(),xt(s.registerUpdateListener(()=>{u()}),s.registerEditableListener(()=>{u()}))},[s]),l})(e),[r,o]=m.useState(e.isEditable());if(Tu(()=>(o(e.isEditable()),e.registerEditableListener(s=>{o(s)})),[e]),!n)return null;let i=null;return typeof t=="function"?i=t(r):t!==null&&(i=t),i===null?null:R.jsx("div",{"aria-hidden":!0,children:i})}function Gg(t){const e=Ke().getElementByKey(t.getKey());if(e===null)return null;const n=e.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(e)}function qg(t){const e=Ie(t)?t:t.getParent();return e&&Gg(e)}function Hs(t){const e=qg(t);return e!==null&&e.direction==="rtl"}function Yg(t,e,n="self"){const r=t.getStartEndPoints();if(e.isSelected(t)&&!wt(e)&&r!==null){const[o,i]=r,s=t.isBackward(),l=o.getNode(),a=i.getNode(),u=e.is(l),c=e.is(a);if(u||c){const[d,f]=Ra(t),h=l.is(a),g=e.is(s?a:l),b=e.is(s?l:a);let p,y=0;h?(y=d>f?f:d,p=d>f?d:f):g?(y=s?f:d,p=void 0):b&&(y=0,p=s?d:f);const v=e.__text.slice(y,p);v!==e.__text&&(n==="clone"&&(e=QS(e)),e.__text=v)}}return e}function kC(t,e){const n=t.getFormatType(),r=t.getIndent();n!==e.getFormatType()&&e.setFormat(n),r!==e.getIndent()&&e.setIndent(r)}function TC(t,e,n){let r=ut(t,n);if(Ja(r))return!1;for(;r;r=r.getParentCaret()){const o=r.getParentAtCaret();if(!o||r.getNodeAtCaret())return!1;if(e.is(o))return!0}return!1}function PC(t,e,n=kC){if(!t)return;const r=t.getStartEndPoints();let o=!1,i=null;const s=new Map;if(r){const[l,a]=r,u=ke(l.getNode(),Ge);i=ke(a.getNode(),Ge);const c=t.isBackward()?"previous":"next";o=P(i)&&!i.is(u)&&(function(d,f,h){const g=d.getNode();return(!P(g)||!g.isEmpty())&&TC(d,f,h)})(a,i,Sn(c)),P(u)&&s.set(u.getKey(),u),P(i)&&!o&&s.set(i.getKey(),i)}for(const l of t.getNodes())if(P(l)&&Ge(l)){if(o&&l.is(i))continue;s.set(l.getKey(),l)}else if(!r){const a=ke(l,Ge);P(a)&&s.set(a.getKey(),a)}for(const l of s.values()){if(nt(l)!==null)continue;const a=e();n(l,a),l.replace(a,!0)}}function Zg(t){const e=Xg(t);return e!==null&&e.writingMode==="vertical-rl"}function Xg(t){const e=t.anchor.getNode();return P(e)?Gg(e):qg(e)}function Qg(t,e){let n=Zg(t)?!e:e;Wg(t)&&(n=!n);const r=ut(t.focus,n?"previous":"next");if(Ja(r))return!1;if(kt(r)&&!ir(r.origin)&&r.origin.isUnmergeable()){const o=r.getNodeAtCaret();if(O(o)&&!ir(o))return!0}for(const o of Bs(r)){if(Tt(o))return!o.origin.isInline();if(!P(o.origin)){if(oe(o.origin))return!0;break}}return!1}function $C(t,e,n,r){t.modify(e?"extend":"move",n,r)}function Wg(t){const e=Xg(t);return e!==null&&e.direction==="rtl"}function Jg(t,e,n){const r=Wg(t);let o;o=Zg(t)||r?!n:n,$C(t,e,o,"character")}function DC(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Pu(t,e){let n=t;for(;n!=null;){if(n instanceof e)return n;n=n.getParent()}return null}function MC(t){const e=ke(t,n=>P(n)&&!n.isInline());return P(e)||DC(4,t.__key),e}function En(t,e){if(t==null)return!1;const n=Object.getPrototypeOf(t);return n!=null&&n.constructor!=null&&n.constructor.name===e.name}function js(t){let e=null;if(En(t,DragEvent)?e=t.dataTransfer:En(t,ClipboardEvent)&&(e=t.clipboardData),e===null)return[!1,[],!1];const n=e.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),o]}function ep(t){const e=z();if(!A(e))return!1;const n=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const l=ke(i,u=>P(u)&&!u.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!n.has(a)&&(n.add(a),t(l))}return n.size>0}const AC=Symbol.for("preact-signals");function $u(){if(xr>1)return void xr--;let t,e=!1;for(!(function(){let n=Gs;for(Gs=void 0;n!==void 0;)n.S.v===n.v&&(n.S.i=n.i),n=n.o})();mi!==void 0;){let n=mi;for(mi=void 0,qs++;n!==void 0;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&op(n))try{n.c()}catch(o){e||(t=o,e=!0)}n=r}}if(qs=0,xr--,e)throw t}let xe,mi;function tp(t){const e=xe;xe=void 0;try{return t()}finally{xe=e}}let Gs,xr=0,qs=0,np=0,Ys=0;function rp(t){if(xe===void 0)return;let e=t.n;return e===void 0||e.t!==xe?(e={i:0,S:t,p:xe.s,n:void 0,t:xe,e:void 0,x:void 0,r:e},xe.s!==void 0&&(xe.s.n=e),xe.s=e,t.n=e,32&xe.f&&t.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=xe.s,e.n=void 0,xe.s.n=e,xe.s=e),e):void 0}function dt(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Zs(t,e){return new dt(t,e)}function op(t){for(let e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function ip(t){for(let e=t.s;e!==void 0;e=e.n){const n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function sp(t){let e,n=t.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):e=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}t.s=e}function ao(t,e){dt.call(this,void 0),this.x=t,this.s=void 0,this.g=Ys-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function lp(t){const e=t.m;if(t.m=void 0,typeof e=="function"){xr++;const n=xe;xe=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,Du(t),r}finally{xe=n,$u()}}}function Du(t){for(let e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,lp(t)}function LC(t){if(xe!==this)throw new Error("Out-of-order effect");sp(this),xe=t,this.f&=-2,8&this.f&&Du(this),$u()}function uo(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e?.name}function Mu(t,e){const n=new uo(t,e);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}function IC(t,e={}){const n={};for(const r in t){const o=e[r],i=Zs(o===void 0?t[r]:o);n[r]=i}return n}dt.prototype.brand=AC,dt.prototype.h=function(){return!0},dt.prototype.S=function(t){const e=this.t;e!==t&&t.e===void 0&&(t.x=e,this.t=t,e!==void 0?e.e=t:tp(()=>{var n;(n=this.W)==null||n.call(this)}))},dt.prototype.U=function(t){if(this.t!==void 0){const e=t.e,n=t.x;e!==void 0&&(e.x=n,t.e=void 0),n!==void 0&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n,n===void 0&&tp(()=>{var r;(r=this.Z)==null||r.call(this)}))}},dt.prototype.subscribe=function(t){return Mu(()=>{const e=this.value,n=xe;xe=void 0;try{t(e)}finally{xe=n}},{name:"sub"})},dt.prototype.valueOf=function(){return this.value},dt.prototype.toString=function(){return this.value+""},dt.prototype.toJSON=function(){return this.value},dt.prototype.peek=function(){const t=xe;xe=void 0;try{return this.value}finally{xe=t}},Object.defineProperty(dt.prototype,"value",{get(){const t=rp(this);return t!==void 0&&(t.i=this.i),this.v},set(t){if(t!==this.v){if(qs>100)throw new Error("Cycle detected");(function(e){xr!==0&&qs===0&&e.l!==np&&(e.l=np,Gs={S:e,v:e.v,i:e.i,o:Gs})})(this),this.v=t,this.i++,Ys++,xr++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{$u()}}}}),ao.prototype=new dt,ao.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ys))return!0;if(this.g=Ys,this.f|=1,this.i>0&&!op(this))return this.f&=-2,!0;const t=xe;try{ip(this),xe=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return xe=t,sp(this),this.f&=-2,!0},ao.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}dt.prototype.S.call(this,t)},ao.prototype.U=function(t){if(this.t!==void 0&&(dt.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},ao.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(ao.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const t=rp(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),uo.prototype.c=function(){const t=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}},uo.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,lp(this),ip(this),xr++;const t=xe;return xe=this,LC.bind(this,t)},uo.prototype.N=function(){2&this.f||(this.f|=2,this.u=mi,mi=this)},uo.prototype.d=function(){this.f|=8,1&this.f||Du(this)},uo.prototype.dispose=function(){this.d()};function FC(t){return(typeof t.nodes=="function"?t.nodes():t.nodes)||[]}function OC(t,e){let n;return Zs(t(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=t(),n=e(this)}})}function Pe(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let ap;try{ap="0.50.0+prod.esm"}catch{}const KC=ap??'"<unknown>+source"',NC=new Set(["__proto__","constructor","prototype"]);function up(t,e){if(t&&e&&!Array.isArray(e)&&typeof t=="object"&&typeof e=="object"){const n=t,r=e;for(const o in r)!NC.has(o)&&Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=up(n[o],r[o]));return t}return e}const Au=0,Lu=1,cp=2,Iu=3,Xs=4,co=5,Fu=6,yi=7;function Ou(t){return t.id===Au}function dp(t){return t.id===cp}function RC(t){return(function(e){return e.id===Lu})(t)||Pe(305,String(t.id),String(Lu)),Object.assign(t,{id:cp})}const BC=new Set;class zC{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,n){this.builder=e,this.extension=n,this.configs=new Set,this.state={id:Au}}mergeConfigs(){let e=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):gC;for(const r of this.configs)e=n(e,r);return e}init(e){const n=this.state;dp(n)||Pe(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(l,a,u){return Object.assign(l,{config:a,id:Iu,registerState:u})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(e,i.config,r)),this.state=(function(l,a,u){return Object.assign(l,{id:Xs,initResult:a,registerState:u})})(i,s,o)}build(e){const n=this.state;let r;n.id!==Xs&&Pe(307,String(n.id),String(co)),this.extension.build&&(r=this.extension.build(e,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,l){return Object.assign(i,{id:co,output:s,registerState:l})})(n,r,o)}register(e,n){this._signal=n;const r=this.state;r.id!==co&&Pe(308,String(r.id),String(co));const o=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:Fu})})(r),()=>{const i=this.state;i.id!==yi&&Pe(309,String(r.id),String(yi)),this.state=(function(s){return Object.assign(s,{id:co})})(i),o&&o()}}afterRegistration(e){const n=this.state;let r;return n.id!==Fu&&Pe(310,String(n.id),String(Fu)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:yi})})(n),r}getSignal(){return this._signal===void 0&&Pe(311),this._signal}getInitResult(){this.extension.init===void 0&&Pe(312,this.extension.name);const e=this.state;return(function(n){return n.id>=Xs})(e)||Pe(313,String(e.id),String(Xs)),e.initResult}getInitPeer(e){const n=this.builder.extensionNameMap.get(e);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(n){return n.id>=Iu})(e)||Pe(314,String(e.id),String(Iu)),{config:e.config}}getPeer(e){const n=this.builder.extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}getInitDependency(e){const n=this.builder.getExtensionRep(e);return n===void 0&&Pe(315,this.extension.name,e.name),n.getExtensionInitDependency()}getDependency(e){const n=this.builder.getExtensionRep(e);return n===void 0&&Pe(315,this.extension.name,e.name),n.getExtensionDependency()}getState(){const e=this.state;return(function(n){return n.id>=yi})(e)||Pe(316,String(e.id),String(yi)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||BC}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(n){return n.id>=co})(e)||Pe(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}const fp={tag:Gr};function VC(){const t=we();t.isEmpty()&&t.append(Se())}const UC={config:{setOptions:fp,updateOptions:fp},init:({$initialEditorState:t=VC})=>({$initialEditorState:t,initialized:!1}),afterRegistration(t,{updateOptions:e,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(_S(i))t.setEditorState(i,n);else if(typeof i=="function")t.update(()=>{i(t)},e);else if(i&&(typeof i=="string"||typeof i=="object")){const s=t.parseEditorState(i);t.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[xs,mn,_s,us,ws]},hp=Symbol.for("@lexical/extension/LexicalBuilder");function gp(){}function HC(t){throw t}function Qs(t){return Array.isArray(t)?t:[t]}const Ku=KC;let pp=class sa{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Ku,this.roots=e;for(const n of e)this.addExtension(n)}static fromExtensions(e){const n=[Qs(UC)];for(const r of e)n.push(Qs(r));return new sa(n)}static maybeFromEditor(e){const n=e[hp];return n&&(n.PACKAGE_VERSION!==Ku&&Pe(292,n.PACKAGE_VERSION,Ku),n instanceof sa||Pe(293)),n}static fromEditor(e){const n=sa.maybeFromEditor(e);return n===void 0&&Pe(294),n}constructEditor(){const{$initialEditorState:e,onError:n,onWarn:r,...o}=this.buildCreateEditorArgs(),i=Object.assign(og({...o,...n?{onError:s=>{n(s,i)}}:{},...r?{onWarn:s=>{r(s,i)}}:{}}),{[hp]:this});for(const s of this.sortedExtensionReps())s.build(i);return i}buildEditor(){let e=gp;function n(){try{e()}finally{e=gp}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return e=xt(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const n=this.extensionNameMap.get(e.name);if(n)return n.extension!==e&&Pe(295,e.name),n}addEdge(e,n,r){const o=this.outgoingConfigEdges.get(e);if(o){const s=o.get(n);s?s.push(...r):o.set(n,r)}else this.outgoingConfigEdges.set(e,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(e):this.incomingEdges.set(n,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Pe(296);const n=Qs(e),[r]=n;typeof r.name!="string"&&Pe(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Pe(298,r.name),!o){o=new zC(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Pe(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Pe(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const l=Qs(s);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(const[s,l]of r.peerDependencies||[])this.addEdge(r.name,s,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],n=(r,o)=>{let i=r.state;if(dp(i))return;const s=r.extension.name;var l;Ou(i)||Pe(300,s,o||"[unknown]"),Ou(l=i)||Pe(304,String(l.id),String(Au)),i=Object.assign(l,{id:Lu}),r.state=i;const a=this.outgoingConfigEdges.get(s);if(a)for(const u of a.keys()){const c=this.extensionNameMap.get(u);c&&n(c,s)}i=RC(i),r.state=i,e.push(r)};for(const r of this.extensionNameMap.values())Ou(r.state)&&n(r);for(const r of e)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const l of i)s.configs.add(l)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Pe(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const l=s.register(e,i);l&&o.push(l)}for(const s of n){const l=s.afterRegistration(e);l&&o.push(l)}return xt(...o)}buildCreateEditorArgs(){const e={},n=new Set,r=new Map,o=new Map,i={},s={},l=this.sortedExtensionReps();for(const c of l){const{extension:d}=c;if(d.onError!==void 0&&(e.onError=d.onError),d.onWarn!==void 0&&(e.onWarn=d.onWarn),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(const f of FC(d)){if(typeof f!="function"){const h=r.get(f.replace);h&&Pe(302,d.name,f.replace.name,h.extension.name),r.set(f.replace,c)}n.add(f)}if(d.html){if(d.html.export)for(const[f,h]of d.html.export.entries())o.set(f,h);d.html.import&&Object.assign(i,d.html.import)}d.theme&&up(s,d.theme)}Object.keys(s).length>0&&(e.theme=s),n.size&&(e.nodes=[...n]);const a=Object.keys(i).length>0,u=o.size>0;(a||u)&&(e.html={},a&&(e.html.import=i),u&&(e.html.export=o));for(const c of l)c.init(e);return e.onError||(e.onError=HC),e}};function bi(t,e){const n=pp.maybeFromEditor(t);if(!n)return;const r=n.extensionNameMap.get(e);return r?r.getExtensionDependency():void 0}function jC(t){return bi(Ke(),t)}class Nu extends Ya{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:GC,priority:0})}})}exportDOM(){return{element:Ce().createElement("hr")}}createDOM(e){const n=Ce().createElement("hr");return Wt(n,e.theme.hr),n}getTextContent(){return`
12
+ `}isInline(){return!1}updateDOM(){return!1}}function GC(){return{node:mp()}}function mp(){return xu(Nu)}function qC(t){return t instanceof Nu}function YC(t,e,n,r,o){if(t===null||n.size===0&&r.size===0&&!o)return 0;const i=e._selection,s=t._selection;if(o)return 1;if(!(A(i)&&A(s)&&s.isCollapsed()&&i.isCollapsed()))return 0;const l=(function(y,v,x){const _=y._nodeMap,C=[];for(const T of v){const k=_.get(T);k!==void 0&&C.push(k)}for(const[T,k]of x){if(!k)continue;const S=_.get(T);S===void 0||Ie(S)||C.push(S)}return C})(e,n,r);if(l.length===0)return 0;if(l.length>1){const y=e._nodeMap,v=y.get(i.anchor.key),x=y.get(s.anchor.key);return v&&x&&!t._nodeMap.has(v.__key)&&O(v)&&v.__text.length===1&&i.anchor.offset===1?2:0}const a=l[0],u=t._nodeMap.get(a.__key);if(!O(u)||!O(a)||u.__mode!==a.__mode)return 0;const c=u.__text,d=a.__text;if(c===d)return 0;const f=i.anchor,h=s.anchor;if(f.key!==h.key||f.type!=="text")return 0;const g=f.offset,b=h.offset,p=d.length-c.length;return p===1&&b===g-1?2:p===-1&&b===g+1?3:p===-1&&b===g?4:0}function ZC(t,e,n){let r=n(),o=0,i=r,s=0,l=null;return(a,u,c,d,f,h)=>{const g=n();if(h.has(dh)&&(i=r,s=o,l=a),h.has(ss))return o=0,r=g,2;h.has(Wo)&&l&&(r=i,o=s,a=l);const b=h.has(uh)||h.has(Aa)?0:YC(a,u,d,f,t.isComposing()),p=(()=>{const y=c===null||c.editor===t,v=h.has(ah);if(!v&&y&&h.has(Gr))return 0;if(b===1)return 2;if(a===null)return 1;const x=u._selection;if(!(d.size>0||f.size>0))return x!==null?0:2;const _=typeof e=="number"?e:e.peek();return v===!1&&b!==0&&b===o&&g<r+_&&y||d.size===1&&(function(C,T,k){const S=T._nodeMap.get(C),w=k._nodeMap.get(C),D=T._selection,M=k._selection;return!(A(D)&&A(M)&&D.anchor.type==="element"&&D.focus.type==="element"&&M.anchor.type==="text"&&M.focus.type==="text"||!O(S)||!O(w)||S.__parent!==w.__parent)&&JSON.stringify(T.read(()=>S.exportJSON()))===JSON.stringify(k.read(()=>w.exportJSON()))})(Array.from(d)[0],a,u)?0:1})();return r=g,o=b,p}}function yp(t,e){if(e!==null&&e.editor===t.editor)return e;const{editor:n}=t,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function bp(t,e){t.undoStack=[],t.redoStack=[],t.current=null}function XC(t,e,n,r=Date.now,o,i=null){const s=ZC(t,n,r);return xt(t.registerCommand(qo,()=>((function(l,a,u){const c=a.redoStack,d=a.undoStack;if(d.length!==0){const f=a.current,h=d.pop();if(h){const g=yp(h,f);g!==null&&(c.push(g),l.dispatchCommand(Yo,!0))}d.length===0&&l.dispatchCommand(Zo,!1),a.current=h||null,h&&h.editor.setEditorState(h.editorState,{tag:ss})}})(t,e),!0),re),t.registerCommand(Hr,()=>((function(l,a,u){const c=a.redoStack,d=a.undoStack;if(c.length!==0){const f=a.current,h=c.pop();if(h){const g=yp(h,f);g!==null&&(d.push(g),l.dispatchCommand(Zo,!0))}c.length===0&&l.dispatchCommand(Yo,!1),a.current=h||null,h&&h.editor.setEditorState(h.editorState,{tag:ss})}})(t,e),!0),re),t.registerCommand(N_,()=>(bp(e),!1),re),t.registerCommand(R_,()=>(bp(e),t.dispatchCommand(Yo,!1),t.dispatchCommand(Zo,!1),!0),re),t.registerUpdateListener(({editorState:l,prevEditorState:a,dirtyLeaves:u,dirtyElements:c,tags:d})=>{const f=e.current,h=e.redoStack,g=e.undoStack,b=f===null?null:f.editorState;if(f!==null&&l===b)return;const p=s(a,l,f,u,c,d);if(p===1){h.length!==0&&(e.redoStack=[],t.dispatchCommand(Yo,!1));const y=(function(v,x,_){return _===null?null:_.editor===v?{..._}:x.isEmpty()?null:{editor:v,editorState:x}})(t,a,f);if(y!==null){g.push(y);const v=typeof i=="number"||i===null?i:i.peek();v!==null&&g.length>v&&g.splice(0,g.length-v),t.dispatchCommand(Zo,!0)}}else if(p===2)return;e.current={editor:t,editorState:l}}))}function QC(){return{current:null,redoStack:[],undoStack:[]}}function WC({delay:t,externalHistoryState:e}){const[n]=Vt();return(function(r,o,i=1e3){const s=m.useMemo(()=>o||QC(),[o]);m.useEffect(()=>XC(r,s,i),[i,r,s])})(n,e,t),null}class JC extends m.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){this.props.onError(e instanceof Error?e:new Error(String(e),{cause:e}),n)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function e1({children:t,fallback:e,onError:n}){return R.jsx(JC,{fallback:e===void 0?R.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):e,onError:n,children:t})}function t1(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let fo;function vp(t,e){const{key:n}=e;return t&&n in t?t[n]:e.defaultValue}function xp(t){return fo&&fo.editor===t?fo:void 0}function n1(t,e){if("cfg"in e){const{cfg:n,updater:r}=e;return[n,r(vp(t,n))]}return e}function r1(t,e){let n=e;for(const r of t){const[o,i]=n1(n,r),s=o.key;if(n===e&&vp(n,o)===i)continue;const l=n===e||n===void 0?o1(e):n;l[s]=i,n=l}return n}function o1(t){return Object.create(t||null)}function i1(t,e){return[t,e]}function s1(t,e,n,r=Ke()){const o=fo,i=xp(r);try{return fo={...i,editor:r,[t]:e},n()}finally{fo=o}}function l1(t,e=()=>{}){return(n,r=Ke())=>o=>{const i=xp(r),s=i&&i[t],l=r1(n,s||e(r));return l&&l!==s?s1(t,l,o,r):o()}}function a1(t,e,n,r){return Object.assign(Nr(Symbol(e),{isEqual:r,parse:n}),{[t]:!0})}function u1(t){if(!dr(t))return;const e=t;if(e.querySelector("style")===null)return;const n=new Map;function r(o){let i=n.get(o);if(i===void 0){i=new Set;for(let s=0;s<o.style.length;s++)i.add(o.style[s]);n.set(o,i)}return i}try{for(const o of Array.from(e.styleSheets)){let i;try{i=o.cssRules}catch{continue}for(const s of Array.from(i)){if(!En(s,CSSStyleRule))continue;let l;try{l=e.querySelectorAll(s.selectorText)}catch{continue}for(const a of Array.from(l)){if(!fe(a))continue;const u=r(a);for(let c=0;c<s.style.length;c++){const d=s.style[c];u.has(d)||a.style.setProperty(d,s.style.getPropertyValue(d),s.style.getPropertyPriority(d))}}}}}catch{}}const _p="@lexical/html/DOM",Sp=Symbol.for("@lexical/html/DOMExportContext");function c1(t,e,n){return a1(Sp,t,e,n)}const d1=c1("isExport",Boolean);function f1(t){const e=bi(t,_p);return e?e.output.defaults:void 0}function h1(t){const e=bi(t,_p);return e?e.output.runtime:void 0}function g1(t=Ke()){const e=h1(t);return e?e.getSessionConfig():Fs(t)}const p1=l1(Sp,f1),Cp=new Set(["STYLE","SCRIPT"]);function m1(t,e){u1(e);const n=dr(e)?e.body.childNodes:e.childNodes,r=[],o=[];for(const i of n)if(!Cp.has(i.nodeName)){const s=wp(i,t,o,!1);if(s!==null)for(const l of s)r.push(l)}return(function(i){for(const s of i)s.getParent()&&s.getNextSibling()instanceof Qa&&s.insertAfter(Ln());for(const s of i){const l=s.getParent();l&&l.splice(s.getIndexWithinParent(),1,s.getChildren())}})(o),r}function y1(t,e=null,n=Ke()){return p1([i1(d1,!0)],n)(()=>{const r=we(),o=g1(n),i=Lg(e),s=t.append.bind(t);for(const l of(P(i)?i:r).getChildren())Ep(n,l,s,e,o);return t})}function b1(t,e=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&t1(338),mS(t),y1(Ce().createElement("div"),e,t).innerHTML}function Ep(t,e,n,r=null,o=Fs(t)){let i=o.$shouldInclude(e,r,t);const s=o.$shouldExclude(e,r,t);let l=e;r!==null&&O(e)&&(l=Yg(r,e,"clone"));const a=o.$exportDOM(l,t),{element:u,after:c,append:d,$getChildNodes:f}=a;if(!u)return!1;const h=Ce().createDocumentFragment(),g=f?f():P(l)?l.getChildren():[],b=i&&De(r)&&P(e)?null:r,p=h.append.bind(h);let y=null;for(const v of g){const x=Ep(t,v,p,b,o);x&&(y=v),!i&&x&&o.$extractWithChild(e,v,r,"html",t)&&(i=!0)}if(i&&!s){if((fe(u)||pu(u))&&(d?d(h):u.append(h),(function(v,x){const _=v.lastChild;if(Ze(x)&&fe(v)&&di(v)&&_!==null&&_.nodeName==="BR"){const C=Ce().createElement("br");C.setAttribute("data-lexical-managed-linebreak","true"),v.append(C)}})(u,y)),pu(u)){if(c){const v=c.call(l,u);v&&u.replaceChildren(v)}n(u)}else if(n(u),c){const v=c.call(l,u);v&&u.replaceWith(v)}}else n(h);return i}function wp(t,e,n,r,o=new Map,i){const s=[];if(Cp.has(t.nodeName))return s;let l=null;const a=(function(g,b){const{nodeName:p}=g,y=b._htmlConversions.get(p.toLowerCase());let v=null;if(y!==void 0)for(const x of y){const _=x(g);_!==null&&(v===null||(v.priority||0)<=(_.priority||0))&&(v=_)}return v!==null?v.conversion:null})(t,e),u=a?a(t):null;let c=null;if(u!==null){c=u.after;const g=u.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,b]of o)if(l=b(l,i),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}u.forChild!=null&&o.set(t.nodeName,u.forChild)}const d=t.childNodes;let f=[];const h=(l==null||!be(l))&&(l!=null&&fs(l)||r);for(let g=0;g<d.length;g++)f.push(...wp(d[g],e,n,h,new Map(o),l));if(c!=null&&(f=c(f)),di(t)&&(f=v1(t,f,h?()=>{const g=new Qa;return n.push(g),g}:Se)),l==null)if(f.length>0)for(const g of f)s.push(g);else di(t)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:mu(g.nextSibling)&&mu(g.previousSibling)})(t)&&s.push(Ln());else P(l)&&l.append(...f);return s}function v1(t,e,n){const r=t.style.textAlign,o=[];let i=[];for(let s=0;s<e.length;s++){const l=e[s];if(fs(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(i.push(l),s===e.length-1||s<e.length-1&&fs(e[s+1])){const a=n();a.setFormat(r),a.append(...i),o.push(a),i=[]}}return o}const kp=new Set(["http:","https:","mailto:","sms:","tel:"]);let wn=class extends Be{__url;__target;__rel;__title;$config(){return this.config("link",{extends:Be,importDOM:{a:()=>({conversion:_1,priority:1})}})}constructor(e="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=e,this.__target=o,this.__rel=i,this.__title=s}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){const n=Ce().createElement("a");return this.updateLinkDOM(null,n,e),Wt(n,e.theme.link),n}updateLinkDOM(e,n,r){if(Eg(n)){e&&e.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];e&&e[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(e,n,r){return this.updateLinkDOM(e,n,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){const n=e;e=Dp(e);try{const r=new URL(Dp(e));if(!kp.has(r.protocol))return"about:blank"}catch{const o=n.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(o!=null&&!kp.has(`${o[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const n=this.getWritable();return n.__url=e,n}getTarget(){return this.getLatest().__target}setTarget(e){const n=this.getWritable();return n.__target=e,n}getRel(){return this.getLatest().__rel}setRel(e){const n=this.getWritable();return n.__rel=e,n}getTitle(){return this.getLatest().__title}setTitle(e){const n=this.getWritable();return n.__title=e,n}insertNewAfter(e,n=!0){const r=Qe(this);return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!A(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return(this.is(o)||this.isParentOf(o))&&(this.is(i)||this.isParentOf(i))&&n.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith("mailto:")}isWebSiteURI(){const e=this.getURL();return e.startsWith("https://")||e.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.getURL()===e.getURL()&&this.getTarget()===e.getTarget()&&this.getRel()===e.getRel()&&this.getTitle()===e.getTitle()}};function Tp(t){const e=ut(t,"next");return[e,e.getFlipped()]}function Pp(t,e){for(const n of e)if(n.origin.isAttached()){const r=et(n);return void bn(t,r)}}function x1(t){const e=z();let n=null,r=null;function o(){A(e)&&(Pp(e.anchor,n),Pp(e.focus,r),Br(e))}A(e)&&(n=Tp(e.anchor),r=Tp(e.focus));let i=!1;for(const l of rt(t,"next")){const a=l.origin;if(P(a)&&!a.isInline()){const u=a.getChildren();if(u.length>0){const c=Qe(t);c.append(...u),a.append(c),i=!0}tu(a,vn(l),{$shouldSplit:()=>!1})}}function s(l,a,u){const[c,d]=l,f=g=>Cn(g)&&g.origin.is(a);if(!f(c)&&!f(d))return l;const h=et(rt(u,"next"));return[h,h.getFlipped()]}if(t.isAttached()){const l=t.getPreviousSibling();if($t(l)&&l.shouldMergeAdjacentLink(t))return n&&(n=s(n,l,t)),r&&(r=s(r,l,t)),l.append(...t.getChildren()),t.remove(),void o();const a=t.getNextSibling();$t(a)&&t.shouldMergeAdjacentLink(a)&&(n&&(n=s(n,t,a)),r&&(r=s(r,t,a)),t.append(...a.getChildren()),a.remove(),i=!0)}if(i){if(!t.canBeEmpty()&&t.isEmpty()){const l=t.getParent();t.remove(),l&&l.isEmpty()&&l.remove()}o()}}function _1(t){let e=null;if(Eg(t)){const n=t.textContent;(n!==null&&n!==""||t.children.length>0)&&(e=Ws(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:e}}function Ws(t="",e){return Bt(new wn(t,e))}function $t(t){return t instanceof wn}let S1=class extends wn{__isUnlinked;constructor(e="",n={},r){super(e,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}$config(){return this.config("autolink",{extends:wn})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(e){const n=this.getWritable();return n.__isUnlinked=e,n}createDOM(e){return this.__isUnlinked?Ce().createElement("span"):super.createDOM(e)}updateDOM(e,n,r){return super.updateDOM(e,n,r)||e.__isUnlinked!==this.__isUnlinked}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}};function ho(t){return t instanceof S1}const Ru=W("TOGGLE_LINK_COMMAND");function $p(t,e){if(t.type==="element"){const n=t.getNode();return P(n)||(function(r,...o){const i=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const l of o)s.append("v",l);throw i.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),n.getChildren()[t.offset+e]||null}return null}function Bu(t,e={}){let n;if(t&&typeof t=="object"){const{url:c,...d}=t;n=c,e={...d,...e}}else n=t;const{target:r,title:o}=e,i=e.rel===void 0?"noreferrer":e.rel,s=z();if(s===null||!A(s)&&!De(s))return;if(De(s)){const c=s.getNodes();return c.length===0?void 0:void c.forEach(d=>{if(n===null){const f=ke(d,h=>!ho(h)&&$t(h));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{const f=ke(d,h=>!ho(h)&&$t(h));if(f)f.setURL(n),r!==void 0&&f.setTarget(r),i!==void 0&&f.setRel(i),o!==void 0&&f.setTitle(o);else{const h=Ws(n,{rel:i,target:r,title:o});d.insertBefore(h),h.append(d)}}})}if(s.isCollapsed()&&n===null)for(const c of s.getNodes()){const d=ke(c,f=>!ho(f)&&$t(f));return void(d!==null&&(d.getParentOrThrow().splice(d.getIndexWithinParent(),0,d.getChildren()),d.remove()))}const l=s.extract();if(n===null){const c=new Set;return void l.forEach(d=>{const f=ke(d,h=>!ho(h)&&$t(h));if(f!==null){const h=f.getKey();if(c.has(h))return;(function(g,b){const p=new Set(b.filter(S=>g.isParentOf(S)).map(S=>S.getKey())),y=g.getChildren(),v=S=>p.has(S.getKey())||P(S)&&b.some(w=>g.isParentOf(w)&&S.isParentOf(w)),x=y.filter(v);if(x.length===y.length)return y.forEach(S=>g.insertBefore(S)),void g.remove();const _=y.findIndex(v),C=y.findLastIndex(v),T=_===0,k=C===y.length-1;if(T)x.forEach(S=>g.insertBefore(S));else if(k)for(let S=x.length-1;S>=0;S--)g.insertAfter(x[S]);else{for(let w=x.length-1;w>=0;w--)g.insertAfter(x[w]);const S=y.slice(C+1);if(S.length>0){const w=Qe(g);x[x.length-1].insertAfter(w),S.forEach(D=>w.append(D))}}})(f,l),c.add(h)}})}const a=new Set,u=c=>{a.has(c.getKey())||(a.add(c.getKey()),c.setURL(n),r!==void 0&&c.setTarget(r),i!==void 0&&c.setRel(i),o!==void 0&&c.setTitle(o))};if(l.length===1){const c=l[0],d=ke(c,$t);if(d!==null)return u(d)}(function(c){const d=z();if(!A(d))return c();const f=Br(d),h=f.isBackward(),g=$p(f.anchor,h?-1:0),b=$p(f.focus,h?0:-1);if(c(),g||b){const p=z();if(A(p)){const y=p.clone();if(g){const v=g.getParent();v&&y.anchor.set(v.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(b){const v=b.getParent();v&&y.focus.set(v.getKey(),b.getIndexWithinParent()+(h?0:1),"element")}ze(Br(y))}}})(()=>{let c=null;for(const d of l){if(!d.isAttached())continue;const f=ke(d,$t);if(f){u(f);continue}if(P(d)){if(!d.isInline())continue;if($t(d)){if(!(ho(d)||c!==null&&c.getParentOrThrow().isParentOf(d))){u(d),c=d;continue}for(const g of d.getChildren())d.insertBefore(g);d.remove();continue}}const h=d.getPreviousSibling();$t(h)&&h.is(c)?h.append(d):(c=Ws(n,{rel:i,target:r,title:o}),d.insertAfter(c),c.append(d))}})}const C1=/^\+?[0-9\s()-]{5,}$/;function Dp(t){return t.match(/^[a-z][a-z0-9+.-]*:/i)||t.match(/^[/#.]/)?t:t.includes("@")?`mailto:${t}`:C1.test(t)?`tel:${t}`:`https://${t}`}function E1(t,e){return xt(t.registerNodeTransform(wn,x1),t.registerCommand(Ru,n=>{const r=e.validateUrl.peek(),o=e.attributes.peek();if(n===null)return Bu(null),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(Bu(n,o),!0);{const{url:i,...s}=n;return!(r!==void 0&&!r(i))&&(Bu(i,{...o,...s}),!0)}},re),Mu(()=>{const n=e.validateUrl.value;if(!n)return;const r=e.attributes.value;return t.registerCommand(Xi,o=>{const i=z();if(!A(i)||i.isCollapsed()||!En(o,ClipboardEvent)||o.clipboardData===null)return!1;const s=o.clipboardData.getData("text");return n(s)?!i.getNodes().some(l=>P(l)||O(l)&&!l.isSimpleText())&&(t.dispatchCommand(Ru,{...r,url:s}),o.preventDefault(),!0):!1},cr)}))}function w1({validateUrl:t,attributes:e}){const[n]=Vt();return m.useEffect(()=>{if(!n.hasNodes([wn]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),m.useEffect(()=>E1(n,IC({attributes:e,validateUrl:t})),[n,t,e]),null}function Kn(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function zu(t){let e=1,n=t.getParent();for(;n!=null;){if(le(n)){const r=n.getParent();if(te(r)){e++,n=r.getParent();continue}Kn(40)}return e}return e}function Vu(t){const e=t.getParent();te(e)||Kn(40);let n=e,r=e;for(;r!==null;)r=r.getParent(),te(r)&&(n=r);return n}function Mp(t){let e=[];const n=t.getChildren().filter(le);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();te(i)?e=e.concat(Mp(i)):e.push(o)}return e}function Dt(t){return le(t)&&te(t.getFirstChild())}function Ap(t,e){return e.getValue()}function Lp(t,e){return le(t)&&(e.length===0||e.length===1&&t.is(e[0])&&t.getChildrenSize()===0)}function Ip(t,e){return te(t)?Qe(t).setListType(e):kn(e)}function Fp(t){const e=z();if(e!==null){let n=e.getNodes();if(A(e)){const[o]=e.getStartEndPoints(),i=o.getNode(),s=i.getParent();if(be(i)){const l=i.getFirstChild();if(l)n=l.selectStart().getNodes();else{const a=Se();i.append(a),n=a.select().getNodes()}}else if(Lp(i,n)){if(be(s)){const l=kn(t);i.replace(l);const a=Sr();P(i)&&(a.setFormat(i.getFormatType()),a.setIndent(i.getIndent())),l.append(a)}else if(le(i)){const l=i.getParentOrThrow();if(nt(l)===null){const a=Ip(l,t);_r(a,l.getChildren()),l.replace(a)}}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(P(i)&&i.isEmpty()&&!le(i)&&nt(i)===null&&!r.has(i.getKey())){Op(i,t);continue}let s=sg(i)?i.getParent():le(i)&&i.isEmpty()?i:null;for(;s!=null;){const l=s.getKey();if(te(s)){if(!r.has(l)&&nt(s)===null){const a=Ip(s,t);_r(a,s.getChildren()),s.replace(a),r.add(l)}break}{const a=s.getParent();if(be(a)&&!r.has(l)){r.add(l),Op(s,t);break}s=a}}}}}function _r(t,e){t.splice(t.getChildrenSize(),0,e)}function Op(t,e){if(te(t))return t;const n=t.getPreviousSibling(),r=t.getNextSibling(),o=Sr();let i;if(_r(o,t.getChildren()),te(n)&&e===n.getListType())n.append(o),te(r)&&e===r.getListType()&&(_r(n,r.getChildren()),r.remove()),i=n;else if(te(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const l=kn(e);l.append(o),t.replace(l),i=l}o.setFormat(t.getFormatType()),o.setIndent(t.getIndent());const s=z();return A(s)&&(i.getKey()===s.anchor.key&&s.anchor.set(o.getKey(),s.anchor.offset,"element"),i.getKey()===s.focus.key&&s.focus.set(o.getKey(),s.focus.offset,"element")),t.remove(),i}function Uu(t,e){const n=t.getLastChild(),r=e.getFirstChild();n&&r&&Dt(n)&&Dt(r)&&n.getFirstChild().getListType()===r.getFirstChild().getListType()&&(Uu(n.getFirstChild(),r.getFirstChild()),r.remove());const o=e.getChildren();o.length>0&&t.append(...o),e.remove()}function k1(){const t=z();if(A(t)){const e=new Set,n=t.getNodes(),r=t.anchor.getNode();if(Lp(r,n))e.add(Vu(r));else for(let o=0;o<n.length;o++){const i=n[o];if(sg(i)){const s=Pu(i,Nn);s!=null&&e.add(Vu(s))}}for(const o of e){if(nt(o)!==null)continue;let i=o;const s=Mp(o);for(const l of s){const a=Se().setTextStyle(t.style).setTextFormat(t.format);a.setFormat(l.getFormatType()).setIndent(l.getIndent()).setDirection(l.getDirection()).setStyle(l.getStyle()),_r(a,l.getChildren()),i.insertAfter(a),i=a,l.__key===t.anchor.key&&bn(t.anchor,et(rt(a,"next"))),l.__key===t.focus.key&&bn(t.focus,et(rt(a,"next"))),l.remove()}o.remove()}}}function Kp(t){const e=t.getListType()!=="check";let n=t.getStart();for(const r of t.getChildren())le(r)&&(r.getValue()!==n&&r.setValue(n),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),te(r.getFirstChild())||n++)}function T1(t){const e=new Set;if(Dt(t)||e.has(t.getKey()))return;const n=t.getParent(),r=t.getNextSibling(),o=t.getPreviousSibling();if(Dt(r)&&Dt(o)){const i=o.getFirstChild();if(te(i)){i.append(t);const s=r.getFirstChild();te(s)&&(_r(i,s.getChildren()),r.remove(),e.add(r.getKey()))}}else if(Dt(r)){const i=r.getFirstChild();if(te(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(t)}}else if(Dt(o)){const i=o.getFirstChild();te(i)&&i.append(t)}else if(te(n)){const i=Qe(t),s=Qe(n);i.append(s),s.append(t),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function Np(t){if(Dt(t))return;const e=t.getParent(),n=e?e.getParent():void 0;if(te(n?n.getParent():void 0)&&le(n)&&te(e)){const r=e?e.getFirstChild():void 0,o=e?e.getLastChild():void 0;if(t.is(r))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(o))n.insertAfter(t),e.isEmpty()&&n.remove();else{const i=Qe(t),s=Qe(e);i.append(s),t.getPreviousSiblings().forEach(u=>s.append(u));const l=Qe(t),a=Qe(e);l.append(a),_r(a,t.getNextSiblings()),n.insertBefore(i),n.insertAfter(l),n.replace(t)}}}function P1(t=!1){const e=z();if(!A(e)||!e.isCollapsed())return!1;const n=e.anchor.getNode();let r=null;if(le(n)&&n.getChildrenSize()===0)r=n;else if(O(n)){const u=n.getParent();le(u)&&u.getChildren().every(c=>O(c)&&c.getTextContent().trim()==="")&&(r=u)}if(r===null)return!1;const o=Vu(r),i=r.getParent();te(i)||Kn(40);const s=i.getParent();let l;if(be(s))l=Se(),o.insertAfter(l);else{if(!le(s))return!1;l=Qe(s),s.insertAfter(l)}l.setTextStyle(e.style).setTextFormat(e.format).select();const a=r.getNextSiblings();if(a.length>0){const u=t?Ap(0,r):1,c=Qe(i).setStart(u);if(le(l)){const d=Qe(l);d.append(c),l.insertAfter(d)}else l.insertAfter(c);c.append(...a)}return(function(u){let c=u;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const d=c.getParent();if(d==null||!le(d)&&!te(d))break;c=d}c.remove()})(r),!0}let Nn=class extends Be{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const n=e.getParent();if(te(n))n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(n){const r=e.createParentElementNode();te(r)||Kn(340);const o=[e];for(const i of["previous","next"]){o.reverse();for(const{origin:s}of ye(e,i)){if(!le(s))break;o.push(s)}}e.insertBefore(r),r.splice(0,0,o),be(n)||(tu(r,vn(ye(r,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),n.isEmpty()&&n.isAttached()&&n.remove())}},extends:Be,importDOM:{li:()=>({conversion:$1,priority:0})}})}constructor(e=1,n=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const n=Ce().createElement("li");return this.updateListItemDOM(null,n,e),n}updateListItemDOM(e,n,r){(function(s,l){const a=l.getParent();!te(a)||a.getListType()!=="check"||te(l.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),s.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(n,this),n.value=this.__value,(function(s,l,a){const u=l.list;if(!u)return;const c=u.listitem,d=u.nested&&u.nested.listitem,f=a.getParent(),h=te(f)&&f.getListType()==="check",g=a.getChecked(),b=a.getChildren().some(v=>te(v)),p=[];u.listitemChecked!==void 0&&p.push(u.listitemChecked),u.listitemUnchecked!==void 0&&p.push(u.listitemUnchecked),d!==void 0&&p.push(...Qt(d)),p.length>0&&ku(s,...p);const y=[];if(c!==void 0&&y.push(...Qt(c)),h){const v=g?u.listitemChecked:u.listitemUnchecked;v!==void 0&&y.push(v)}d!==void 0&&b&&y.push(...Qt(d)),y.length>0&&Wt(s,...y)})(n,r.theme,this);const o=e?e.__style:"",i=this.__style;o!==i&&qr(n.style,i,o),(function(s,l,a){const u=l.__textStyle,c=a?a.__textStyle:"";if(a!==null&&c===u)return;const d=ls(u);for(const f in d)s.style.setProperty(`--listitem-marker-${f}`,d[f]);if(c!=="")for(const f in ls(c))f in d||s.style.removeProperty(`--listitem-marker-${f}`)})(n,this,e)}updateDOM(e,n,r){const o=n;return this.updateListItemDOM(e,o,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const n=this.createDOM(e._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),Dt(this)?{after(i){if(fe(i)){const s=i.previousElementSibling;if(fe(s)&&s.nodeName==="LI"){for(;i.firstChild;)s.append(i.firstChild);i.remove()}}return i},element:n}:{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let n=0;n<e.length;n++){const r=e[n];if(P(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(e,n){if(le(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!te(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const s=Qe(r);let l=this.getNextSibling();for(;l;){const a=l;l=l.getNextSibling(),s.append(a)}r.insertAfter(e),e.insertAfter(s)}const o=this.__key;let i=0;if(n&&(P(e)||Kn(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),n&&P(e)){const s=z();if(A(s))for(const l of s.getStartEndPoints())l.key===o&&l.type==="element"&&l.set(e.getKey(),i+l.offset,"element")}return this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){const r=this.getParentOrThrow();if(te(r)||Kn(39),le(e))return super.insertAfter(e,n);const o=this.getNextSiblings();if(r.insertAfter(e,n),o.length!==0){const i=Qe(r),s=o[0];i.getListType()==="number"&&le(s)&&i.setStart(Ap(0,s)),o.forEach(l=>i.append(l)),e.insertAfter(i,n)}return e}remove(e){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&Dt(n)&&Dt(r)&&n.getFirstChild().getListType()===r.getFirstChild().getListType()&&(Uu(n.getFirstChild(),r.getFirstChild()),r.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,n=!0){const r=Qe(this);return this.insertAfter(r,n),r}collapseAtStart(e){if(Dt(this))return!1;const n=this.getParentOrThrow();if(le(n.getParentOrThrow()))return Np(this),!0;const r=Se().append(...this.getChildren()),o=this.getNextSiblings();if(o.length>0){const i=Qe(n);i.append(...o),n.insertAfter(i)}return n.insertAfter(r),this.remove(),n.getChildrenSize()===0&&n.remove(),r.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){const n=this.getWritable();return n.__value=e,n}getChecked(){const e=this.getLatest();let n;const r=this.getParent();return te(r)&&(n=r.getListType()),n==="check"?!!e.__checked:void 0}setChecked(e){const n=this.getWritable();return n.__checked=e,n}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let n=e.getParentOrThrow(),r=0;for(;le(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Kn(117),(e=Math.floor(e))>=0||Kn(199);let n=this.getIndent();for(;n!==e;)n<e?(T1(this),n++):(Np(this),n--);return this}canInsertAfter(e){return le(e)}canReplaceWith(e){return le(e)}canMergeWith(e){return le(e)||Xr(e)}extractWithChild(e,n){if(!A(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return kn("bullet")}canMergeWhenEmpty(){return!0}};function $1(t){if(t.classList.contains("task-list-item")){for(const r of t.children)if(r.tagName==="INPUT")return Rp(r)}if(t.classList.contains("joplin-checkbox")){for(const r of t.children)if(r.classList.contains("checkbox-wrapper")&&r.children.length>0&&r.children[0].tagName==="INPUT")return Rp(r.children[0])}const e=t.getAttribute("aria-checked"),n=Sr(e==="true"||e!=="false"&&void 0);return Os(n,t),{after:Bp.bind(null,n),node:fi(n,t)}}function Rp(t){if(t.getAttribute("type")!=="checkbox")return{node:null};const e=Sr(t.hasAttribute("checked"));return{after:Bp.bind(null,e),node:e}}function Bp(t,e){const n=e[0];return e.length===1&&Xr(n)&&!t.getFormatType()&&n.getFormatType()?(t.setFormat(n.getFormatType()),n.getChildren()):e}function Sr(t){return Bt(new Nn(void 0,t))}function le(t){return t instanceof Nn}let Rn=class extends Be{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(n){const r=n.getNextSibling();te(r)&&n.getListType()===r.getListType()&&Uu(n,r)})(e),Kp(e)},extends:Be,importDOM:{ol:()=>({conversion:Vp,priority:0}),ul:()=>({conversion:Vp,priority:0})}})}constructor(e="number",n=1,r){super(r);const o=D1[e]||e;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const n=this.getWritable();return n.__listType=e,n.__tag=e==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const n=this.getWritable();return n.__start=e,n}createDOM(e,n){const r=this.__tag,o=Ce().createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,zp(o,e.theme,this),o}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(zp(n,r.theme,this),e.__start!==this.__start&&n.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const n=this.createDOM(e._config,e);if(fe(n)){this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check");const r=this.getDirection();r&&(n.dir=r)}return{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];if(!le(s)){o===r&&(o=[...r]);const l=this.createListItemNode();!P(s)||te(s)||s.isInline()?l.append(s):l.append(...s.getChildren()),o[i]=l}}return super.splice(e,n,o)}extractWithChild(e){return le(e)}createListItemNode(){return Sr()}};function zp(t,e,n){const r=[],o=[],i=e.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],l=zu(n)-1,a=l%s.length,u=s[a],c=i[n.__tag];let d;const f=i.nested,h=i.checklist;if(f!==void 0&&f.list&&(d=f.list),c!==void 0&&r.push(c),h!==void 0&&n.__listType==="check"&&r.push(h),u!==void 0){r.push(...Qt(u));for(let g=0;g<s.length;g++)g!==a&&o.push(...Qt(s[g]))}if(d!==void 0){const g=Qt(d);l>1?r.push(...g):o.push(...g)}}o.length>0&&ku(t,...o),r.length>0&&Wt(t,...r)}function Vp(t){let e;if((function(n){return fe(n)&&n.nodeName.toLowerCase()==="ol"})(t)){const n=t.start;e=kn("number",n)}else e=(function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list")||n.getAttribute("data-is-checklist")==="1")return!0;for(const r of n.childNodes)if(fe(r)&&r.hasAttribute("aria-checked"))return!0;return!1})(t)?kn("check"):kn("bullet");return fi(e,t),{after:n=>(function(r,o){const i=o.createListItemNode.bind(o),s=[];for(let l=0;l<r.length;l++){const a=r[l];if(le(a)){s.push(a);const u=a.getChildren();u.length>1&&u.forEach(c=>{te(c)&&s.push(i().append(c))})}else s.push(i().append(a))}return s})(n,e),node:e}}const D1={ol:"number",ul:"bullet"};function kn(t="number",e=1){return Bt(new Rn(t,e))}function te(t){return t instanceof Rn}const M1=W("UPDATE_LIST_START_COMMAND"),Up=W("INSERT_UNORDERED_LIST_COMMAND"),Hp=W("INSERT_ORDERED_LIST_COMMAND"),jp=W("REMOVE_LIST_COMMAND");function Gp(t,e){return xt(t.registerCommand(Hp,()=>(Fp("number"),!0),cr),t.registerCommand(M1,n=>{const{listNodeKey:r,newStart:o}=n,i=Te(r);return!!te(i)&&(i.getListType()==="number"&&(i.setStart(o),Kp(i)),!0)},cr),t.registerCommand(Up,()=>(Fp("bullet"),!0),cr),t.registerCommand(jp,()=>(k1(),!0),cr),t.registerCommand(jo,()=>P1(!!(e&&e.restoreNumbering)),cr),t.registerCommand(ka,n=>{const r=z();if(!A(r)||!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;let i=o.getNode();for(;!le(i);){if(i.getPreviousSibling()!==null)return!1;const s=i.getParent();if(s===null)return!1;i=s}return!(!le(i)||!i.collapseAtStart(r))&&(n.preventDefault(),!0)},DS),t.registerNodeTransform(Nn,n=>{const r=n.getFirstChild();if(r){if(O(r)){const o=r.getStyle(),i=r.getFormat();n.getTextStyle()!==o&&n.setTextStyle(o),n.getTextFormat()!==i&&n.setTextFormat(i)}}else{const o=z();A(o)&&(o.style!==n.getTextStyle()||o.format!==n.getTextFormat())&&o.isCollapsed()&&n.is(o.anchor.getNode())&&n.setTextStyle(o.style).setTextFormat(o.format)}}),t.registerNodeTransform(mn,n=>{const r=n.getParent();if(le(r)&&n.is(r.getFirstChild())){const o=n.getStyle(),i=n.getFormat();o===r.getTextStyle()&&i===r.getTextFormat()||r.setTextStyle(o).setTextFormat(i)}}))}function A1(t){const e=n=>{const r=n.getParent();if(te(n.getFirstChild())||!te(r))return;const o=ke(n,i=>le(i)&&te(i.getParent())&&le(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(le(o)){const i=o.getPreviousSibling();if(le(i)){const s=(function(a){let u=a,c=u.getFirstChild();for(;te(c);){const d=c.getLastChild();if(!le(d))break;u=d,c=u.getFirstChild()}return u})(i),l=s.getParent();if(te(l)){const a=zu(l);a+1<zu(r)&&n.setIndent(a)}}}};return t.registerNodeTransform(Rn,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(te(o)){for(const i of o.getChildren())if(le(i)){e(i);const s=i.getFirstChild();te(s)&&r.push(s)}}}})}function L1({hasStrictIndent:t=!1,shouldPreserveNumbering:e=!1}){const[n]=Vt();return m.useEffect(()=>{if(!n.hasNodes([Rn,Nn]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),m.useEffect(()=>xt(Gp(n,{restoreNumbering:e}),t?A1(n):()=>{}),[n,t,e]),(function(r){m.useEffect(()=>Gp(r),[r])})(n),null}function I1(t,e){let n=t;for(let r=ye(t,e);r&&(Wp(r.origin)||ir(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function F1(t){return I1(t,"previous")}function qp(t,e){for(const n of t.childNodes)if(fe(n)&&n.tagName===e||qp(n,e))return!0;return!1}const vi="data-language",xi="data-highlight-language",_i="data-theme";let Hu=class extends Be{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:Be,importDOM:{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||qp(e,"BR"))?{conversion:Yp,priority:1}:null,div:()=>({conversion:O1,priority:1}),pre:()=>({conversion:Yp,priority:0}),table:e=>ju(e)?{conversion:K1,priority:3}:null,td:e=>{const n=e,r=n.closest("table");return n.classList.contains("js-file-line")||r&&ju(r)?{conversion:Zp,priority:3}:null},tr:e=>{const n=e.closest("table");return n&&ju(n)?{conversion:Zp,priority:3}:null}}})}constructor(e=void 0,n){super(n),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const n=Ce().createElement("code");Wt(n,e.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(vi,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(xi,r));const o=this.getTheme();o&&n.setAttribute(_i,o);const i=this.getStyle();return i&&qr(n.style,i),n}updateDOM(e,n,r){const o=this.__language,i=e.__language;o?o!==i&&n.setAttribute(vi,o):i&&n.removeAttribute(vi);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(xi,o):n.removeAttribute(xi):s&&o&&n.setAttribute(xi,o);const l=this.__theme,a=e.__theme;l?l!==a&&n.setAttribute(_i,l):a&&n.removeAttribute(_i);const u=this.__style,c=e.__style;return u!==c&&qr(n.style,u,c),!1}exportDOM(e){const n=Ce().createElement("pre");Wt(n,e._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(vi,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(xi,r));const o=this.getTheme();o&&n.setAttribute(_i,o);const i=this.getStyle();return i&&qr(n.style,i),{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){if(!bi(Ke(),"@lexical/code")){const s=N1(e);if(s)return s}const{anchor:r,focus:o}=e,i=(r.isBefore(o)?r:o).getNode();if(O(i)){let s=F1(i);const l=[];for(;;)if(ir(s))l.push(Jo()),s=s.getNextSibling();else{if(!Wp(s))break;{let g=0;const b=s.getTextContent(),p=s.getTextContentSize();for(;g<p&&b[g]===" ";)g++;if(g!==0&&l.push(R1(" ".repeat(g))),g!==p)break;s=s.getNextSibling()}}const a=i.splitText(r.offset)[0],u=r.offset===0?0:1,c=a.getIndexWithinParent()+u,d=i.getParentOrThrow(),f=[Ln(),...l];d.splice(c,0,f);const h=l[l.length-1];h?h.select():r.offset===0?a.selectPrevious():a.getNextSibling().selectNext(0,0)}if(go(i)){const{offset:s}=e.anchor;i.splice(s,0,[Ln()]),i.select(s+1,s+1)}return null}canIndent(){return!1}collapseAtStart(){const e=Se();return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}setLanguage(e){const n=this.getWritable();return n.__language=e||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const n=this.getWritable();return n.__isSyntaxHighlightSupported=e,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const n=this.getWritable();return n.__theme=e||void 0,n}getTheme(){return this.getLatest().__theme}};function Bn(t,e){return xu(Hu).setLanguage(t).setTheme(e)}function go(t){return t instanceof Hu}function Yp(t){return{node:Bn(t.getAttribute(vi),t.getAttribute(_i))}}function O1(t){const e=t,n=Xp(e);return n||(function(r){let o=r.parentElement;for(;o!==null;){if(Xp(o))return!0;o=o.parentElement}return!1})(e)?{node:n?Bn():null}:{node:null}}function K1(){return{node:Bn()}}function Zp(){return{node:null}}function Xp(t){return t.style.fontFamily.match("monospace")!==null}function ju(t){return t.classList.contains("js-file-line-container")}function N1(t){const{anchor:e}=t;if(t.isCollapsed()&&e.type==="element"){const n=e.getNode();if(go(n)){const r=n.getChildrenSize();if(r>=2&&e.offset===r){const o=n.getLastChild();if(Ze(o)&&Ze(o.getPreviousSibling())){const i=Se();return n.splice(r-2,2,[]).insertAfter(i,!1),i.select(),i}}}}return null}class Qp extends mn{__highlightType;constructor(e="",n,r){super(e,r),this.__highlightType=n}$config(){return this.config("code-highlight",{extends:mn})}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const n=this.getWritable();return n.__highlightType=e||void 0,n}canHaveFormat(){return!1}createDOM(e){const n=super.createDOM(e),r=Gu(e.theme,this.__highlightType);return Wt(n,r),n}updateDOM(e,n,r){const o=super.updateDOM(e,n,r),i=Gu(r.theme,e.__highlightType),s=Gu(r.theme,this.__highlightType);return i!==s&&(i&&ku(n,i),s&&Wt(n,s)),o}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Bn()}}function Gu(t,e){return e&&t&&t.codeHighlight&&t.codeHighlight[e]}function R1(t="",e){return Bt(new Qp(t,e))}function Wp(t){return t instanceof Qp}function Js(t,e,n=null){const r=Sg(n),o=n?xg(n):[],i=n!==null&&o.length>0;if(i&&typeof r.caretPositionFromPoint=="function"){const s=r.caretPositionFromPoint(t,e,{shadowRoots:o});if(s!==null&&(function(l,a){for(let u=l;u!==null;){if(u===a)return!0;u=gr(u)}return!1})(s.offsetNode,n))return{node:s.offsetNode,offset:s.offset}}if(i){const s=n.getRootNode();if(_n(s)){const l=s.elementFromPoint(t,e);if(l!==null&&n.contains(l)){const a=(function(u,c,d,f){const h=f.createRange(),g=k=>c<k.top?k.top-c:c>k.bottom?c-k.bottom:0,b=k=>u<k.left?k.left-u:u>k.right?u-k.right:0,p=f.createTreeWalker(d,NodeFilter.SHOW_TEXT);let y=null,v=1/0,x=1/0;for(let k=p.nextNode();k;k=p.nextNode()){h.selectNodeContents(k);for(const S of h.getClientRects()){const w=g(S),D=b(S);(w<v||w===v&&D<x)&&(v=w,x=D,y=k)}}if(y===null)return null;let _=0,C=1/0,T=1/0;for(let k=0;k<=y.length;k++){h.setStart(y,k),h.collapse(!0);const S=h.getBoundingClientRect(),w=g(S),D=Math.abs(u-S.left);(w<C||w===C&&D<T)&&(C=w,T=D,_=k)}return{node:y,offset:_}})(t,e,l,r);if(a!==null)return a}}}if(typeof r.caretRangeFromPoint=="function"){const s=r.caretRangeFromPoint(t,e);return s===null?null:{node:s.startContainer,offset:s.startOffset}}if(typeof r.caretPositionFromPoint=="function"){const s=r.caretPositionFromPoint(t,e);return s===null?null:{node:s.offsetNode,offset:s.offset}}return null}function po(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Jp={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function B1(t){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(t):t}const em=(t,e)=>{if(!A(e))return e.insertRawText(t),!0;e!==z()&&ze(e);const n=r=>{const o=z();A(o)&&r(o)};return Nh(t,{linebreak:()=>n(r=>r.insertParagraph()),tab:()=>n(r=>r.insertNodes([Jo()])),text:r=>n(o=>o.insertText(r))}),!0},tm={"application/x-lexical-editor":[(t,e,n)=>{try{const r=Ke(),o=JSON.parse(t);if(o&&o.namespace===r._config.namespace&&Array.isArray(o.nodes))return im(r,Z1(o.nodes),e),!0}catch(r){console.error(r)}return n()}],"text/html":[(t,e,n)=>{try{const r=Ke(),o=new DOMParser().parseFromString(B1(t),"text/html");return im(r,m1(r,o),e),!0}catch(r){return console.error(r),n()}}],"text/plain":[em],"text/uri-list":[em]};function z1(t,e,n,r){if(!t)return!1;const o=i=>!!t[i]&&t[i](e,n,o.bind(null,i-1),r);return o(t.length-1)}function V1(t,e,n){const r=e.getData("text/plain");for(const o of(function(i){return Object.keys(i.$importMimeType).filter(s=>i.$importMimeType[s]!==void 0).sort((s,l)=>{const a=i.priority[s],u=i.priority[l];return a===void 0&&u===void 0?s<l?-1:s>l?1:0:a===void 0?1:u===void 0?-1:a-u})})(t)){const i=e.getData(o);if(i&&(o!=="text/html"||i!==r)&&z1(t.$importMimeType[o],i,n,e))return!0}return!1}const U1={$importMimeType:tm,$insertDataTransfer:(t,e)=>V1({$importMimeType:tm,priority:Jp},t,e),priority:Jp},H1={name:"@lexical/clipboard/Import"};function nm(t,e=z()){return e==null&&po(166),A(e)&&e.isCollapsed()||e.getNodes().length===0?"":b1(t,e)}function rm(t,e=z()){return e==null&&po(166),A(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Y1(t,e))}function qu(t,e,n){(function(){const r=jC(H1.name);return r?r.output:U1})().$insertDataTransfer(t,e)}const om="application/x-lexical-drag";function j1(t,e){const n={editorKey:e.getKey()};t.setData(om,JSON.stringify(n))}function G1(t,e,n){const r=t.dataTransfer;if(r===null)return!1;const o=(function(u){const c=u.getData(om);if(!c)return null;let d;try{d=JSON.parse(c)}catch{return null}return(f=d)!==null&&typeof f=="object"&&"editorKey"in f&&typeof f.editorKey=="string"?d:null;var f})(r);if(o===null)return!1;const i=(function(u,c){const d=Js(u.clientX,u.clientY,c.getRootElement());if(d===null)return null;const f=hr(d.node);if(f===null)return null;if(O(f))return Fn(f,"next",d.offset);if(P(f))return eu(f,d.offset,"next");const h=f.getParent();return h===null?null:eu(h,f.getIndexWithinParent()+1,"next")})(t,e);if(i===null)return!1;const s=tg(i);if(s===null)return!1;const l=o.editorKey===e.getKey(),a=z();if(l){if(!A(a)||a.isCollapsed())return!1;if((function(u,c){const{anchor:d,focus:f}=oi(Es(c),"next");return On(d,u)<0&&On(u,f)<0})(i,a))return t.preventDefault(),!0;a.removeText()}if(!s.origin.isAttached())return t.preventDefault(),!0;if(n(r,Zr(zs(s)),e),!l){const u=e.getRootElement(),c=u?u.ownerDocument:null,d=c?(function(f,h){for(const g of _g(h)){const b=Jr(g);if(li(b)&&b.getKey()===f&&fe(g))return g}return null})(o.editorKey,c):null;d!==null&&d.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return t.preventDefault(),!0}function q1(t,e){return G1(t,e,qu)}function im(t,e,n){t.dispatchCommand(A_,{nodes:e,selection:n})||(n.insertNodes(e),(function(r){if(A(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=ut(o,"previous");if(s)if(kt(s))i=s.origin;else{const l=Pt(s,rt(we(),"next").getFlipped());for(const a of l){if(O(a.origin)){i=a.origin;break}if(P(a.origin)&&!a.origin.isInline())break}}if(i&&O(i)){const l=i.getFormat(),a=i.getStyle();r.format===l&&r.style===a||(r.format=l,r.style=a,r.dirty=!0)}}})(n))}function Yu(t,e,n,r=[]){let o=e===null||n.isSelected(e);const i=P(n)&&n.excludeFromCopy("clone");let s=n;e!==null&&O(s)&&(s=Yg(e,s,"clone"));const l=P(s)?s.getChildren():[],a=(function(c){const d=c.exportJSON(),f=c.constructor;if(d.type!==f.getType()&&po(58,f.name),P(c)){const h=d.children;Array.isArray(h)||po(59,f.name)}return d})(s);O(s)&&s.getTextContentSize()===0&&(o=!1);const u=o&&De(e)&&P(n)?null:e;for(let c=0;c<l.length;c++){const d=l[c],f=Yu(t,u,d,a.children);!o&&P(n)&&f&&n.extractWithChild(d,e,"clone")&&(o=!0)}if(o&&!i){const c=Zt(s);if(c.length>0){const d={};for(const f of c){const h=lo(s,f);h===null&&po(366,s.constructor.name,f);const g=[];Yu(t,null,h,g),g.length===1&&g[0].type===h.getType()||po(385,f,s.constructor.name,String(g.length),String(g.length>0?g[0].type:"none")),d[f]=g[0]}a.$slots=d}}if(o&&!i)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const d=a.children[c];r.push(d)}return o}function Y1(t,e){const n=[],r=we(),o=Lg(e),i=(P(o)?o:r).getChildren();for(let s=0;s<i.length;s++)Yu(t,e,i[s],n);return{namespace:t._config.namespace,nodes:n}}function Z1(t){const e=[];for(const n of t)e.push(bS(n));return e}let mo=null;async function sm(t,e,n){if(mo!==null)return!1;if(e!==null)return new Promise((u,c)=>{t.update(()=>{u(lm(t,e,n))})});const r=t.getRootElement(),o=t._window||window,i=o.document,s=ct(o);if(r===null||s===null)return!1;const l=i.createElement("span");l.style.position="fixed",l.style.top="-1000px",l.append(i.createTextNode("#")),r.append(l);const a=i.createRange();return a.setStart(l,0),a.setEnd(l,1),s.removeAllRanges(),s.addRange(a),new Promise((u,c)=>{const d=t.registerCommand(Ji,f=>(En(f,ClipboardEvent)&&(d(),mo!==null&&(o.clearTimeout(mo),mo=null),u(lm(t,f,n))),!0),ks);mo=o.setTimeout(()=>{d(),mo=null,u(!1)},50),i.execCommand("copy"),l.remove()})}function lm(t,e,n){if(n===void 0){const o=ct(t._window),i=z();if(!i||i.isCollapsed()||!o)return!1;const s=pt(o,t.getRootElement()),l=s.anchorNode,a=s.focusNode;if(l!==null&&a!==null&&!si(t,l,a))return!1;n=am(i)}e.preventDefault();const r=e.clipboardData;return r!==null&&(um(r,n),!0)}const X1=[["text/html",nm],["application/x-lexical-editor",rm]];function am(t=z()){return(function(e,n){const r={"text/plain":""};for(const[o,i]of Object.entries(e))if(i){const s=J1(i,n);s!==null&&(r[o]=s)}return r})(Q1(),t)}function um(t,e){for(const[n]of X1)e[n]===void 0&&t.setData(n,"");for(const n in e){const r=e[n];r!==void 0&&t.setData(n,r)}}function Q1(t=Ke()){const e=bi(t,eE.name);return e?e.output:W1}const W1={"application/x-lexical-editor":[(t,e)=>t?rm(Ke(),t):e()],"text/html":[(t,e)=>t?nm(Ke(),t):e()],"text/plain":[(t,e)=>t?t.getTextContent():e()]};function J1(t,e){const n=r=>t[r]?t[r](e,n.bind(null,r-1)):null;return n(t.length-1)}const eE={name:"@lexical/clipboard/GetClipboardData"},tE={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},el=Symbol.for("@lexical/dragon/WindowState");function nE(t,e,n){const r=(function(o){let i=o[el];return i===void 0&&(i={dispose:()=>{},editors:new Map,installs:new Set},o[el]=i),i})(t);if(r.installs.size===0){const o=iE.bind(t);t.addEventListener("message",o,!0),r.dispose=()=>{t.removeEventListener("message",o,!0)}}if(r.installs.add(e),n){const o=r.editors.get(n)||new Set;o.add(e),r.editors.set(n,o)}return rE.bind(null,t,r,e,n)}function rE(t,e,n,r){if(r){const o=e.editors.get(r);o&&o.delete(n)&&o.size===0&&e.editors.delete(r)}e.installs.delete(n)&&e.installs.size===0&&(e.dispose(),delete t[el])}function cm(t){return t&&t.ownerDocument.defaultView}function oE(t){const e=OC(()=>cm(t.getRootElement()),n=>t.registerRootListener(r=>{n.value=cm(r)}));return Mu(()=>{const n=e.value;if(n)return nE(n,Symbol("@lexical/dragon/editorInstall"),t)})}function iE(t){if(t.origin!==this.location.origin)return;const e=(function(r){const o=r[el];if(o===void 0)return null;const i=Jr(io(r.document));return li(i)&&o.editors.has(i)?i:null})(this);if(e===null)return;const n=t.data;if(typeof n=="string"){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol==="nuanria_messaging"&&r.type==="request"){const o=r.payload;if(o&&o.functionId==="makeChanges"){const i=o.args;if(Array.isArray(i)){const[s,l,a,u,c,d]=i;if(![s,l,u,c].every(Number.isFinite)||typeof a!="string"&&a!==-1)return;e.update(()=>{const f=z();if(A(f)){const h=f.anchor;let g=h.getNode(),b=0,p=0;if(O(g)&&s>=0&&l>=0&&(b=s,p=s+l,f.setTextNodeRange(g,b,g,p)),typeof a!="string"||b===p&&a===""||(f.insertRawText(a),g=h.getNode()),O(g)){const y=g.getTextContentSize();b=Math.min(Math.max(u,0),y),p=u<0||c<0?b:Math.min(u+c,y),f.setTextNodeRange(g,b,g,p)}if(typeof d=="string"&&c>0&&!f.isCollapsed()){const y=tE[d];y!==void 0&&f.formatText(y)}t.stopImmediatePropagation()}})}}}}}const dm=W("DRAG_DROP_PASTE_FILE"),Zu=Nr("shadowRoot",{parse:Boolean});let tl=class extends Be{$config(){return this.config("quote",{extends:Be,importDOM:{blockquote:()=>({conversion:sE,priority:0})},stateConfigs:[{flat:!0,stateConfig:Zu}]})}isShadowRoot(){return Rr(this,Zu)}setIsShadowRoot(e){return No(this,Zu,e)}createDOM(e){const n=Ce().createElement("blockquote");return Wt(n,e.theme.quote),n}updateDOM(e,n,r){return!1}exportDOM(e){const{element:n}=super.exportDOM(e);if(fe(n)){this.isEmpty()&&n.append(Ce().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){return super.exportJSON()}static importJSON(e){return nl().updateFromJSON(e)}insertNewAfter(e,n){const r=Se();r.setTextFormat(e.format),r.setTextStyle(e.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){if(this.isShadowRoot()){for(const n of this.getChildren())this.insertBefore(n);return this.remove(),!0}const e=Se();return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function nl(t){const e=Bt(new tl);return t&&t.shadowRoot?e.setIsShadowRoot(!0):e}function Si(t){return t instanceof tl}let rl=class extends Be{__tag;$config(){return this.config("heading",{extends:Be,importDOM:{h1:()=>({conversion:yo,priority:0}),h2:()=>({conversion:yo,priority:0}),h3:()=>({conversion:yo,priority:0}),h4:()=>({conversion:yo,priority:0}),h5:()=>({conversion:yo,priority:0}),h6:()=>({conversion:yo,priority:0}),p:e=>{const n=e.firstChild;return n!==null&&fm(n)?{conversion:()=>({node:null}),priority:3}:null},span:e=>fm(e)?{conversion:()=>({node:Ci("h1")}),priority:3}:null}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",n){super(n),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){const n=this.getWritable();return n.__tag=e,n}createDOM(e){const n=this.__tag,r=Ce().createElement(n),o=e.theme.heading;if(o!==void 0){const i=o[n];Wt(r,i)}return r}updateDOM(e,n,r){return e.__tag!==this.__tag}exportDOM(e){const{element:n}=super.exportDOM(e);if(fe(n)){this.isEmpty()&&n.append(Ce().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,n=!0){const r=e?e.anchor.offset:0,o=this.getLastDescendant(),i=!o||e&&e.anchor.key===o.getKey()&&r===o.getTextContentSize()||!e?Se():Ci(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){const l=Se();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){const e=Se();this.getChildren().forEach(n=>e.append(n)),this.replace(e)}return!0}extractWithChild(){return!0}};function fm(t){return t.nodeName.toLowerCase()==="span"&&t.style.fontSize==="26pt"}function yo(t){const e=t.nodeName.toLowerCase();let n=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(n=Ci(e),yu(t,n),Os(n,t),fi(n,t)),{node:n}}function sE(t){const e=nl();return Os(e,t),yu(t,e),fi(e,t),{node:e}}function Ci(t="h1"){return Bt(new rl(t))}function Xu(t){return t instanceof rl}function hm(t){const e=hr(t);return oe(e)}function gm(t){const e=t.focus;return e.key==="root"&&e.offset===we().getChildrenSize()}function pm(t){const e=t.focus;return e.key==="root"&&e.offset===0}function mm(t,e){if(!t.isCollapsed())return!1;const n=e==="next";if(!(n?gm(t):pm(t)))return!1;const r=t.focus.offset;return ci(we().getChildAtIndex(n?r-1:r))}function bo(t,e,n,r){let o=!1,i=null;if(t.isCollapsed()&&t.anchor.type==="text"){const l=t.anchor.getNode();if(O(l)){i=l;const a=t.anchor.offset,u=a===l.getTextContentSize()&&l.getNextSibling()===null,c=a===0&&l.getPreviousSibling()===null;o=n==="end"&&u||n==="start"&&c||n==="both"&&(u||c)}}let s=!1;for(const[l,a]of Object.entries(r)){if(a==null||!a[e])continue;const u=l;if(a.onlyAtBoundary){if(!(o&&i&&O(i)&&i.hasFormat(u)))continue;s=!0}t.hasFormat(u)&&t.toggleFormat(u)}s&&t.setStyle("")}const lE={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function ol(t,e){return(function(n,r){if(!n.isCollapsed())return!1;const o=ut(n.focus,r),i=ke(o.origin,ui);if(!i)return!1;const s=n.focus.getNode();if(!i.is(s)&&!oo(s,i))return!1;const l=Pt(o,ye(i,r));if(l.getTextSlices().some(d=>d&&d.getTextContentSize()>0))return!1;const a=Pt(l.anchor.getSiblingCaret(),l.focus);let u=a.anchor.origin;for(const d of a){if(!Cn(d)||!d.origin.is(u.getParent()))return!1;u=d.origin}let c=i;for(const d of Bs(ye(i,r))){if(!d.origin.is(c.getParent())){if(ci(d.origin)){const f=ye(c,r);return Zr(Pt(f,f)),!0}break}if(!ui(d.origin))break;c=d.origin}return!1})(t,e)||(function(n,r){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;const o=ut(n.anchor,r).getNodeAtCaret();return!(!ui(o)||o.isInline()||(Zr(zs(et(rt(o,r)))),0))})(t,e)}function ym(t){return oe(t)&&!t.isInline()&&!t.isIsolated()&&t.isKeyboardSelectable()}function il(t){const e=Ua();e.add(t),ze(e)}function bm(t,e){if(!t.isCollapsed())return!1;const n=t.focus,r=n.getNode(),o=e?"previous":"next",i=ut(n,o);if(n.type==="element"&&P(r)&&be(r)){const y=i.getNodeAtCaret();return!(y===null||!ym(y))&&(il(y.__key),!0)}const s=ke(P(r)?r:r.getParentOrThrow(),y=>P(y)&&!y.isInline()&&be(y.getParent()));if(s===null)return!1;const l=ye(s,o).getNodeAtCaret();if(l===null||!ym(l))return!1;if(s.getTextContentSize()===0)return il(l.__key),!0;const a=Ke().getRootElement();if(a===null)return!1;const u=ct(a.ownerDocument.defaultView);if(u===null||u.rangeCount===0)return!1;const c=u.anchorNode,d=u.anchorOffset,f=u.focusNode,h=u.focusOffset;u.modify("move",e?"backward":"forward","line");const g=u.anchorNode,b=u.anchorOffset;if(g===null)return vm(u,c,d,f,h),!1;const p=hr(g);return vm(u,c,d,f,h),p===null?!1:(g===c&&b===d||!p.is(s)&&!oo(p,s))&&(il(l.__key),!0)}function vm(t,e,n,r,o){e!==null&&r!==null&&t.setBaseAndExtent(e,n,r,o)}function xm(t,e){if(!t.isCollapsed())return!1;const n=t.focus.getNode(),r=ke(P(n)?n:n.getParentOrThrow(),p=>P(p)&&!p.isInline());if(r===null)return!1;const o=Ke(),i=o.getRootElement();if(i===null)return!1;const s=i.ownerDocument.defaultView;if(s===null)return!1;let l=!1;for(const p of r.getChildren())if(P(p)&&p.isInline()){const y=o.getElementByKey(p.getKey());if(y!==null){const v=s.getComputedStyle(y).display;if(v==="inline-grid"||v==="inline-flex"){l=!0;break}}}if(!l)return!1;const a=ye(r,e?"previous":"next").getNodeAtCaret();if(a===null||!P(a)){if(e){const p=r.getFirstDescendant();O(p)?p.select(0,0):r.select(0,0)}else{const p=r.getLastDescendant();if(O(p)){const y=p.getTextContentSize();p.select(y,y)}else{const y=r.getChildrenSize();r.select(y,y)}}return!0}const u=o.getElementByKey(a.getKey());if(u===null)return!1;const c=ct(s);if(c===null||c.rangeCount===0)return!1;const d=c.getRangeAt(0).cloneRange();d.collapse(!0);const f=d.getBoundingClientRect(),h=u.getBoundingClientRect(),g=h.top+h.height/2;if(f.height>0){const p=Js(f.left,g,i);if(p!==null&&u.contains(p.node)){const y=i.ownerDocument.createRange();return y.setStart(p.node,p.offset),y.collapse(!0),t.applyDOMRange(y),t.dirty=!0,!0}}const b=e?a.getLastDescendant():a.getFirstDescendant();if(O(b)){const p=e?b.getTextContentSize():0;b.select(p,p)}else{const p=a.getChildrenSize();a.select(e?p:0,e?p:0)}return!0}function sl(t,e){const n=ye(t,e),r=n.getAdjacentCaret();r!==null&&P(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Zr(zs(n)):e==="next"?t.selectNext(0,0):t.selectPrevious()}function ll(t,e){const n=t.getNodes().map(i=>ye(i,"next")).sort(On),r=n[0],o=n[n.length-1];if(!r||!o)return!1;for(let i=0;i<n.length-1;i++)if(!n[i+1].origin.is(n[i].getNodeAtCaret()))return!1;return Zr(oi(Pt(vn(r),o),e)),vS(),!0}function _m(t,e,n){n.preventDefault(),n.stopPropagation();const r=t.getNodes();if(r.length===0)return!0;const o=r.map(a=>ye(a,"next")).sort(On),i=(e?o[0]:o[o.length-1]).origin,s=ke(i,a=>a!==i&&P(a)&&!a.isInline())??we(),l=e?0:s.getChildrenSize();return s.select(l,l),!0}function aE(t,e){return t.length>0&&!e}function uE(t,e=Zs(lE),n=Zs(aE)){return xt(t.registerCommand(Ef,r=>{const o=z();if(De(o)){const i=r.target;if(fe(i))for(const s of o.getNodes()){const l=t.getElementByKey(s.getKey());if(l!==null&&l.contains(i))return!1}return o.clear(),!0}return A(o)&&bo(o,"click","both",e.peek()),!1},re),t.registerCommand(rr,r=>{const o=z();return A(o)?(o.deleteCharacter(r),!0):!!De(o)&&(o.deleteNodes(),!0)},re),t.registerCommand(Go,r=>{const o=z();return!!A(o)&&(o.deleteWord(r),!0)},re),t.registerCommand(Ur,r=>{const o=z();return!!A(o)&&(o.deleteLine(r),!0)},re),t.registerCommand(Vr,r=>{const o=z();if(typeof r=="string")o!==null&&o.insertText(r);else{if(o===null)return!1;const i=r.dataTransfer;if(i!=null)qu(i,o);else if(A(o)){const s=r.data;return s&&o.insertText(s),!0}}return!0},re),t.registerCommand(Qi,()=>{const r=z();return!!A(r)&&(r.removeText(),!0)},re),t.registerCommand(hn,r=>{const o=z();return!(!A(o)&&!De(o))&&(Sh(o,r),!0)},re),t.registerCommand(L_,r=>{const o=z();return!(!A(o)&&!De(o))&&(dS(o,r),!0)},re),t.registerCommand(O_,r=>{const o=z();if(!A(o)&&!De(o))return!1;const i=o.getNodes();for(const s of i){const l=ke(s,a=>P(a)&&!a.isInline());l!==null&&l.setFormat(r)}return!0},re),t.registerCommand(zr,r=>{const o=z();return!!A(o)&&(o.insertLineBreak(r),!0)},re),t.registerCommand(jo,()=>{const r=z();return!!A(r)&&(r.insertParagraph(),!0)},re),t.registerCommand(I_,()=>{const r=Jo(),o=z();return A(o)&&(r.setFormat(o.format),r.setStyle(o.style)),gS([r]),!0},re),t.registerCommand(F_,()=>ep(r=>{const o=r.getIndent();r.setIndent(o+1)}),re),t.registerCommand(Nf,()=>ep(r=>{const o=r.getIndent();o>0&&r.setIndent(Math.max(0,o-1))}),re),t.registerCommand(Af,r=>{let o=z();if(De(o)){const i=o.getNodes();if(i.length>0){if(!r.shiftKey||!ll(o,"previous"))return r.preventDefault(),sl(i[0],"previous"),!0;o=z()}}return A(o)&&(pm(o)||!r.shiftKey&&ol(o,"previous")||!r.shiftKey&&bm(o,!0)||!r.shiftKey&&xm(o,!0))?(r.preventDefault(),!0):!1},re),t.registerCommand(Lf,r=>{let o=z();if(De(o)){const i=o.getNodes();if(i.length>0){if(!r.shiftKey||!ll(o,"next"))return r.preventDefault(),sl(i[0],"next"),!0;o=z()}}return A(o)&&(gm(o)||!r.shiftKey&&ol(o,"next")||!r.shiftKey&&bm(o,!1)||!r.shiftKey&&xm(o,!1))?(r.preventDefault(),!0):!1},re),t.registerCommand(Mf,r=>{let o=z();if(De(o)){const s=o.getNodes();if(s.length>0){const l=Hs(s[0])?"next":"previous";if(!r.shiftKey||!ll(o,l))return r.preventDefault(),sl(s[0],l),!0;o=z()}}if(!A(o))return!1;const i=Hs(o.anchor.getNode())?"next":"previous";if(mm(o,i)||!r.shiftKey&&ol(o,i))return r.preventDefault(),!0;if(r.shiftKey||bo(o,"arrow","start",e.peek()),Qg(o,!0)){const s=r.shiftKey;return r.preventDefault(),Jg(o,s,!0),!0}return!1},re),t.registerCommand(Df,r=>{let o=z();if(De(o)){const s=o.getNodes();if(s.length>0){const l=Hs(s[0])?"previous":"next";if(!r.shiftKey||!ll(o,l))return r.preventDefault(),sl(s[0],l),!0;o=z()}}if(!A(o))return!1;const i=Hs(o.anchor.getNode())?"previous":"next";if(mm(o,i)||!r.shiftKey&&ol(o,i))return r.preventDefault(),!0;if(r.shiftKey||bo(o,"arrow","end",e.peek()),Qg(o,!1)){const s=r.shiftKey;return r.preventDefault(),Jg(o,s,!1),!0}return!1},re),t.registerCommand(ka,r=>{const o=z();if(!De(o)&&hm(r.target))return!1;if(A(o)){if((function(i){if(!i.isCollapsed())return!1;const{anchor:s}=i;if(s.offset!==0)return!1;const l=s.getNode();if(Ie(l))return!1;const a=MC(l);return a.getIndent()>0&&(a.is(l)||l.is(a.getFirstDescendant()))})(o))return r.preventDefault(),t.dispatchCommand(Nf);if(un&&Kr)return!1}else if(!De(o))return!1;return r.preventDefault(),t.dispatchCommand(rr,!0)},re),t.registerCommand(Of,r=>{const o=z();return!(!De(o)&&hm(r.target))&&!(!A(o)&&!De(o))&&(r.preventDefault(),t.dispatchCommand(rr,!1))},re),t.registerCommand(Wi,r=>{let o=z();if(De(o)){const i=o.getNodes();i.length===1&&oe(i[0])&&!i[0].isInline()&&(o=i[0].selectNext())}if(!A(o))return!1;if(bo(o,"enter","both",e.peek()),r!==null){if((un||Io||Fo)&&Kr)return!1;if(r.preventDefault(),r.shiftKey)return t.dispatchCommand(zr,!1)}return t.dispatchCommand(jo)},re),t.registerCommand(Ff,()=>{const r=z();return!!A(r)&&(t.blur(),!0)},re),t.registerCommand(Rf,r=>{const[,o]=js(r);if(o.length>0){const i=r.clientX,s=r.clientY,l=Js(i,s,t.getRootElement());if(l!==null){const{offset:a,node:u}=l,c=hr(u);if(c!==null){const d=Va();if(O(c))d.anchor.set(c.getKey(),a,"text"),d.focus.set(c.getKey(),a,"text");else{const h=c.getParentOrThrow().getKey(),g=c.getIndexWithinParent()+1;d.anchor.set(h,g,"element"),d.focus.set(h,g,"element")}const f=Br(d);ze(f)}}return t.dispatchCommand(dm,o),r.preventDefault(),!0}return q1(r,t)},re),t.registerCommand(Bf,r=>{const[o]=js(r),i=z();return!(o&&!A(i))&&(A(i)&&!i.isCollapsed()&&r.dataTransfer!==null&&(um(r.dataTransfer,am(i)),j1(r.dataTransfer,t)),!0)},re),t.registerCommand(zf,r=>{const[o]=js(r),i=z();if(o&&!A(i))return!1;const s=r.clientX,l=r.clientY,a=Js(s,l,t.getRootElement());if(a!==null){const u=hr(a.node);oe(u)&&r.preventDefault()}return!0},re),t.registerCommand(Vf,()=>{const r=z();return OS(A(r)&&gi(r.anchor.getNode())!==null?r:null),!0},re),t.registerCommand(Ji,r=>(sm(t,En(r,ClipboardEvent)?r:null),!0),re),t.registerCommand(Ta,r=>((async function(o,i){i.update(()=>{const s=z();A(s)&&!s.isCollapsed()&&ds(s)},{discrete:!0,tag:Aa}),await sm(i,En(o,ClipboardEvent)?o:null),i.update(()=>{const s=z();A(s)?s.removeText():De(s)&&s.getNodes().forEach(l=>l.remove())},{tag:Aa})})(r,t),!0),re),t.registerCommand(Xi,r=>{const[,o,i]=js(r);return n.peek()(o,i)&&t.dispatchCommand(dm,o)?!0:so(r.target)&&su(r.target)?!1:z()!==null&&((function(s,l){s.preventDefault(),l.update(()=>{const a=z(),u=En(s,InputEvent)||En(s,KeyboardEvent)?null:s.clipboardData;u!=null&&a!==null&&qu(u,a)},{tag:uh})})(r,t),!0)},re),t.registerCommand(If,()=>{const r=z();return A(r)&&bo(r,"space","both",e.peek()),!1},re),t.registerCommand(Kf,()=>{const r=z();return A(r)&&bo(r,"tab","both",e.peek()),!1},re),t.registerCommand(Ea,r=>{const o=z();if(De(o))return _m(o,!1,r);if(!A(o))return!1;const{anchor:i}=o;if(i.type!=="element"||i.offset!==0)return!1;const s=i.getNode();if(!P(s))return!1;const l=s.getFirstChild();if(!oe(l)||!l.isInline())return!1;const a=s.getKey(),u=s.selectEnd();return r.shiftKey&&u.anchor.set(a,0,"element"),r.preventDefault(),r.stopPropagation(),!0},re),t.registerCommand(wa,r=>{const o=z();if(De(o))return _m(o,!0,r);if(!A(o))return!1;const{anchor:i,focus:s}=o,l=ke(s.getNode(),c=>P(c)&&!c.isInline());if(l===null)return!1;const a=l.getFirstChild();if(!oe(a)||!a.isInline()||ke(i.getNode(),c=>P(c)&&!c.isInline())!==l)return!1;const u=l.getKey();return(s.type!=="element"||s.key!==u||s.offset!==0)&&(o.focus.set(u,0,"element"),r.shiftKey||o.anchor.set(u,0,"element"),r.preventDefault(),r.stopPropagation(),!0)},re))}function Qu(t,e){const n={};for(const r of t){const o=e(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function Wu(t){const e=Qu(t,n=>n.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Sm=/[!-/:-@[-`{-~\s]/,Cm=/\s/,Ju=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,cE=/^\s{0,3}$/;function al(t){if(!Xr(t))return!1;const e=t.getFirstChild();return e==null||t.getChildrenSize()===1&&O(e)&&cE.test(e.getTextContent())}function ec(t){return t.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,n)=>String.fromCodePoint(Number(n)))}const Em=/^(\s*)(\d{1,})\.\s/,wm=/^(\s*)[-*+]\s/,dE=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,tc=/^(#{1,6})\s/,km=/^>\s/,Tm=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,nc=/^[ \t]*`{3,}$/,fE=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,hE=/^(?:\|)(.+)(?:\|)\s?$/;function gE(t){if(t[0]!=="|")return!1;const{length:e}=t;let n=1,r=0;for(;n<e;){let o=n;for(t[o]===" "&&o++,t[o]===":"&&o++;t[o]==="-";)o++;if(t[o]===":"&&o++,t[o]===" "&&o++,t[o]!=="|")break;r++,n=o+1}return r>0&&(n===e||n===e-1&&/\s/.test(t[n]))}const Pm=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,$m=/^<\/[a-z_][\w-]*\s*>/i,Dm=t=>new RegExp(`(?:${t.source})$`,t.flags),rc=Nr("mdListMarker",{parse:t=>typeof t=="string"&&/^[-*+]$/.test(t)?t:"-",resetOnCopyNode:!0}),Mm=Nr("mdCodeFence",{parse:t=>typeof t=="string"&&/^`{3,}$/.test(t)?t:"```",resetOnCopyNode:!0}),Am=Nr("mdCodeMeta",{parse:t=>typeof t=="string"?t:"",resetOnCopyNode:!0}),Lm=Nr("mdHardLineBreak",{parse:t=>typeof t=="string"&&/^(\\| {2,})$/.test(t)?t:"",resetOnCopyNode:!0});function oc(t){if(t.endsWith("\\")){let n=0;for(let r=t.length-1;r>=0&&t[r]==="\\";r--)n++;return n%2==1?[t.slice(0,-1),"\\"]:null}const e=t.match(/^(.*?\S)( {2,})$/);return e?[e[1],e[2]]:null}function pE(t){const e=t.getChildren(),n=e.length-1,r=e[n];if(!O(r))return null;const o=r.getTextContent(),i=oc(o);if(i!==null){const[s,l]=i;return r.setTextContent(s),l}return/^ {2,}$/.test(o)&&(function(s,l){for(let a=l-1;a>=0;a--){if(Ze(s[a]))return!1;if(/\S/.test(s[a].getTextContent()))return!0}return!1})(e,n)?(r.setTextContent(""),o):null}function Im(t){const e=Ln(),n=pE(t);return n!==null&&No(e,Lm,n),e}function ic(t){return Si(t)}function Fm(t,e){let n=0;for(;n<e&&(t[n]===" "||t[n]===" ");)n++;return t.slice(n)}function mE(t,e){const n=t.getLastChild();e&&go(n)&&No(n,Am,e)}const Om=t=>(e,n,r,o)=>{const i=t(r);i.append(...n),e.replace(i),o||i.select(0,0)};function sc(t){let e=0;for(const n of t)e+=n===" "?4-e%4:1;return e}let ul=null,cl=!1;function yE(t,e,n,r){for(let o=t.length;o<e;o++)t[o]=4*(o+1);t.length=e,t[e]=(function(o,i){let s=o[0];if(i==="check"){const l=s.slice(o[1].length).match(/^[-*+]\s/);l&&(s=o[1]+l[0])}return Math.min(sc(s),sc(o[1])+4)})(n,r)}const Km=t=>(e,n,r,o)=>{if(Xu(e)||!o&&ic(e))return!1;const i=e.getPreviousSibling(),s=e.getNextSibling(),l=Sr(t==="check"?/^x$/i.test(r[3]||""):void 0),a=r[0].trim()[0],u=t!=="bullet"&&t!=="check"||a!==rc.parse(a)?void 0:a,c=ul;let d=i;if(c!==null){if(cl)for(;d!==null&&al(d);)d=d.getPreviousSibling();te(d)||(c.length=0)}const f=c===null||c.length===0?(function(g){const b=g.match(/\t/g),p=g.match(/ /g);let y=0;return b&&(y+=b.length),p&&(y+=Math.floor(p.length/4)),y})(r[1]):(function(g,b){const p=sc(b);for(let y=g.length-1;y>=0;y--)if(p>=g[y])return y+1;return 0})(c,r[1]);if(te(s)&&s.getListType()===t){const g=s.getFirstChild();g!==null?g.insertBefore(l):s.append(l),t==="number"&&f===0&&s.setStart(Number(r[2])),e.remove()}else if(te(d)&&(d.getListType()===t||f>0))d.append(l),e.remove();else{const g=kn(t,t==="number"?Number(r[2]):void 0);g.append(l),e.replace(g)}l.append(...n),o||l.select(0,0),f&&(l.setIndent(f),(function(g,b,p){const y=g.getParent();if(!te(y)||y.getListType()===b)return;const v=y.getParent();if(!le(v))return;const x=kn(b,b==="number"?Number(p[2]):void 0),_=g.getPreviousSibling()===null;x.append(g);const C=Sr();C.append(x),_?v.insertBefore(C):v.insertAfter(C),y.getChildrenSize()===0&&v.remove()})(l,t,r));const h=l.getParent();u&&te(h)&&No(h,rc,u),c!==null&&yE(c,f,r,t)},lc=(t,e,n,r)=>{const o=[],i=t.getChildren();let s=0;for(const l of i)if(le(l)){if(l.getChildrenSize()===1){const h=l.getFirstChild();if(te(h)){const g=lc(h,e,n+1,r);g&&o.push(g);continue}}if(r&&!l.getChildren().some(h=>h.isSelected(r)))continue;const a=" ".repeat(4*n),u=t.getListType(),c=Rr(t,rc),d=u==="number"?`${t.getStart()+s}. `:u==="check"?`${c} [${l.getChecked()?"x":" "}] `:c+" ";let f=e(l);u!=="number"&&(f=f.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),o.push(a+d+f),s++}return o.join(`
13
+ `)},bE=Om(t=>{const e="h"+t[1].length;return Ci(e)}),Nm={dependencies:[rl],export:(t,e)=>{if(!Xu(t))return null;const n=Number(t.getTag().slice(1));return"#".repeat(n)+" "+e(t)},regExp:tc,replace:(t,e,n,r)=>!(!r&&ic(t))&&bE(t,e,n,r),triggerOnEnter:!0,type:"element"},Rm={dependencies:[tl],export:(t,e)=>{if(!Si(t))return null;const n=e(t).split(`
14
+ `),r=[];for(const o of n)r.push("> "+o);return r.join(`
15
+ `)},regExp:km,replace:(t,e,n,r)=>{if(r){const i=t.getPreviousSibling();if(Si(i))return i.splice(i.getChildrenSize(),0,[Im(i),...e]),void t.remove()}const o=nl();o.append(...e),t.replace(o),r||o.select(0,0)},triggerOnEnter:!0,type:"element"},dl={dependencies:[Hu],export:t=>{if(!go(t))return null;const e=t.getTextContent();let n=Rr(t,Mm);if(e.indexOf(n)>-1){const i=e.match(/`{3,}/g);if(i){const s=Math.max(...i.map(l=>l.length));n="`".repeat(s+1)}}const r=t.getLanguage()||"",o=r?Rr(t,Am):"";return n+r+(o?" "+o:"")+(e?`
16
+ `+e:"")+`
17
+ `+n},handleImportAfterStartMatch:({lines:t,rootNode:e,startLineIndex:n,startMatch:r})=>{const o=r[1],i=o.trim().length,s=t[n],l=r.index+o.length,a=s.slice(l),u=new RegExp(`\`{${i},}$`);if(u.test(a)){const f=a.match(u),h=a.slice(0,a.lastIndexOf(f[0])),g=[...r];return g[2]="",dl.replace(e,null,g,f,[h],!0),[!0,n]}const c=new RegExp(`^[ \\t]*\`{${i},}$`);for(let f=n+1;f<t.length;f++){const h=t[f];if(c.test(h)){const g=h.match(c),b=t.slice(n+1,f),p=r[2]?s.slice(r[0].length).trim():"";return b.unshift(p?"":s.slice(r[0].length)),dl.replace(e,null,r,g,b,!0),mE(e,p),[!0,f]}}const d=t.slice(n+1);return d.unshift(s.slice(r[0].length)),dl.replace(e,null,r,null,d,!0),[!0,t.length-1]},regExpEnd:{optional:!0,regExp:nc},regExpStart:Tm,replace:(t,e,n,r,o,i)=>{let s,l;const a=n[1]?n[1].trim():"```",u=n[2]||void 0,c=n[1]?n[1].length-n[1].trimStart().length:0;if(!e&&o){if(o.length===1)r?(s=Bn(u),l=Fm(o[0],c)):(s=Bn(u),l=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{for(s=Bn(u),o.length>0&&(o[0].trim().length===0?o.shift():o[0].startsWith(" ")&&(o[0]=o[0].slice(1)));o.length>0&&!o[o.length-1].length;)o.pop();l=o.map(f=>Fm(f,c)).join(`
18
+ `)}No(s,Mm,a);const d=He(l);s.append(d),t.append(s)}else if(e){if(!i&&ic(t))return!1;Om(d=>Bn(d?d[2]:void 0))(t,e,n,i)}},type:"multiline-element"},Bm={dependencies:[Rn,Nn],export:(t,e,n)=>te(t)?lc(t,e,0,n):null,regExp:wm,replace:Km("bullet"),triggerOnEnter:!0,type:"element"},zm={dependencies:[Rn,Nn],export:(t,e,n)=>te(t)?lc(t,e,0,n):null,regExp:Em,replace:Km("number"),triggerOnEnter:!0,type:"element"},vE={format:["code"],tag:"`",type:"text-format"},xE={format:["highlight"],tag:"==",type:"text-format"},Vm={format:["bold","italic"],tag:"***",type:"text-format"},Um={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},Hm={format:["bold"],tag:"**",type:"text-format"},jm={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Gm={format:["strikethrough"],tag:"~~",type:"text-format"},qm={format:["italic"],tag:"*",type:"text-format"},Ym={format:["italic"],intraword:!1,tag:"_",type:"text-format"};function Zm(t){return t.replace(/&(?=#\d+;|#[Xx][\dA-Fa-f]+;|[A-Za-z][\dA-Za-z]*;)/g,"&#38;")}const Xm={dependencies:[wn],export:(t,e,n)=>{if(!$t(t)||ho(t))return null;const r=e(t);let o=t.getTitle();o!=null&&(o=Zm(o).replace(/([\\"])/g,"\\$1"));const i=t.getURL(),s=Zm(i),l=i===""||/\s/.test(i)?`<${s.replace(/([\\<>])/g,"\\$1").replace(/\r/g,"&#13;").replace(/\n/g,"&#10;")}>`:s.replace(/([\\()])/g,"\\$1").replace(/^</,"\\<");return o?`[${r}](${l} "${o}")`:`[${r}](${l})`},importRegExp:/(?:\[(.+?)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))$/,replace:(t,e)=>{if(ke(t,$t))return;const[,n,r,o,i,s,l]=e,a=ec(r??o??""),u=i??s??l,c=u!=null?ec(u):void 0,d=Ws(a,{title:c}),f=n.split("[").length-1,h=n.split("]").length-1;let g=n,b="";if(f<h)return;if(f>h){const y=n.split("[");b="["+y[0],g=y.slice(1).join("[")}const p=He(g);return p.setFormat(t.getFormat()),d.append(p),t.replace(d),b&&d.insertBefore(He(b)),p},trigger:")",type:"text-match"},_E=[Nm,Rm,Bm,zm],SE=[dl],CE=[vE,Vm,Um,Hm,jm,xE,qm,Ym,Gm],EE=[Xm],fl=[..._E,...SE,...CE,...EE];function wE(t,e=!1){const n=t.split(`
19
+ `);let r=0;const o=[];for(let i=0;i<n.length;i++){const s=n[i],l=s.trimEnd(),a=o[o.length-1],u=i<n.length-1?oc(s):null,c=a!==void 0&&oc(a)!==null;if(fE.test(l))o.push(l);else if(r===0){{const d=l.match(Tm);if(d){r=d[1].trim().length,o.push(l);continue}}l===""||a===""||!a||tc.test(a)||tc.test(l)||km.test(l)||Em.test(l)||wm.test(l)||dE.test(l)||hE.test(l)||gE(l)||c||!e||Pm.test(l)||$m.test(l)||Dm($m).test(a)||Dm(Pm).test(a)||nc.test(a)?o.push(!e&&l!==""||u!==null?s:l):o[o.length-1]=a+" "+(u===null?l:s).trimStart()}else{if(nc.test(l)&&l.trim().length>=r){r=0,o.push(l);continue}o.push(s)}}return o.join(`
20
+ `)}function kE(t,e,n,r,o){for(const i of e){if(!i.export)continue;const s=i.export(t,l=>hl(l,n,r,void 0,void 0,o));if(s!=null)return s}return P(t)?hl(t,n,r,void 0,void 0,o):oe(t)?t.getTextContent():null}function hl(t,e,n,r,o,i=!1){const s=[],l=t.getChildren();r||(r=[]),o||(o=[]);e:for(const a of l){for(const u of n){if(!u.export)continue;const c=u.export(a,d=>hl(d,e,n,r,[...o,...r],i),(d,f)=>Qm(d,f,e,r,o,i));if(c!=null){s.push(c);continue e}}Ze(a)?s.push(TE(a)):O(a)?s.push(Qm(a,a.getTextContent(),e,r,o,i)):P(a)?s.push(hl(a,e,n,r,o,i)):oe(a)&&s.push(a.getTextContent())}return s.join("")}function TE(t){return Rr(t,Lm)+`
21
+ `}function Qm(t,e,n,r,o,i=!1){const s=t.hasFormat("code");let l,a,u,c,d=e;if(s||(d=i?d.replace(/([*_`~])/g,"\\$1"):d.replace(/([*_`~\\])/g,"\\$1")),s){const{fence:v,padded:x}=(function(_){const C=_.match(/`+/g),T=C?Math.max(...C.map(k=>k.length)):0;return{fence:"`".repeat(T+1),padded:_.length===0||_.includes("`")||/^\s/.test(_)&&/\s$/.test(_)?` ${_} `:_}})(e);l="",u="",a=v+x+v,c=!1}else{const v=d.match(/^(\s*)(.*?)(\s*)$/s)||["","",d,""];l=v[1],a=v[2],u=v[3],c=a===""}let f="",h="",g="";const b=Wm(t,!0),p=Wm(t,!1),y=new Set;for(const v of n){const x=v.format[0],_=v.tag;x!=="code"&&(c||!Jm(t,x)||y.has(x)||(y.add(x),Jm(b,x)&&r.find(C=>C.tag===_)||(r.push({format:x,tag:_}),f+=_)))}for(let v=0;v<r.length;v++){const x=ac(t,r[v].format),_=ac(p,r[v].format);if(x&&_)continue;const C=[...r];for(;C.length>v;){const T=C.pop();o&&T&&o.find(k=>k.tag===T.tag)||(T&&typeof T.tag=="string"&&(x?_||(g+=T.tag):h+=T.tag),r.pop())}break}return c&&!t.hasFormat("code")?h+d:h+l+f+a+g+u}function Wm(t,e){const n=e?t.getPreviousSibling():t.getNextSibling();return O(n)?n:null}function ac(t,e){return O(t)&&t.hasFormat(e)}function Jm(t,e){return!!ac(t,e)&&(e==="code"||!t||!/^\s*$/.test(t.getTextContent()))}function PE(t,e){const n=t.getTextContent(),r=e.transformersByTag["`"],o=[];let i=null;if(r){const d=(function(f){const h=v=>{let x=0;for(let _=v-1;_>=0&&f[_]==="\\";_--)x++;return x%2==1},g=[];let b=0;for(;b<f.length;)if(f[b]==="`"){let v=1;for(;b+v<f.length&&f[b+v]==="`";)v++;g.push({index:b,length:v}),b+=v}else b++;const p=[];let y=0;for(;y<g.length;){const v=g[y];if(h(v.index)){y++;continue}let x=-1;for(let T=y+1;T<g.length;T++)if(g[T].length===v.length){x=T;break}if(x===-1){y++;continue}const _=g[x];let C=f.slice(v.index+v.length,_.index);C.length>=2&&C.startsWith(" ")&&C.endsWith(" ")&&/[^ ]/.test(C)&&(C=C.slice(1,-1)),p.push({content:C,endIndex:_.index+_.length,startIndex:v.index}),y=x+1}return p})(n);for(const f of d)i||(i={content:f.content,endIndex:f.endIndex,startIndex:f.startIndex,tag:"`"}),o.push({end:f.endIndex,start:f.startIndex})}const s=(function(d,f,h=[]){const g=[],b=new Set(Object.keys(f.transformersByTag).filter(x=>x[0]!=="`").map(x=>x[0])),p=x=>{let _=0;for(let C=x-1;C>=0&&d[C]==="\\";C--)_++;return _%2==1},y=x=>h.some(_=>x>=_.start&&x<_.end);let v=0;for(;v<d.length;){const x=d[v];if(!b.has(x)||p(v)||y(v)){v++;continue}let _=1;for(;v+_<d.length&&d[v+_]===x;)_++;const C=ey(x,d,v,_,!0),T=ey(x,d,v,_,!1);(C||T)&&g.push({active:!0,canClose:T,canOpen:C,char:x,index:v,length:_}),v+=_}return g})(n,e,o),l=s.length>0?(function(d,f,h){const g={};let b=0,p=null;for(;b<f.length;){const y=f[b];if(!y.active||!y.canClose||y.length===0){b++;continue}const v=`${y.char}${y.canOpen}${y.length%3}`,x=g[v]??-1;let _=!1;for(let C=b-1;C>x;C--){const T=f[C];if(!T.active||!T.canOpen||T.length===0||T.char!==y.char||(T.canClose||y.canOpen)&&(T.length+y.length)%3==0&&T.length%3!=0&&y.length%3!=0)continue;const k=Math.min(T.length,y.length),S=Object.keys(h.transformersByTag).filter(M=>M[0]===T.char&&M.length<=k).sort((M,B)=>B.length-M.length)[0];if(!S)continue;_=!0;const w=S.length,D={content:d.slice(T.index+T.length,y.index),endIndex:y.index+w,startIndex:T.index+(T.length-w),tag:S};(!p||D.startIndex<p.startIndex||D.startIndex===p.startIndex&&D.endIndex>p.endIndex)&&(p=D);for(let M=C+1;M<b;M++)f[M].active=!1;T.length-=w,y.length-=w,T.active=T.length>0,y.length>0?y.index+=w:(y.active=!1,b++);break}_||(g[v]=b-1,y.canOpen||(y.active=!1),b++)}return p})(n,s,e):null;let a=null,u=null;if(i&&l?l.startIndex<=i.startIndex&&l.endIndex>=i.endIndex?(a=l,u=e.transformersByTag[l.tag]):(a=i,u=r):i?(a=i,u=r):l&&(a=l,u=e.transformersByTag[l.tag]),!a||!u)return null;const c=[n.slice(a.startIndex,a.endIndex),a.tag,a.content];return c.index=a.startIndex,c.input=n,{endIndex:a.endIndex,isCodeSpan:u===r,match:c,startIndex:a.startIndex,transformer:u}}function ey(t,e,n,r,o){if(!ty(e,n,r,o))return!1;if(t==="*")return!0;if(t==="_"){if(!ty(e,n,r,!o))return!0;const i=o?e[n-1]:e[n+r];return i!==void 0&&Ju.test(i)}return!0}function ty(t,e,n,r){const o=t[e-1],i=t[e+n],[s,l]=r?[i,o]:[o,i];return s!==void 0&&!Cm.test(s)&&(!Ju.test(s)||l===void 0||Cm.test(l)||Ju.test(l))}function zn(t){return O(t)&&!t.hasFormat("code")}function Cr(t,e,n){let r=PE(t,e),o=(function(s,l){const a=s;let u,c,d,f;for(const h of l){if(!h.replace||!h.importRegExp)continue;const g=a.getTextContent().match(h.importRegExp);if(!g)continue;const b=g.index||0,p=h.getEndIndex?h.getEndIndex(a,g):b+g[0].length;p!==!1&&(u===void 0||c===void 0||b<u&&(p>c||p<=u))&&(u=b,c=p,d=h,f=g)}return u===void 0||c===void 0||d===void 0||f===void 0?null:{endIndex:c,match:f,startIndex:u,transformer:d}})(t,n);if(r&&o&&(r.isCodeSpan?o.startIndex<=r.startIndex&&o.endIndex>=r.endIndex?r=null:o=null:r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(l,a,u,c,d){const f=l.getTextContent();let h,g,b;if(d[0]===f?h=l:a===0?[h,g]=l.splitText(u):[b,h,g]=l.splitText(a,u),h.setTextContent(d[2]),c)for(const p of c.format)h.hasFormat(p)||h.toggleFormat(p);return{nodeAfter:g,nodeBefore:b,transformedNode:h}})(t,r.startIndex,r.endIndex,r.transformer,r.match);zn(s.nodeAfter)&&Cr(s.nodeAfter,e,n),zn(s.nodeBefore)&&Cr(s.nodeBefore,e,n),zn(s.transformedNode)&&Cr(s.transformedNode,e,n)}else if(o){const s=(function(l,a,u,c,d){let f,h,g;return a===0?[f,h]=l.splitText(u):[g,f,h]=l.splitText(a,u),c.replace?{nodeAfter:h,nodeBefore:g,transformedNode:c.replace(f,d)||void 0}:null})(t,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;zn(s.nodeAfter)&&Cr(s.nodeAfter,e,n),zn(s.nodeBefore)&&Cr(s.nodeBefore,e,n),zn(s.transformedNode)&&Cr(s.transformedNode,e,n)}const i=ec(t.getTextContent());t.setTextContent(i)}function $E(t,e,n,r=!1){const o=Wu(n),i=(function(u){const c={},d={},f=[];for(const h of u){const{tag:g}=h;c[g]=h;const b=g.replace(/(\*|\^|\+)/g,"\\$1");f.push(b),g.length===1?d[g]=g==="`"?new RegExp("(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(^|[^\\\\${b}])(${b})((\\\\${b})?.*?[^${b}\\s](\\\\${b})?)(${b})(?![\\\\${b}])`):d[g]=new RegExp(`(^|[^\\\\])(${b})((\\\\${b})?.*?[^\\s](\\\\${b})?)(${b})(?!\\\\)`)}return{fullMatchRegExpByTag:d,openTagsRegExp:new RegExp(`(${f.join("|")})`,"g"),transformersByTag:c}})(o.textFormat),s=t.split(`
22
+ `),l=s.length;(function(u,c){const d=ul,f=cl;ul=[],cl=u;try{return c()}finally{ul=d,cl=f}})(!r,()=>{for(let u=0;u<l;u++){const c=s[u],[d,f]=DE(s,u,o.multilineElement,e);d?u=f:ME(c,e,o.element,i,o.textMatch,r)}});const a=e.getChildren();for(const u of a)if(!r&&al(u)&&e.getChildrenSize()>1)u.remove();else if(P(u))for(const c of u.getAllTextNodes())AE(c)}function DE(t,e,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:l,replace:a}=o,u=t[e].match(l);if(!u)continue;if(i){const g=i({lines:t,rootNode:r,startLineIndex:e,startMatch:u,transformer:o});if(g===null)continue;if(g)return g}const c=typeof s=="object"&&"regExp"in s?s.regExp:s,d=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let f=e;const h=t.length;for(;f<h;){const g=c?t[f].match(c):null;if(!g&&(!d||d&&f<h-1)){f++;continue}if(g&&e===f&&g.index===u.index){f++;continue}const b=[];if(g&&e===f)b.push(t[e].slice(u[0].length,-g[0].length));else for(let p=e;p<=f;p++)if(p===e){const y=t[p].slice(u[0].length);b.push(y)}else if(p===f&&g){const y=t[p].slice(0,-g[0].length);b.push(y)}else b.push(t[p]);if(a(r,null,u,g,b,!0)!==!1)return[!0,f];break}}return[!1,e]}function ME(t,e,n,r,o,i){const s=He(t),l=Se();l.append(s),e.append(l);for(const{regExp:a,replace:u}of n){const c=t.match(a);if(c&&(s.setTextContent(t.slice(c[0].length)),u(l,[s],c,!0)!==!1))break}if(Cr(s,r,o),l.getParent()!==null&&t.length>0){const a=l.getPreviousSibling();if(!i&&(Xr(a)||Si(a)||te(a))){let u=a;if(te(a)){const c=a.getLastDescendant();u=c==null?null:ke(c,le)}u!=null&&u.getTextContentSize()>0&&(u.splice(u.getChildrenSize(),0,[Im(u),...l.getChildren()]),l.remove())}}}function AE(t){if(ir(t))return;const e=t.getTextContent();if(!e.includes(" "))return;const n=t.getFormat(),r=t.getStyle(),o=[];let i=0;for(let s=e.indexOf(" ");s!==-1;s=e.indexOf(" ",s+1))s>i&&o.push(He(e.slice(i,s)).setFormat(n).setStyle(r)),o.push(Jo()),i=s+1;i<e.length&&o.push(He(e.slice(i)).setFormat(n).setStyle(r)),t.getParentOrThrow().splice(t.getIndexWithinParent(),1,o)}function LE(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ny(t,e,n,r,o){const i=t.getParent();if(!be(i)||t.getFirstChild()!==e)return!1;const s=e.getTextContent();if(!o&&s[n-1]!==" ")return!1;for(const{regExp:l,replace:a}of r){const u=s.match(l),c=o||u&&u[0].endsWith(" ")?n:n-1;if(u&&u[0].length===c){const d=e.getNextSiblings(),[f,h]=e.splitText(n);if(a(t,h?[h,...d]:d,u,!1)!==!1)return f.remove(),!0}}return!1}function ry(t,e,n,r,o){const i=t.getParent();if(!be(i)||t.getFirstChild()!==e)return!1;const s=e.getTextContent();if(!o&&s[n-1]!==" ")return!1;for(const{regExpStart:l,replace:a,regExpEnd:u}of r){if(u&&!("optional"in u)||u&&"optional"in u&&!u.optional)continue;const c=s.match(l);if(c){const d=o||c[0].endsWith(" ")?n:n-1;if(c[0].length!==d)continue;const f=e.getNextSiblings(),[h,g]=e.splitText(n);if(a(t,g?[g,...f]:f,c,null,null,!1)!==!1)return h.remove(),!0}}return!1}function IE(t,e){let n=0;const r=t.getTextContent();for(let o=0;o<e;o++)r[o]==="`"&&n++;return n%2!=0}function oy(t,e,n){const r=n.length;for(let o=e;o>=r;o--){const i=o-r;if(sy(t,i,n,0,r)&&t[i+r]!==" ")return i}return-1}function iy(t){const e=t.getNode();let n=0;if(O(e))n=t.offset;else if(P(e))for(const r of e.getChildren().slice(0,t.offset))n+=r.getTextContentSize();for(let r=e.getPreviousSibling();r!==null;r=r.getPreviousSibling())n+=r.getTextContentSize();return n}function sy(t,e,n,r,o){for(let i=0;i<o;i++)if(t[e+i]!==n[r+i])return!1;return!0}function FE(t,e=fl){const n=Wu(e),r=n.element.filter(a=>a.triggerOnEnter),o=Qu(n.textFormat,({tag:a})=>a[a.length-1]),i=Qu(n.textMatch,({trigger:a})=>a),s=new Set([" "]);for(const a of n.textFormat)s.add(a.tag.slice(-1));for(const a of n.textMatch)a.trigger!==void 0&&s.add(a.trigger);for(const a of e){const u=a.type;if(u==="element"||u==="text-match"||u==="multiline-element"){const c=a.dependencies;for(const d of c)t.hasNode(d)||LE(173,d.getType())}}const l=(a,u,c)=>!!ny(a,u,c,n.element)||!!ry(a,u,c,n.multilineElement)||!!(function(d,f,h){let g=d.getTextContent();const b=h[g[f-1]];if(b==null)return!1;f<g.length&&(g=g.slice(0,f));for(const p of b){if(!p.replace||!p.regExp)continue;const y=g.match(p.regExp);if(y===null)continue;const v=y.index||0,x=v+y[0].length;let _;return v===0?[_]=d.splitText(x):[,_]=d.splitText(v,x),_.selectNext(0,0),p.replace(_,y),!0}return!1})(u,c,i)||!!(function(d,f,h){const g=d.getTextContent(),b=f-1,p=g[b],y=h[p];if(!y)return!1;for(const v of y){const{tag:x}=v,_=x.length,C=b-_+1;if(_>1&&!sy(g,C,x,0,_)||g[C-1]===" ")continue;const T=g[b+1];if(v.intraword===!1&&T&&!Sm.test(T))continue;const k=d;let S=k,w=oy(g,C,x),D=S;for(;w<0&&(D=D.getPreviousSibling())&&!Ze(D);)if(O(D)){if(D.hasFormat("code"))continue;const $=D.getTextContent();S=D,w=oy($,$.length,x)}if(w<0||S===k&&w+_===C)continue;const M=S.getTextContent();if(w>0&&M[w-1]===p)continue;const B=M[w-1];if(v.intraword===!1&&B&&!Sm.test(B)||!v.format.includes("code")&&IE(S,w))continue;const V=k.getTextContent(),E=V.slice(0,C)+V.slice(b+1);k.setTextContent(E);const F=S===k?E:M;S.setTextContent(F.slice(0,w)+F.slice(w+_));const U=z(),I=Va();ze(I);const Q=b-_*(S===k?2:1)+1;I.anchor.set(S.__key,w,"text"),I.focus.set(k.__key,Q,"text");for(const $ of v.format)I.formatText($,cn[$]);I.anchor.set(I.focus.key,I.focus.offset,I.focus.type);for(const $ of v.format)I.hasFormat($)&&I.toggleFormat($);return A(U)&&(I.format=U.format),!0}return!1})(u,c,o);return xt(t.registerUpdateListener(({tags:a,dirtyLeaves:u,editorState:c,prevEditorState:d})=>{if(a.has(ch)||a.has(ss)||t.isComposing())return;const f=a.has(Wo),h=c.read(z),g=d.read(z);if(!A(g)||!A(h)||!h.isCollapsed()||h.is(g)&&!f)return;const b=h.anchor.key,p=h.anchor.offset,y=c._nodeMap.get(b);if(O(y)&&u.has(b)&&(f||p===1||!(c.read(()=>iy(h.anchor))>d.read(()=>iy(g.anchor))+1))){if(f){const v=c.read(()=>y.getTextContent())[p-1];if(!s.has(v))return}t.update(()=>{if(!zn(y))return;const v=y.getParent();v===null||go(v)||l(v,y,h.anchor.offset)&&pr(ah)})}}),t.registerCommand(Wi,a=>{if(a!==null&&a.shiftKey)return!1;const u=z();if(!A(u)||!u.isCollapsed())return!1;const c=u.anchor.offset,d=u.anchor.getNode();if(!O(d)||!zn(d))return!1;const f=d.getParent();return f===null||go(f)?!1:c===d.getTextContent().length&&!(!ry(f,d,c,n.multilineElement,!0)&&!ny(f,d,c,r,!0))&&(a!==null&&a.preventDefault(),!0)},cr))}function ly(t,e=fl,n,r=!1,o=!1){const i=r?t:wE(t,o),s=we();s.clear(),$E(i,s,e,r),z()!==null&&s.selectStart()}function ay(t=fl,e,n=!1){return(function(o,i=!1){const s=Wu(o),l=[...s.multilineElement,...s.element],a=!i,u=s.textFormat.filter(c=>c.format.length===1).sort((c,d)=>Number(c.format.includes("code"))-Number(d.format.includes("code")));return c=>{const d=[],f=(c||we()).getChildren();for(let h=0;h<f.length;h++){const g=f[h],b=kE(g,l,u,s.textMatch,i);b!=null&&d.push(a&&h>0&&!al(g)&&!al(f[h-1])?`
23
+ `.concat(b):b)}return d.join(`
24
+ `)}})(t,n)(e)}const OE=[{dependencies:[Nu],export:t=>qC(t)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(t,e,n,r)=>{const o=mp();r||t.getNextSibling()!=null?t.replace(o):t.insertBefore(o),o.selectNext()},triggerOnEnter:!0,type:"element"},...fl];function KE({transformers:t=OE}){const[e]=Vt();return m.useEffect(()=>FE(e,t),[e,t]),null}const NE=it?m.useLayoutEffect:m.useEffect;function RE(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}function BE(){return(function(t){const[e]=Vt(),n=m.useMemo(()=>t(e),[e,t]),[r,o]=m.useState(()=>n.initialValueFn()),i=m.useRef(r);return NE(()=>{const{initialValueFn:s,subscribe:l}=n,a=s();return i.current!==a&&(i.current=a,o(a)),l(u=>{i.current=u,o(u)})},[n,t]),r})(RE)}const zE={name:"@lexical/react/ReactProvider"};function VE(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function UE(t,e){const[n,r]=m.useMemo(()=>[s=>t.registerDecoratorListener(s),()=>t.getDecorators()],[t]),o=m.useSyncExternalStore(n,r,r),i=(function(s){const[l,a]=m.useMemo(()=>[s.registerRootListener.bind(s),s.getRootElement.bind(s)],[s]);return m.useSyncExternalStore(l,a,a)})(t);return m.useMemo(()=>{const s=a=>t._onError(a),l=[];for(const a in o){const u=t.getElementByKey(a);if(u!==null){const c=R.jsx(e,{onError:s,children:R.jsx(m.Suspense,{fallback:null,children:o[a]})});l.push(Fr.createPortal(c,u,a))}}return l},[e,o,t,i])}function HE({editor:t,ErrorBoundary:e}){return UE(t,e)}function jE({editor:t,ErrorBoundary:e}){return(function(n){const r=pp.maybeFromEditor(n);if(r&&r.hasExtensionByName(zE.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&VE(320,o);return!0}return!1})(t)?null:R.jsx(HE,{editor:t,ErrorBoundary:e})}const uy=it?m.useLayoutEffect:m.useEffect;function cy(t){return t.read("latest",Hg(t.isComposing()))}function GE({contentEditable:t,placeholder:e=null,ErrorBoundary:n}){const[r]=Vt();return(function(o){uy(()=>xt(uE(o),oE(o)),[o])})(r),R.jsxs(R.Fragment,{children:[t,R.jsx(qE,{content:e}),R.jsx(jE,{editor:r,ErrorBoundary:n})]})}function qE({content:t}){const[e]=Vt(),n=(function(o){const[i,s]=m.useState(()=>cy(o));return uy(()=>{function l(){const a=cy(o);s(a)}return l(),xt(o.registerUpdateListener(()=>{l()}),o.registerEditableListener(()=>{l()}))},[o]),i})(e),r=BE();return n?typeof t=="function"?t(r):t:null}function Jt(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const pe=typeof document<"u"?m.useLayoutEffect:()=>{},gl={prefix:String(Math.round(Math.random()*1e10)),current:0},dy=m.createContext(gl),YE=m.createContext(!1);let ZE=!!(typeof window<"u"&&window.document&&window.document.createElement),uc=new WeakMap;function XE(t=!1){let e=m.useContext(dy),n=m.useRef(null);if(n.current===null&&!t){let r=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(r){let o=uc.get(r);o==null?uc.set(r,{id:e.current,state:r.memoizedState}):r.memoizedState!==o.state&&(e.current=o.id,uc.delete(r))}n.current=++e.current}return n.current}function QE(t){let e=m.useContext(dy);e===gl&&!ZE&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=XE(!!t),r=e===gl&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${e.prefix}`;return t||`${r}-${n}`}function WE(t){let e=m.useId(),[n]=m.useState(Ei()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${gl.prefix}`;return t||`${r}-${e}`}const JE=typeof m.useId=="function"?WE:QE;function ew(){return!1}function tw(){return!0}function nw(t){return()=>{}}function Ei(){return typeof m.useSyncExternalStore=="function"?m.useSyncExternalStore(nw,ew,tw):m.useContext(YE)}function rw(t){let[e,n]=m.useState(t),r=m.useRef(e),o=m.useRef(null),i=m.useRef(()=>{if(!o.current)return;let l=o.current.next();if(l.done){o.current=null;return}r.current===l.value?i.current():n(l.value)});pe(()=>{r.current=e,o.current&&i.current()});let s=m.useCallback(l=>{o.current=l(r.current),i.current()},[i]);return[e,s]}let ow=!!(typeof window<"u"&&window.document&&window.document.createElement),vo=new Map,xo;typeof FinalizationRegistry<"u"&&(xo=new FinalizationRegistry(t=>{vo.delete(t)}));let cc=new WeakMap;function mt(t){let[e,n]=m.useState(t),r=m.useRef(null),o=JE(e),i=m.useRef(null),s=cc.get(i);if(xo&&s!==o&&(s!=null&&xo.unregister(i),xo.register(i,o,i),cc.set(i,o)),ow){const l=vo.get(o);l&&!l.includes(r)?l.push(r):vo.set(o,[r])}return pe(()=>{let l=o;return()=>{xo&&(xo.unregister(i),cc.delete(i)),vo.delete(l)}},[o]),m.useEffect(()=>{let l=r.current;return l&&n(l),()=>{l&&(r.current=null)}}),o}function iw(t,e){if(t===e)return t;let n=vo.get(t);if(n)return n.forEach(o=>o.current=e),e;let r=vo.get(e);return r?(r.forEach(o=>o.current=t),t):e}function Tn(t=[]){let e=mt(),[n,r]=rw(e),o=m.useCallback(()=>{r(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,r]);return pe(o,[e,o,...t]),n}function dc(...t){return t.length===1&&t[0]?t[0]:e=>{let n=!1;const r=t.map(o=>{const i=fy(o,e);return n||=typeof i=="function",i});if(n)return()=>{r.forEach((o,i)=>{typeof o=="function"?o():fy(t[i],null)})}}}function fy(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function hy(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=hy(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function fc(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=hy(t))&&(r&&(r+=" "),r+=e);return r}function ae(...t){let e={...t[0]};for(let n=1;n<t.length;n++){let r=t[n];for(let o in r){let i=e[o],s=r[o];typeof i=="function"&&typeof s=="function"&&o[0]==="o"&&o[1]==="n"&&o.charCodeAt(2)>=65&&o.charCodeAt(2)<=90?e[o]=Jt(i,s):(o==="className"||o==="UNSAFE_className")&&typeof i=="string"&&typeof s=="string"?e[o]=fc(i,s):o==="id"&&i&&s?e.id=iw(i,s):o==="ref"&&i&&s?e.ref=dc(i,s):e[o]=s!==void 0?s:i}}return e}function wi(t){const e=m.useRef(null),n=m.useRef(void 0),r=m.useCallback(o=>{if(typeof t=="function"){const i=t,s=i(o);return()=>{typeof s=="function"?s():i(null)}}else if(t)return t.current=o,()=>{t.current=null}},[t]);return m.useMemo(()=>({get current(){return e.current},set current(o){e.current=o,n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=r(o))}}),[r])}const _o=Symbol("default");function So({values:t,children:e}){for(let[n,r]of t)e=m.createElement(n.Provider,{value:r},e);return e}function yt(t){let{className:e,style:n,children:r,defaultClassName:o,defaultChildren:i,defaultStyle:s,values:l,render:a}=t;return m.useMemo(()=>{let u,c,d;return typeof e=="function"?u=e({...l,defaultClassName:o}):u=e,typeof n=="function"?c=n({...l,defaultStyle:s||{}}):c=n,typeof r=="function"?d=r({...l,defaultChildren:i}):r==null?d=i:d=r,{className:u??o,style:c||s?{...s,...c}:void 0,children:d??i,"data-rac":"",render:a?f=>a(f,l):void 0}},[e,n,r,o,i,s,l,a])}function pl(t,e){let n=m.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=e||_o;if(!n.slots[r]){let o=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`)),i=e?`Invalid slot "${e}".`:"A slot prop is required.";throw new Error(`${i} Valid slot names are ${o}.`)}return n.slots[r]}return n}function Mt(t,e,n){let r=pl(n,t.slot)||{},{ref:o,...i}=r,s=wi(m.useMemo(()=>dc(e,o),[e,o])),l=ae(i,t);return"style"in i&&i.style&&"style"in t&&t.style&&(typeof i.style=="function"||typeof t.style=="function"?l.style=a=>{let u=typeof i.style=="function"?i.style(a):i.style,c={...a.defaultStyle,...u},d=typeof t.style=="function"?t.style({...a,defaultStyle:c}):t.style;return{...c,...d}}:l.style={...i.style,...t.style}),[l,s]}function gy(t=!0){let[e,n]=m.useState(t),r=m.useRef(!1),o=m.useCallback(i=>{r.current=!0,n(!!i)},[]);return pe(()=>{r.current||n(!1)},[]),[o,e]}function sw(t){const e=/^(data-.*)$/;let n={};for(const r in t)e.test(r)||(n[r]=t[r]);return n}function lw(t,e,n){let{render:r,...o}=e,i=m.useRef(null),s=m.useMemo(()=>dc(n,i),[n,i]);pe(()=>{process.env.NODE_ENV!=="production"&&r&&(i.current?i.current.localName!==t&&console.warn(`Unexpected DOM element returned by custom \`render\` function. Expected <${t}>, got <${i.current.localName}>. This may break the component behavior and accessibility.`):console.warn("Ref was not connected to DOM element returned by custom `render` function. Did you forget to pass through or merge the `ref`?"))},[t,r]);let l={...o,ref:s};return r?r(l,void 0):m.createElement(t,l)}const py={},ot=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=py[e];return n||(n=m.forwardRef(lw.bind(null,e)),py[e]=n),n}}),aw="react-aria-clear-focus",uw="react-aria-focus",ue=t=>cw(t)?t.document:dw(t)?t:t?.ownerDocument??(typeof document<"u"?document:void 0),We=t=>ue(t)?.defaultView??(typeof window<"u"?window:void 0);function my(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function cw(t){return typeof t=="object"&&t!=null&&"window"in t&&t.window===t}function dw(t){return my(t)&&t.nodeType===9}function hc(t){return my(t)&&t.nodeType===11&&"host"in t}function fw(t,e,n,r){if(n==null||t==null)return()=>{};let o=Array.isArray(t)?t:[t];for(let i of o)i.addEventListener(e,n,r);return()=>{for(let i of o)i.removeEventListener(e,n,r)}}let hw=!1;function en(){return hw}function J(t,e){if(!en())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let n=e;for(;n!==null;){if(n===t)return!0;typeof n.assignedElements!="function"&&n.assignedSlot?.parentNode?n=n.assignedSlot.parentNode:hc(n)?n=n.host:n=n.parentNode}return!1}const Ee=(t=document)=>{if(!en())return t.activeElement;let e=t.activeElement;for(;e&&"shadowRoot"in e&&e.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e};function G(t){if(en()&&t.target instanceof Element&&t.target.shadowRoot){if("composedPath"in t)return t.composedPath()[0]??null;if("composedPath"in t.nativeEvent)return t.nativeEvent.composedPath()[0]??null}return t.target}function gw(t,e){if(e===null)return[];e=e??We(t);let n=[e];if(!en()||!t||t===e)return n;let r="getRootNode"in e?e.getRootNode():null,o=t.getRootNode()??null;for(;hc(o)&&o!==r;)n.push(o),o=o.host.getRootNode();return n}function ki(t){if(!t)return!1;let e=t.getRootNode(),n=We(t);if(!(e instanceof n.Document||e instanceof n.ShadowRoot))return!1;let r=e.activeElement;return r!=null&&t.contains(r)}function yy(t){let e=mw(ue(t));e!==t&&(e&&pw(e,t),t&&by(t,e))}function pw(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function by(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function mw(t){let e=Ee(t),n=e?.getAttribute("aria-activedescendant");return n&&t.getElementById(n)||e}function Ut(t){if(yw())t.focus({preventScroll:!0});else{let e=bw(t);t.focus(),vw(e)}}let ml=null;function yw(){if(ml==null){ml=!1;try{document.createElement("div").focus({get preventScroll(){return ml=!0,!0}})}catch{}}return ml}function bw(t){let e=t.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==r;)(e.offsetHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)&&n.push({element:e,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),e=e.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function vw(t){for(let{element:e,scrollTop:n,scrollLeft:r}of t)e.scrollTop=n,e.scrollLeft=r}const xw=typeof Element<"u"&&"checkVisibility"in Element.prototype;function _w(t){const e=We(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:n,visibility:r}=t.style,o=n!=="none"&&r!=="hidden"&&r!=="collapse";if(o){const{getComputedStyle:i}=We(t);let{display:s,visibility:l}=i(t);o=s!=="none"&&l!=="hidden"&&l!=="collapse"}return o}function Sw(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function gc(t,e){return xw?t.checkVisibility({visibilityProperty:!0})&&!t.closest("[data-react-aria-prevent-focus]"):t.nodeName!=="#comment"&&_w(t)&&Sw(t,e)&&(!t.parentElement||gc(t.parentElement,t))}const pc=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Cw=pc.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";pc.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Ew=pc.join(':not([hidden]):not([tabindex="-1"]),');function vy(t,e){return t.matches(Cw)&&!xy(t)&&(e?.skipVisibilityCheck||gc(t))}function mc(t){return t.matches(Ew)&&gc(t)&&!xy(t)}function xy(t){let e=t;for(;e!=null;){if(e instanceof We(e).HTMLElement&&e.inert)return!0;e=e.parentElement}return!1}function yc(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function _y(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function Sy(t){let e=m.useRef({isFocused:!1,observer:null});return pe(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),m.useCallback(n=>{let r=G(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){e.current.isFocused=!0;let o=r,i=s=>{if(e.current.isFocused=!1,o.disabled){let l=yc(s);t?.(l)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&o.disabled){e.current.observer?.disconnect();let s=o===Ee()?null:Ee();o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),e.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[t])}let yl=!1;function Cy(t){for(;t&&!vy(t,{skipVisibilityCheck:!0});)t=t.parentElement;let e=We(t),n=e.document.activeElement;if(!n||n===t)return;yl=!0;let r=!1,o=c=>{(G(c)===n||r)&&c.stopImmediatePropagation()},i=c=>{(G(c)===n||r)&&(c.stopImmediatePropagation(),!t&&!r&&(r=!0,Ut(n),a()))},s=c=>{(G(c)===t||r)&&c.stopImmediatePropagation()},l=c=>{(G(c)===t||r)&&(c.stopImmediatePropagation(),r||(r=!0,Ut(n),a()))};e.addEventListener("blur",o,!0),e.addEventListener("focusout",i,!0),e.addEventListener("focusin",l,!0),e.addEventListener("focus",s,!0);let a=()=>{cancelAnimationFrame(u),e.removeEventListener("blur",o,!0),e.removeEventListener("focusout",i,!0),e.removeEventListener("focusin",l,!0),e.removeEventListener("focus",s,!0),yl=!1,r=!1},u=requestAnimationFrame(a);return a}function bl(t){if(typeof window>"u"||window.navigator==null)return!1;let e=window.navigator.userAgentData?.brands;return Array.isArray(e)&&e.some(n=>t.test(n.brand))||t.test(window.navigator.userAgent)}function bc(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function tn(t){if(process.env.NODE_ENV==="test")return t;let e=null;return()=>(e==null&&(e=t()),e)}const At=tn(function(){return bc(/^Mac/i)}),ww=tn(function(){return bc(/^iPhone/i)}),Ey=tn(function(){return bc(/^iPad/i)||At()&&navigator.maxTouchPoints>1}),Er=tn(function(){return ww()||Ey()}),kw=tn(function(){return At()||Er()}),Vn=tn(function(){return bl(/AppleWebKit/i)&&(Er()||!vc())});tn(function(){return Vn()&&!vc()&&!wy()});const vc=tn(function(){return bl(/Chrome|CriOS|CrMo/i)}),vl=tn(function(){return bl(/Android/i)}),wy=tn(function(){return bl(/(Firefox|FxiOS)/i)});function xc(t){return t.pointerType===""&&t.isTrusted?!0:vl()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Tw(t){return!vl()&&t.width===0&&t.height===0||vl()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}const Pw=m.createContext({isNative:!0,open:Mw,useHref:t=>t});function xl(){return m.useContext(Pw)}function $w(t,e){let n=t.getAttribute("target");return(!n||n==="_self")&&t.origin===location.origin&&!t.hasAttribute("download")&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function Pn(t,e,n=!0){let{metaKey:r,ctrlKey:o,altKey:i,shiftKey:s}=e;!Vn()&&wy()&&window.event?.type?.startsWith("key")&&t.target==="_blank"&&(At()?r=!0:o=!0);let l=Vn()&&At()&&!Ey()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:r,ctrlKey:o,altKey:i,shiftKey:s}):new MouseEvent("click",{metaKey:r,ctrlKey:o,altKey:i,shiftKey:s,detail:1,bubbles:!0,cancelable:!0});Pn.isOpening=n,Ut(t),t.dispatchEvent(l),Pn.isOpening=!1}Pn.isOpening=!1;function Dw(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let n=document.createElement("a");n.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(n.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(n.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(n.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(n.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(n),e(n),t.removeChild(n)}}function Mw(t,e){Dw(t,n=>Pn(n,e))}function ky(t){const n=xl().useHref(t?.href??"");let r={};if(t)for(let o of["href","target","rel","download","ping","referrerPolicy"])o in t&&t[o]!==void 0&&(r[o]=o==="href"?n:t[o]);return r}function Aw(t,e,n,r){!e.isNative&&t.currentTarget instanceof HTMLAnchorElement&&t.currentTarget.href&&!t.isDefaultPrevented()&&$w(t.currentTarget,t)&&n&&(t.preventDefault(),e.open(t.currentTarget,t,n,r))}let wr=null;const _c=new Set;let Ti=new Map,kr=!1,Sc=!1;const Lw={Tab:!0,Escape:!0};function _l(t,e){for(let n of _c)n(t,e)}function Iw(t){return!(t.metaKey||!At()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Sl(t){kr=!0,!Pn.isOpening&&Iw(t)&&(wr="keyboard",_l("keyboard",t))}function Lt(t){wr="pointer","pointerType"in t&&t.pointerType,(t.type==="mousedown"||t.type==="pointerdown")&&(kr=!0,_l("pointer",t))}function Ty(t){!Pn.isOpening&&xc(t)&&(kr=!0,wr="virtual")}function Py(t){let e=We(G(t)),n=ue(G(t));G(t)===e||G(t)===n||yl||!t.isTrusted||(!kr&&!Sc&&(wr="virtual",_l("virtual",t)),kr=!1,Sc=!1)}function $y(){yl||(kr=!1,Sc=!0)}function Cc(t){if(typeof window>"u"||typeof document>"u")return;const e=We(t),n=ue(t);if(Ti.get(e))return;let r=e.HTMLElement.prototype.focus;Reflect.defineProperty(e.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(){kr=!0,r.apply(this,arguments)}}),n.addEventListener("keydown",Sl,!0),n.addEventListener("keyup",Sl,!0),n.addEventListener("click",Ty,!0),e.addEventListener("focus",Py,!0),e.addEventListener("blur",$y,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Lt,!0),n.addEventListener("pointermove",Lt,!0),n.addEventListener("pointerup",Lt,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Lt,!0),n.addEventListener("mousemove",Lt,!0),n.addEventListener("mouseup",Lt,!0)),e.addEventListener("beforeunload",()=>{Dy(t)},{once:!0}),Ti.set(e,{focus:r})}const Dy=(t,e)=>{const n=We(t),r=ue(t);e&&r.removeEventListener("DOMContentLoaded",e),Ti.has(n)&&(Reflect.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:Ti.get(n).focus}),r.removeEventListener("keydown",Sl,!0),r.removeEventListener("keyup",Sl,!0),r.removeEventListener("click",Ty,!0),n.removeEventListener("focus",Py,!0),n.removeEventListener("blur",$y,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Lt,!0),r.removeEventListener("pointermove",Lt,!0),r.removeEventListener("pointerup",Lt,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Lt,!0),r.removeEventListener("mousemove",Lt,!0),r.removeEventListener("mouseup",Lt,!0)),Ti.delete(n))};function Fw(t){const e=ue(t);let n;return e.readyState!=="loading"?Cc(t):(n=()=>{Cc(t)},e.addEventListener("DOMContentLoaded",n)),()=>Dy(t,n)}typeof document<"u"&&Fw();function Tr(){return wr!=="pointer"}function Pi(){return wr}function $i(t){wr=t,_l(t,null)}const Ow=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Kw(t,e,n){let r=n?G(n):void 0,o=ue(r),i=We(r);const s=typeof i<"u"?i.HTMLInputElement:HTMLInputElement,l=typeof i<"u"?i.HTMLTextAreaElement:HTMLTextAreaElement,a=typeof i<"u"?i.HTMLElement:HTMLElement,u=typeof i<"u"?i.KeyboardEvent:KeyboardEvent;let c=Ee(o);return t=t||c instanceof s&&!Ow.has(c.type)||c instanceof l||c instanceof a&&c.isContentEditable,!(t&&e==="keyboard"&&n instanceof u&&!Lw[n.key])}function Nw(t,e,n){Cc(),m.useEffect(()=>{if(n?.enabled===!1)return;let r=(o,i)=>{Kw(!!n?.isTextInput,o,i)&&t(Tr())};return _c.add(r),()=>{_c.delete(r)}},e)}function Di(t){return At()?t.metaKey:t.ctrlKey}const Rw=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ec(t){return t instanceof HTMLInputElement&&!Rw.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}const Bw=m.useInsertionEffect??pe;function It(t){const e=m.useRef(null);return Bw(()=>{e.current=t},[t]),m.useCallback((...n)=>{const r=e.current;return r?.(...n)},[])}function Cl(t,e,n,r){let o=It(n),i=n==null;m.useEffect(()=>{if(i||!t.current)return;let s=t.current;return s.addEventListener(e,o,r),()=>{s.removeEventListener(e,o,r)}},[t,e,r,i])}function My(t,e){let{id:n,"aria-label":r,"aria-labelledby":o}=t;return n=mt(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!r&&!o&&e&&(r=e),{id:n,"aria-label":r,"aria-labelledby":o}}const zw=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Vw=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Uw(t){if(Intl.Locale){let n=new Intl.Locale(t).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return zw.has(n.script)}let e=t.split("-")[0];return Vw.has(e)}const Ay=Symbol.for("react-aria.i18n.locale");function Ly(){let t=typeof window<"u"&&window[Ay]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:Uw(t)?"rtl":"ltr"}}let wc=Ly(),Mi=new Set;function Iy(){wc=Ly();for(let t of Mi)t(wc)}function Hw(){let t=Ei(),[e,n]=m.useState(wc);return m.useEffect(()=>(Mi.size===0&&window.addEventListener("languagechange",Iy),Mi.add(n),()=>{Mi.delete(n),Mi.size===0&&window.removeEventListener("languagechange",Iy)}),[]),t?{locale:typeof window<"u"&&window[Ay]||"en-US",direction:"ltr"}:e}const jw=m.createContext(null);function Un(){let t=Hw();return m.useContext(jw)||t}const Gw=Symbol.for("react-aria.i18n.locale"),qw=Symbol.for("react-aria.i18n.strings");let El;class wl{constructor(e,n="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,r])=>r)),this.defaultLocale=n}getStringForLocale(e,n){let o=this.getStringsForLocale(n)[e];if(!o)throw new Error(`Could not find intl message ${e} in ${n} locale`);return o}getStringsForLocale(e){let n=this.strings[e];return n||(n=Yw(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[Gw];if(El===void 0){let o=window[qw];if(!o)return null;El={};for(let i in o)El[i]=new wl({[n]:o[i]},n)}let r=El?.[e];if(!r)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}}function Yw(t,e,n="en-US"){if(e[t])return e[t];let r=Zw(t),o=Xw(t);if(o&&e[`${r}-${o}`])return e[`${r}-${o}`];if(e[r])return e[r];for(let i in e)if(i.startsWith(r+"-"))return e[i];return e[n]}function Zw(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}function Xw(t){if(Intl.Locale)return new Intl.Locale(t).script}const Fy=new Map,Oy=new Map;class Qw{constructor(e,n){this.locale=e,this.strings=n}format(e,n){let r=this.strings.getStringForLocale(e,this.locale);return typeof r=="function"?r(n,this):r}plural(e,n,r="cardinal"){let o=n["="+e];if(o)return typeof o=="function"?o():o;let i=this.locale+":"+r,s=Fy.get(i);s||(s=new Intl.PluralRules(this.locale,{type:r}),Fy.set(i,s));let l=s.select(e);return o=n[l]||n.other,typeof o=="function"?o():o}number(e){let n=Oy.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),Oy.set(this.locale,n)),n.format(e)}select(e,n){let r=e[n]||e.other;return typeof r=="function"?r():r}}const Ky=new WeakMap;function Ww(t){let e=Ky.get(t);return e||(e=new wl(t),Ky.set(t,e)),e}function Jw(t,e){return e&&wl.getGlobalDictionaryForPackage(e)||Ww(t)}function kc(t,e){let{locale:n}=Un(),r=Jw(t,e);return m.useMemo(()=>new Qw(n,r),[n,r])}const ek=typeof document<"u"?m.useInsertionEffect??m.useLayoutEffect:()=>{};function kl(t,e,n){let[r,o]=m.useState(t||e),i=m.useRef(r),s=m.useRef(t!==void 0),l=t!==void 0;m.useEffect(()=>{let d=s.current;d!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),s.current=l},[l]);let a=l?t:r;ek(()=>{i.current=a});let[,u]=m.useReducer(()=>({}),{}),c=m.useCallback((d,...f)=>{let h=typeof d=="function"?d(i.current):d;Object.is(i.current,h)||(i.current=h,o(h),u(),n?.(h,...f))},[n]);return[a,c]}const tk=m.createContext(null);class Co{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,n,r){let o=this.clone();return n.addDescendants(o,e),o}}class Ny extends Co{filter(e,n,r){let[o,i]=zy(e,n,this.firstChildKey,r),s=this.clone();return s.firstChildKey=o,s.lastChildKey=i,s}}const Td=class Td extends Co{};Td.type="header";let Ry=Td;const Pd=class Pd extends Co{};Pd.type="loader";let Tc=Pd;const $d=class $d extends Ny{filter(e,n,r){if(r(this.textValue,this)){let o=this.clone();return n.addDescendants(o,e),o}return null}};$d.type="item";let Tl=$d;const Dd=class Dd extends Ny{filter(e,n,r){let o=super.filter(e,n,r);if(o&&o.lastChildKey!==null){let i=e.getItem(o.lastChildKey);if(i&&i.type!=="header")return o}return null}};Dd.type="section";let By=Dd;class nk{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let r=n.get(e),o=r?.firstChildKey!=null?n.get(r.firstChildKey):null;for(;o;)yield o,o=o.nextKey!=null?n.get(o.nextKey):void 0}}}getKeyBefore(e){let n=this.keyMap.get(e);if(!n)return null;if(n.prevKey!=null){for(n=this.keyMap.get(n.prevKey);n&&n.type!=="item"&&n.lastChildKey!=null;)n=this.keyMap.get(n.lastChildKey);return n?.key??null}return n.parentKey}getKeyAfter(e){let n=this.keyMap.get(e);if(!n)return null;if(n.type!=="item"&&n.firstChildKey!=null)return n.firstChildKey;for(;n;){if(n.nextKey!=null)return n.nextKey;if(n.parentKey!=null)n=this.keyMap.get(n.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw new Error("Not implemented")}clone(){let e=this.constructor,n=new e;return n.keyMap=new Map(this.keyMap),n.firstKey=this.firstKey,n.lastKey=this.lastKey,n.itemCount=this.itemCount,n}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");e.type==="item"&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,n){this.addNode(e);let r=n.getChildren(e.key);for(let o of r)this.addDescendants(o,n)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");let n=this.keyMap.get(e);n!=null&&n.type==="item"&&this.itemCount--,this.keyMap.delete(e)}commit(e,n,r=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=n,this.frozen=!r}filter(e){let n=new this.constructor,[r,o]=zy(this,n,this.firstKey,e);return n?.commit(r,o),n}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}}function zy(t,e,n,r){if(n==null)return[null,null];let o=null,i=null,s=t.getItem(n);for(;s!=null;){let l=s.filter(t,e,r);l!=null&&(l.nextKey=null,i&&(l.prevKey=i.key,i.nextKey=l.key),o==null&&(o=l),e.addNode(l),i=l),s=s.nextKey!=null?t.getItem(s.nextKey):null}if(i&&i.type==="separator"){let l=i.prevKey;e.removeNode(i.key),l!=null?(i=e.getItem(l),i.nextKey=null):i=null}return[o?.key??null,i?.key??null]}class Vy{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild==null&&(this.firstChild=e),this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,n){if(n==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=n,e.previousSibling=n.previousSibling,e.index=n.index-1,this.firstChild===n?this.firstChild=e:n.previousSibling&&(n.previousSibling.nextSibling=e),n.previousSibling=e,e.parentNode=n.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}}class Eo extends Vy{constructor(e,n){super(n),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof Eo?this.parentNode.level+(this.parentNode.node?.type==="item"?1:0):0}getMutableNode(){return this.node==null?null:(this.isMutated||(this.node=this.node.clone(),this.isMutated=!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let e=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof Eo?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=e?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&e)){let r=(n.colIndex??n.index)+(n.colSpan??1);if(e.node!=null&&r!==e.node.colIndex){let o=e.getMutableNode();o.colIndex=r}}}setProps(e,n,r,o,i){let s,{value:l,textValue:a,id:u,...c}=e;if(this.node==null?(s=new r(u??`react-aria-${++this.ownerDocument.nodeId}`),this.node=s):s=this.getMutableNode(),c.ref=n,s.props=c,s.rendered=o,s.render=i,s.value=l,e["aria-label"]&&(s["aria-label"]=e["aria-label"]),s.textValue=a||(typeof c.children=="string"?c.children:"")||e["aria-label"]||"",u!=null&&u!==s.key)throw new Error("Cannot change the id of an item");c.colSpan!=null&&(s.colSpan=c.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(n){let r=n==="none";if(e.isHidden!==r){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let o=e.previousVisibleSibling,i=e.nextVisibleSibling;o&&e.ownerDocument.markDirty(o),i&&e.ownerDocument.markDirty(i),e.isHidden=r,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}}class rk extends Vy{constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}get isConnected(){return!0}createElement(e){return new Eo(e,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let n=this.getMutableCollection();if(!n.getItem(e.node.key))for(let r of e)this.addNode(r);n.addNode(e.node)}removeNode(e){for(let n of e)this.removeNode(n);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection:(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof Eo&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof Eo?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0,this.isSSR||(this.collection=this.collection.clone());for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),this.queuedRender&&e(),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}}function Uy(t){let{children:e,items:n,idScope:r,addIdAndValue:o,dependencies:i=[]}=t,s=m.useMemo(()=>process.env.NODE_ENV!=="production"&&typeof e=="function"?e.toString():void 0,[e]),l=m.useMemo(()=>new WeakMap,[...i,s]);return m.useMemo(()=>{if(n&&typeof e=="function"){let a=[];for(let u of n){let c=ok(u)?u:null,d=c?l.get(c):null;if(!d){d=e(u);let f=d.props.id??u?.key??u?.id;r!=null&&d.props.id==null&&f!=null&&(f=r+":"+f);let h=f??a.length;d=m.cloneElement(d,o?{key:h,id:f,value:u}:{key:h}),c&&l.set(c,d)}a.push(d)}return a}else if(typeof e!="function")return e},[e,n,l,r,o])}function ok(t){switch(typeof t){case"object":return t!=null;case"function":case"symbol":return!0;default:return!1}}let Hn=new Map,Pc=new Set;function Hy(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{let o=G(r);if(!t(r)||!o)return;let i=Hn.get(o);i||(i=new Set,Hn.set(o,i),o.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{let o=G(r);if(!t(r)||!o)return;let i=Hn.get(o);if(i&&(i.delete(r.propertyName),i.size===0&&(o.removeEventListener("transitioncancel",n),Hn.delete(o)),Hn.size===0)){for(let s of Pc)s();Pc.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?Hy():document.addEventListener("DOMContentLoaded",Hy));function ik(){for(const[t]of Hn)"isConnected"in t&&!t.isConnected&&Hn.delete(t)}function jy(t){requestAnimationFrame(()=>{ik(),Hn.size===0?t():Pc.add(t)})}function jn(t){if(!t.isConnected)return;const e=ue(t);if(Pi()==="virtual"){let n=Ee(e);jy(()=>{const r=Ee(e);(r===n||r===e.body)&&t.isConnected&&Ut(t)})}else Ut(t)}function $c(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:o}=t;const i=m.useCallback(a=>{if(G(a)===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),s=Sy(i),l=m.useCallback(a=>{let u=G(a);const c=ue(u),d=c?Ee(c):Ee();u===a.currentTarget&&u===d&&(n&&n(a),o&&o(!0),s(a))},[o,n,s]);return{focusProps:{onFocus:!e&&(n||o||r)?l:void 0,onBlur:!e&&(r||o)?i:void 0}}}function Pl(t){if(t)return e=>{let n=!0,r={...e,preventDefault(){e.preventDefault()},isDefaultPrevented(){return e.isDefaultPrevented()},stopPropagation(){n&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):n=!0},continuePropagation(){n=!1,typeof e.continuePropagation=="function"&&e.continuePropagation()},isPropagationStopped(){return n}};t(r),n&&!(typeof e.isPropagationStopped=="function"&&e.isPropagationStopped())&&e.stopPropagation()}}const sk=new Set(["shift","alt","control","meta","mod"]),lk=["Alt","Control","Meta","Shift"];function ak(t){let e=new Set;return t.alt&&e.add("Alt"),t.shift&&e.add("Shift"),t.ctrl&&e.add("Control"),t.meta&&e.add("Meta"),t.mod&&e.add(At()?"Meta":"Control"),e}function uk(t){let e=new Set;return t.altKey&&e.add("Alt"),t.ctrlKey&&e.add("Control"),t.metaKey&&e.add("Meta"),t.shiftKey&&e.add("Shift"),e}function Gy(t){return lk.filter(e=>t.has(e))}function ck(t){let e=t.split("+").reduce((n,r)=>{let o=r.toLowerCase();return sk.has(o)?o==="shift"?n.shift=!0:o==="alt"?n.alt=!0:o==="control"?n.ctrl=!0:o==="meta"?n.meta=!0:o==="mod"&&(n.mod=!0):n.key=r,n},{shift:!1,alt:!1,ctrl:!1,meta:!1,mod:!1,key:""});if(e.key==="")throw new Error(`Invalid keyboard shortcut: "${t}". Must include exactly one non-modifier key (e.g. "a", "Enter", "ArrowDown"). Combine any of Shift, Alt, Ctrl, Meta, and Mod.`);return e}function qy(t){return t.toLowerCase()}const dk={space:" ",esc:"escape",del:"delete",ins:"insert",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",pageup:"pageup",pagedown:"pagedown"};function fk(t){let e=qy(t),n=dk[e];return n??e}function hk(t){let e=Gy(ak(t)),n=fk(t.key);return e.length>0?`${e.join("+")}+${n}`:n}function gk(t){let e=Gy(uk(t)),n=qy(t.key);return(e.length>0?`${e.join("+")}+`:"")+n}function pk(t){let e=new Map;for(let[n,r]of Object.entries(t)){let o=ck(n);e.set(hk(o),r)}return n=>{let r=gk(n),o=e.get(r),i=o?.(n);i===void 0&&o!==void 0?i={shouldContinuePropagation:!1,shouldPreventDefault:!0}:typeof i=="boolean"&&(i={shouldContinuePropagation:!i,shouldPreventDefault:i}),i?.shouldPreventDefault&&n.preventDefault(),(!o||i?.shouldContinuePropagation)&&n.continuePropagation()}}function Gn(t){let{shortcuts:e,allowRepeats:n=!1,allowComposing:r=!1}=t,o,i;if(e){let s=pk(e),l=Pl(u=>{if(!J(u.currentTarget,G(u))){u.continuePropagation();return}if(u.nativeEvent?.repeat&&!n||u.nativeEvent?.isComposing&&!r){u.continuePropagation();return}s(u)}),a=Pl(u=>{if(!J(u.currentTarget,G(u))){u.continuePropagation();return}if(u.nativeEvent?.repeat&&!n||u.nativeEvent?.isComposing&&!r){u.continuePropagation();return}u.continuePropagation()});o=t.onKeyDown?Jt(t.onKeyDown,l):l,i=t.onKeyUp?Jt(t.onKeyUp,a):a}else o=Pl(t.onKeyDown),i=Pl(t.onKeyUp);return{keyboardProps:t.isDisabled?{}:{onKeyDown:o,onKeyUp:i}}}function Dc(t,e){pe(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}let $l=m.createContext(null);function mk(t){let e=m.useContext($l)||{};Dc(e,t);let{ref:n,...r}=e;return r}function Yy(t,e){let{focusProps:n}=$c(t),{keyboardProps:r}=Gn(t),o=ae(n,r),i=mk(e),s=t.isDisabled?{}:i,l=m.useRef(t.autoFocus);m.useEffect(()=>{l.current&&e.current&&jn(e.current),l.current=!1},[e]);let a=t.excludeFromTabOrder?-1:0;return t.isDisabled&&(a=void 0),{focusableProps:ae({...o,tabIndex:a},s)}}typeof HTMLTemplateElement<"u"&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.appendChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.removeChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(t,e){return this.content.insertBefore(t,e)}}));const Dl=m.createContext(!1);function yk(t){if(m.useContext(Dl))return m.createElement(m.Fragment,null,t.children);let n=m.createElement(Dl.Provider,{value:!0},t.children);return m.createElement("template",null,n)}function Mc(t){let e=(n,r)=>m.useContext(Dl)?null:t(n,r);return e.displayName=t.displayName||t.name,m.forwardRef(e)}function bk(){return m.useContext(Dl)}var Ml={exports:{}},Ac={};var Zy;function vk(){if(Zy)return Ac;Zy=1;var t=m;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function l(d,f){var h=f(),g=r({inst:{value:h,getSnapshot:f}}),b=g[0].inst,p=g[1];return i(function(){b.value=h,b.getSnapshot=f,a(b)&&p({inst:b})},[d,h,f]),o(function(){return a(b)&&p({inst:b}),d(function(){a(b)&&p({inst:b})})},[d]),s(h),h}function a(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function u(d,f){return f()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return Ac.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:c,Ac}var Lc={};var Xy;function xk(){return Xy||(Xy=1,process.env.NODE_ENV!=="production"&&(function(){function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}function e(h,g){c||o.startTransition===void 0||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=g();if(!d){var p=g();i(b,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}p=s({inst:{value:b,getSnapshot:g}});var y=p[0].inst,v=p[1];return a(function(){y.value=b,y.getSnapshot=g,n(y)&&v({inst:y})},[h,b,g]),l(function(){return n(y)&&v({inst:y}),h(function(){n(y)&&v({inst:y})})},[h]),u(b),b}function n(h){var g=h.getSnapshot;h=h.value;try{var b=g();return!i(h,b)}catch{return!0}}function r(h,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=m,i=typeof Object.is=="function"?Object.is:t,s=o.useState,l=o.useEffect,a=o.useLayoutEffect,u=o.useDebugValue,c=!1,d=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;Lc.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Lc}var Qy;function _k(){return Qy||(Qy=1,process.env.NODE_ENV==="production"?Ml.exports=vk():Ml.exports=xk()),Ml.exports}var Sk=_k();const Wy=m.createContext(!1),Ai=m.createContext(null);function Jy(t){if(m.useContext(Ai))return t.content;let{collection:n,document:r}=kk(t.createCollection);return m.createElement(m.Fragment,null,m.createElement(yk,null,m.createElement(Ai.Provider,{value:r},t.content)),m.createElement(Ck,{render:t.children,collection:n}))}function Ck({collection:t,render:e}){return e(t)}function Ek(t,e,n){let r=Ei(),o=m.useRef(r);o.current=r;let i=m.useCallback(()=>o.current?n():e(),[e,n]);return Sk.useSyncExternalStore(t,i)}const wk=typeof m.useSyncExternalStore=="function"?m.useSyncExternalStore:Ek;function kk(t){let[e]=m.useState(()=>new rk(t?.()||new nk)),n=m.useCallback(s=>e.subscribe(s),[e]),r=m.useCallback(()=>{let s=e.getCollection();return e.isSSR&&e.resetAfterSSR(),s},[e]),o=m.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]);return{collection:wk(n,r,o),document:e}}const Ic=m.createContext(null);function Tk(t){var n;return n=class extends Co{},n.type=t,n}function Pk(t,e,n,r,o,i){typeof t=="string"&&(t=Tk(t));let s=m.useCallback(a=>{a?.setProps(e,n,t,r,i)},[e,n,r,i,t]),l=m.useContext(Ic);if(l){let a=l.ownerDocument.nodesByProps.get(e);return a||(a=l.ownerDocument.createElement(t.type),a.setProps(e,n,t,r,i),l.appendChild(a),l.ownerDocument.updateCollection(),l.ownerDocument.nodesByProps.set(e,a)),o?m.createElement(Ic.Provider,{value:a},o):null}return m.createElement(t.type,{ref:s},o)}function Al(t,e){let n=({node:o})=>e(o.props,o.props.ref,o),r=m.forwardRef((o,i)=>{let s=m.useContext($l);if(!m.useContext(Wy)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(o,i)}return Pk(t,o,i,"children"in o?o.children:null,null,a=>m.createElement($l.Provider,{value:s},m.createElement(n,{node:a})))});return r.displayName=e.name,r}function $k(t){return Uy({...t,addIdAndValue:!0})}const eb=m.createContext(null);function Dk(t){let e=m.useContext(eb),n=(e?.dependencies||[]).concat(t.dependencies),r=t.idScope??e?.idScope,o=$k({...t,idScope:r,dependencies:n});return m.useContext(Ai)&&(o=m.createElement(Mk,null,o)),e=m.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),m.createElement(eb.Provider,{value:e},o)}function Mk({children:t}){let e=m.useContext(Ai),n=m.useMemo(()=>m.createElement(Ai.Provider,{value:null},m.createElement(Wy.Provider,{value:!0},t)),[t]);return Ei()?m.createElement(Ic.Provider,{value:e},n):Fr.createPortal(n,e)}const Ak=m.createContext(null),Lk={CollectionRoot({collection:t,renderDropIndicator:e}){return tb(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return tb(t,e,n)}};function tb(t,e,n){return Uy({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){if(r.type==="content")return m.createElement(m.Fragment,null);let o=r.render(r);return!n||r.type!=="item"?o:m.createElement(m.Fragment,null,n({type:"item",key:r.key,dropPosition:"before"}),o,Ik(t,r,n))}})}function Ik(t,e,n){let r=e.key,o=t.getKeyAfter(r),i=o!=null?t.getItem(o):null;for(;i!=null&&i.type!=="item";)o=t.getKeyAfter(i.key),i=o!=null?t.getItem(o):null;let s=e.nextKey!=null?t.getItem(e.nextKey):null;for(;s!=null&&s.type!=="item";)s=s.nextKey!=null?t.getItem(s.nextKey):null;let l=[];if(s==null){let a=e;for(;a?.type==="item"&&(!i||a.parentKey!==i.parentKey&&i.level<a.level);){let u=n({type:"item",key:a.key,dropPosition:"after"});m.isValidElement(u)&&l.push(m.cloneElement(u,{key:`${a.key}-after`})),a=a.parentKey!=null?t.getItem(a.parentKey):null}}return l}const Ll=m.createContext(Lk),Fk=new Set(["id"]),Ok=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Kk=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Nk=new Set(["dir","lang","hidden","inert","translate"]),nb=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),Rk=/^(data-.*)$/;function Re(t,e={}){let{labelable:n,isLink:r,global:o,events:i=o,propNames:s}=e,l={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Fk.has(a)||n&&Ok.has(a)||r&&Kk.has(a)||o&&Nk.has(a)||i&&(nb.has(a)||a.endsWith("Capture")&&nb.has(a.slice(0,-7)))||s?.has(a)||Rk.test(a))&&(l[a]=t[a]);return l}let wo="default",Fc="",Il=new WeakMap;function rb(t){if(Er()&&Vn()){if(wo==="default"){const e=ue(t);Fc=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}wo="disabled"}else if(t instanceof HTMLElement||t instanceof SVGElement){let e="userSelect"in t.style?"userSelect":"webkitUserSelect";Il.set(t,t.style[e]),t.style[e]="none"}}function Oc(t){if(Er()&&Vn()){if(wo!=="disabled")return;wo="restoring",setTimeout(()=>{jy(()=>{if(wo==="restoring"){const e=ue(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=Fc||""),Fc="",wo="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&Il.has(t)){let e=Il.get(t),n="userSelect"in t.style?"userSelect":"webkitUserSelect";t.style[n]==="none"&&(t.style[n]=e),t.getAttribute("style")===""&&t.removeAttribute("style"),Il.delete(t)}}function ob(t){return t?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let Kc=new WeakMap;function ib(t){let e=t??(typeof document<"u"?document:void 0);if(!e)return ob(e);if(Kc.has(e))return Kc.get(e);let n=e.querySelector('meta[property="csp-nonce"]'),r=n&&n instanceof We(n).HTMLMetaElement&&(n.nonce||n.content)||ob(e)||void 0;return r!==void 0&&Kc.set(e,r),r}const Li=m.createContext({register:()=>{}});Li.displayName="PressResponderContext";function Fl(){let t=m.useRef(new Map),e=m.useCallback((o,i,s,l)=>{let a=l?.once?(...u)=>{t.current.delete(s),s(...u)}:s;t.current.set(s,{type:i,eventTarget:o,fn:a,options:l}),o.addEventListener(i,a,l)},[]),n=m.useCallback((o,i,s,l)=>{let a=t.current.get(s)?.fn||s;o.removeEventListener(i,a,l),t.current.delete(s)},[]),r=m.useCallback(()=>{t.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return m.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function Bk(t){let e=m.useContext(Li);if(e){let{register:n,ref:r,...o}=e;t=ae(o,t),n()}return Dc(e,t.ref),t}class Ol{#e;constructor(e,n,r,o){this.#e=!0;const s=(o?.target??r.currentTarget)?.getBoundingClientRect();let l,a=0,u,c=null;r.clientX!=null&&r.clientY!=null&&(u=r.clientX,c=r.clientY),s&&(u!=null&&c!=null?(l=u-s.left,a=c-s.top):(l=s.width/2,a=s.height/2)),this.type=e,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=l,this.y=a,this.key=r.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const sb=Symbol("linkClicked"),lb="react-aria-pressable-style",ab="data-react-aria-pressable";function Kl(t){let{onPress:e,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:i,onClick:s,isDisabled:l,isPressed:a,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:f,...h}=Bk(t),[g,b]=m.useState(!1),p=m.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:y,removeAllGlobalListeners:v}=Fl(),x=m.useCallback((E,F)=>{let U=p.current;if(l||U.didFirePressStart)return!1;let I=!0;if(U.isTriggeringEvent=!0,r){let Q=new Ol("pressstart",F,E);r(Q),I=Q.shouldStopPropagation}return n&&n(!0),U.isTriggeringEvent=!1,U.didFirePressStart=!0,b(!0),I},[l,r,n]),_=m.useCallback((E,F,U=!0)=>{let I=p.current;if(!I.didFirePressStart)return!1;I.didFirePressStart=!1,I.isTriggeringEvent=!0;let Q=!0;if(o){let $=new Ol("pressend",F,E);o($),Q=$.shouldStopPropagation}if(n&&n(!1),b(!1),e&&U&&!l){let $=new Ol("press",F,E);e($),Q&&=$.shouldStopPropagation}return I.isTriggeringEvent=!1,Q},[l,o,n,e]),C=It(_),T=m.useCallback((E,F)=>{let U=p.current;if(l)return!1;if(i){U.isTriggeringEvent=!0;let I=new Ol("pressup",F,E);return i(I),U.isTriggeringEvent=!1,I.shouldStopPropagation}return!0},[l,i]),k=It(T),S=m.useCallback(E=>{let F=p.current;if(F.isPressed&&F.target){F.didFirePressStart&&F.pointerType!=null&&_(Pr(F.target,E),F.pointerType,!1),F.isPressed=!1,F.isOverTarget=!1,F.activePointerId=null,F.pointerType=null,v(),d||Oc(F.target);for(let U of F.disposables)U();F.disposables=[]}},[d,v,_]),w=It(S);m.useEffect(()=>{l&&p.current.isPressed&&w({currentTarget:p.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[l]);let D=m.useCallback(E=>{c&&S(E)},[c,S]),M=m.useCallback(E=>{l||s?.(E)},[l,s]),B=m.useCallback((E,F)=>{if(!l&&s){let U=new MouseEvent("click",E);_y(U,F),s(yc(U))}},[l,s]),V=m.useMemo(()=>{let E=p.current,F={onKeyDown(I){if(Rc(I.nativeEvent,I.currentTarget)&&J(I.currentTarget,G(I))){db(G(I),I.key)&&I.preventDefault();let Q=!0;!E.isPressed&&!I.repeat&&(E.target=I.currentTarget,E.isPressed=!0,E.pointerType="keyboard",Q=x(I,"keyboard"));let $=I.currentTarget,K=H=>{Rc(H,$)&&!H.repeat&&J($,G(H))&&E.target&&k(Pr(E.target,H),"keyboard")};y(ue(I.currentTarget),"keyup",Jt(K,U),!0),Q&&I.stopPropagation(),I.metaKey&&At()&&E.metaKeyEvents?.set(I.key,I.nativeEvent)}else I.key==="Meta"&&(E.metaKeyEvents=new Map)},onClick(I){if(!(I&&!J(I.currentTarget,G(I)))&&I&&I.button===0&&!E.isTriggeringEvent&&!Pn.isOpening){let Q=!0;if(l&&I.preventDefault(),!E.ignoreEmulatedMouseEvents&&!E.isPressed&&(E.pointerType==="virtual"||xc(I.nativeEvent))){let $=x(I,"virtual"),K=k(I,"virtual"),H=C(I,"virtual");M(I),Q=$&&K&&H}else if(E.isPressed&&E.pointerType!=="keyboard"){let $=E.pointerType||I.nativeEvent.pointerType||"virtual",K=k(Pr(I.currentTarget,I),$),H=C(Pr(I.currentTarget,I),$,!0);Q=K&&H,E.isOverTarget=!1,M(I),w(I)}E.ignoreEmulatedMouseEvents=!1,Q&&I.stopPropagation()}}},U=I=>{if(E.isPressed&&E.target&&Rc(I,E.target)){db(G(I),I.key)&&I.preventDefault();let Q=G(I),$=J(E.target,Q);C(Pr(E.target,I),"keyboard",$),$&&B(I,E.target),v(),I.key!=="Enter"&&Nc(E.target)&&J(E.target,Q)&&!I[sb]&&(I[sb]=!0,Pn(E.target,I,!1)),E.isPressed=!1,E.metaKeyEvents?.delete(I.key)}else if(I.key==="Meta"&&E.metaKeyEvents?.size){let Q=E.metaKeyEvents;E.metaKeyEvents=void 0;for(let $ of Q.values())E.target?.dispatchEvent(new KeyboardEvent("keyup",$))}};if(typeof PointerEvent<"u"){F.onPointerDown=$=>{if($.button!==0||!J($.currentTarget,G($)))return;if(Tw($.nativeEvent)){E.pointerType="virtual";return}E.pointerType=$.pointerType;let K=!0;if(!E.isPressed){E.isPressed=!0,E.isOverTarget=!0,E.activePointerId=$.pointerId,E.target=$.currentTarget,d||rb(E.target),K=x($,E.pointerType);let H=G($);"releasePointerCapture"in H&&("hasPointerCapture"in H?H.hasPointerCapture($.pointerId)&&H.releasePointerCapture($.pointerId):H.releasePointerCapture($.pointerId)),y(ue($.currentTarget),"pointerup",I,!1),y(ue($.currentTarget),"pointercancel",Q,!1)}K&&$.stopPropagation()},F.onMouseDown=$=>{if(J($.currentTarget,G($))&&$.button===0){if(u){let K=Cy($.target);K&&E.disposables.push(K)}$.stopPropagation()}},F.onPointerUp=$=>{!J($.currentTarget,G($))||E.pointerType==="virtual"||$.button===0&&!E.isPressed&&k($,E.pointerType||$.pointerType)},F.onPointerEnter=$=>{$.pointerId===E.activePointerId&&E.target&&!E.isOverTarget&&E.pointerType!=null&&(E.isOverTarget=!0,x(Pr(E.target,$),E.pointerType))},F.onPointerLeave=$=>{$.pointerId===E.activePointerId&&E.target&&E.isOverTarget&&E.pointerType!=null&&(E.isOverTarget=!1,C(Pr(E.target,$),E.pointerType,!1),D($))};let I=$=>{if($.pointerId===E.activePointerId&&E.isPressed&&$.button===0&&E.target){if(J(E.target,G($))&&E.pointerType!=null){let K=!1,H=setTimeout(()=>{E.isPressed&&E.target instanceof HTMLElement&&(K?w($):(Ut(E.target),E.target.click()))},80);y($.currentTarget,"click",()=>K=!0,!0),E.disposables.push(()=>clearTimeout(H))}else w($);E.isOverTarget=!1}},Q=$=>{w($)};F.onDragStart=$=>{J($.currentTarget,G($))&&w($)}}else if(process.env.NODE_ENV==="test"){F.onMouseDown=$=>{if($.button!==0||!J($.currentTarget,G($)))return;if(E.ignoreEmulatedMouseEvents){$.stopPropagation();return}if(E.isPressed=!0,E.isOverTarget=!0,E.target=$.currentTarget,E.pointerType=xc($.nativeEvent)?"virtual":"mouse",Fr.flushSync(()=>x($,E.pointerType))&&$.stopPropagation(),u){let H=Cy($.target);H&&E.disposables.push(H)}y(ue($.currentTarget),"mouseup",I,!1)},F.onMouseEnter=$=>{if(!J($.currentTarget,G($)))return;let K=!0;E.isPressed&&!E.ignoreEmulatedMouseEvents&&E.pointerType!=null&&(E.isOverTarget=!0,K=x($,E.pointerType)),K&&$.stopPropagation()},F.onMouseLeave=$=>{if(!J($.currentTarget,G($)))return;let K=!0;E.isPressed&&!E.ignoreEmulatedMouseEvents&&E.pointerType!=null&&(E.isOverTarget=!1,K=C($,E.pointerType,!1),D($)),K&&$.stopPropagation()},F.onMouseUp=$=>{J($.currentTarget,G($))&&!E.ignoreEmulatedMouseEvents&&$.button===0&&!E.isPressed&&k($,E.pointerType||"mouse")};let I=$=>{if($.button===0){if(E.ignoreEmulatedMouseEvents){E.ignoreEmulatedMouseEvents=!1;return}E.target&&J(E.target,G($))&&E.pointerType!=null||w($),E.isOverTarget=!1}};F.onTouchStart=$=>{if(!J($.currentTarget,G($)))return;let K=zk($.nativeEvent);if(!K)return;E.activePointerId=K.identifier,E.ignoreEmulatedMouseEvents=!0,E.isOverTarget=!0,E.isPressed=!0,E.target=$.currentTarget,E.pointerType="touch",d||rb(E.target),x(qn(E.target,$),E.pointerType)&&$.stopPropagation(),y(We($.currentTarget),"scroll",Q,!0)},F.onTouchMove=$=>{if(!J($.currentTarget,G($)))return;if(!E.isPressed){$.stopPropagation();return}let K=ub($.nativeEvent,E.activePointerId),H=!0;K&&cb(K,$.currentTarget)?!E.isOverTarget&&E.pointerType!=null&&(E.isOverTarget=!0,H=x(qn(E.target,$),E.pointerType)):E.isOverTarget&&E.pointerType!=null&&(E.isOverTarget=!1,H=C(qn(E.target,$),E.pointerType,!1),D(qn(E.target,$))),H&&$.stopPropagation()},F.onTouchEnd=$=>{if(!J($.currentTarget,G($)))return;if(!E.isPressed){$.stopPropagation();return}let K=ub($.nativeEvent,E.activePointerId),H=!0;K&&cb(K,$.currentTarget)&&E.pointerType!=null?(k(qn(E.target,$),E.pointerType),H=C(qn(E.target,$),E.pointerType),B($.nativeEvent,E.target)):E.isOverTarget&&E.pointerType!=null&&(H=C(qn(E.target,$),E.pointerType,!1)),H&&$.stopPropagation(),E.isPressed=!1,E.activePointerId=null,E.isOverTarget=!1,E.ignoreEmulatedMouseEvents=!0,E.target&&!d&&Oc(E.target),v()},F.onTouchCancel=$=>{J($.currentTarget,G($))&&($.stopPropagation(),E.isPressed&&w(qn(E.target,$)))};let Q=$=>{E.isPressed&&J(G($),E.target)&&w({currentTarget:E.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};F.onDragStart=$=>{J($.currentTarget,G($))&&w($)}}return F},[y,l,u,v,d,D,x,M,B]);return m.useEffect(()=>{if(!f||process.env.NODE_ENV==="test")return;const E=ue(f.current);if(!E||!E.head||E.getElementById(lb))return;const F=E.createElement("style");F.id=lb;let U=ib(E);U&&(F.nonce=U),F.textContent=`
25
+ @layer {
26
+ [${ab}] {
27
+ touch-action: pan-x pan-y pinch-zoom;
28
+ }
29
+ }
30
+ `.trim(),E.head.prepend(F)},[f]),m.useEffect(()=>{let E=p.current;return()=>{d||Oc(E.target??void 0);for(let F of E.disposables)F();E.disposables=[]}},[d]),{isPressed:a||g,pressProps:ae(h,V,{[ab]:!0})}}function Nc(t){return t.tagName==="A"&&t.hasAttribute("href")}function Rc(t,e){const{key:n,code:r}=t,o=e,i=o.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(o instanceof We(o).HTMLInputElement&&!fb(o,n)||o instanceof We(o).HTMLTextAreaElement||o.isContentEditable)&&!((i==="link"||!i&&Nc(o))&&n!=="Enter")}function zk(t){const{targetTouches:e}=t;return e.length>0?e[0]:null}function ub(t,e){const n=t.changedTouches;for(let r=0;r<n.length;r++){const o=n[r];if(o.identifier===e)return o}return null}function qn(t,e){let n=0,r=0;return e.targetTouches&&e.targetTouches.length===1&&(n=e.targetTouches[0].clientX,r=e.targetTouches[0].clientY),{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:r}}function Pr(t,e){let n=e.clientX,r=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:r,key:e.key}}function Vk(t){let e=0,n=0;return t.width!==void 0?e=t.width/2:t.radiusX!==void 0&&(e=t.radiusX),t.height!==void 0?n=t.height/2:t.radiusY!==void 0&&(n=t.radiusY),{top:t.clientY-n,right:t.clientX+e,bottom:t.clientY+n,left:t.clientX-e}}function Uk(t,e){return!(t.left>e.right||e.left>t.right||t.top>e.bottom||e.top>t.bottom)}function cb(t,e){let n=e.getBoundingClientRect(),r=Vk(t);return Uk(n,r)}function Hk(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!Nc(t)}function db(t,e){return At()&&e==="Enter"?!1:t instanceof HTMLInputElement?e==="Enter"&&(t.type==="checkbox"||t.type==="radio")?!1:!fb(t,e):Hk(t)}const jk=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function fb(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":jk.has(t.type)}function Ii(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=t,i=m.useRef({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:l}=Fl(),a=m.useCallback(d=>{J(d.currentTarget,G(d))&&i.current.isFocusWithin&&!J(d.currentTarget,d.relatedTarget)&&(i.current.isFocusWithin=!1,l(),n&&n(d),o&&o(!1))},[n,o,i,l]),u=Sy(a),c=m.useCallback(d=>{if(!J(d.currentTarget,G(d)))return;let f=G(d);const h=ue(f),g=Ee(h);if(!i.current.isFocusWithin&&g===f){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,u(d);let b=d.currentTarget;s(h,"focus",p=>{let y=G(p);if(i.current.isFocusWithin&&!J(b,y)){let v=new h.defaultView.FocusEvent("blur",{relatedTarget:y});_y(v,b);let x=yc(v);a(x)}},{capture:!0})}},[r,o,u,s,a]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}function Fi(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,o=m.useRef({isFocused:!1,isFocusVisible:e||Tr()}),[i,s]=m.useState(!1),[l,a]=m.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=m.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),c=m.useCallback(h=>{o.current.isFocused=h,o.current.isFocusVisible=Tr(),s(h),u()},[u]);Nw(h=>{o.current.isFocusVisible=h,u()},[n,i],{enabled:i,isTextInput:n});let{focusProps:d}=$c({isDisabled:r,onFocusChange:c}),{focusWithinProps:f}=Ii({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:l,focusProps:r?f:d}}let Nl=!1,Rl=0;function Bc(){Nl=!0,setTimeout(()=>{Nl=!1},500)}function hb(t){t.pointerType==="touch"&&Bc()}function Gk(){let t=ue(null);if(!(typeof t>"u"))return Rl===0&&(typeof PointerEvent<"u"?t.addEventListener("pointerup",hb):process.env.NODE_ENV==="test"&&t.addEventListener("touchend",Bc)),Rl++,()=>{Rl--,!(Rl>0)&&(typeof PointerEvent<"u"?t.removeEventListener("pointerup",hb):process.env.NODE_ENV==="test"&&t.removeEventListener("touchend",Bc))}}function $r(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:o}=t,[i,s]=m.useState(!1),l=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Gk,[]);let{addGlobalListener:a,removeAllGlobalListeners:u}=Fl(),{hoverProps:c,triggerHoverEnd:d}=m.useMemo(()=>{let f=(b,p)=>{if(l.pointerType=p,o||p==="touch"||l.isHovered||!J(b.currentTarget,G(b)))return;l.isHovered=!0;let y=b.currentTarget;l.target=y,a(ue(G(b)),"pointerover",v=>{l.isHovered&&l.target&&!J(l.target,G(v))&&h(v,v.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:y,pointerType:p}),n&&n(!0),s(!0)},h=(b,p)=>{let y=l.target;l.pointerType="",l.target=null,!(p==="touch"||!l.isHovered||!y)&&(l.isHovered=!1,u(),r&&r({type:"hoverend",target:y,pointerType:p}),n&&n(!1),s(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=b=>{Nl&&b.pointerType==="mouse"||f(b,b.pointerType)},g.onPointerLeave=b=>{!o&&J(b.currentTarget,G(b))&&h(b,b.pointerType)}):process.env.NODE_ENV==="test"&&(g.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=b=>{!l.ignoreEmulatedMouseEvents&&!Nl&&f(b,"mouse"),l.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=b=>{!o&&J(b.currentTarget,G(b))&&h(b,"mouse")}),{hoverProps:g,triggerHoverEnd:h}},[e,n,r,o,l,a,u]);return m.useEffect(()=>{o&&d({currentTarget:l.target},l.pointerType)},[o]),{hoverProps:c,isHovered:i}}const gb=m.createContext({});function pb(t){let{id:e,label:n,"aria-labelledby":r,"aria-label":o,labelElementType:i="label"}=t;e=mt(e);let s=mt(),l={};n?(r=r?`${s} ${r}`:s,l={id:s,htmlFor:i==="label"?e:void 0}):!r&&!o&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");let a=My({id:e,"aria-label":o,"aria-labelledby":r});return{labelProps:l,fieldProps:a}}function zc(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}const qk=m.createContext(null),mb=7e3;let ko=null;function yb(t,e="assertive",n=mb){ko?ko.announce(t,e,n):(ko=new Yk,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?ko.announce(t,e,n):setTimeout(()=>{ko?.isAttached()&&ko?.announce(t,e,n)},100))}class Yk{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){return this.node?.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",r=mb){if(!this.node)return;let o=document.createElement("div");typeof e=="object"?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",e["aria-labelledby"])):o.textContent=e,n==="assertive"?this.assertiveLog?.appendChild(o):this.politeLog?.appendChild(o),e!==""&&setTimeout(()=>{o.remove()},r)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}}function bb(t,e){let{elementType:n="button",isDisabled:r,onPress:o,onPressStart:i,onPressEnd:s,onPressUp:l,onPressChange:a,preventFocusOnPress:u,allowFocusWhenDisabled:c,onClick:d,href:f,target:h,rel:g,type:b="button"}=t,p;n==="button"?p={type:b,disabled:r,form:t.form,formAction:t.formAction,formEncType:t.formEncType,formMethod:t.formMethod,formNoValidate:t.formNoValidate,formTarget:t.formTarget,name:t.name,value:t.value}:p={role:"button",href:n==="a"&&!r?f:void 0,target:n==="a"?h:void 0,type:n==="input"?b:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?g:void 0};let{pressProps:y,isPressed:v}=Kl({onPressStart:i,onPressEnd:s,onPressChange:a,onPress:o,onPressUp:l,onClick:d,isDisabled:r,preventFocusOnPress:u,ref:e}),{focusableProps:x}=Yy(t,e);c&&(x.tabIndex=r?-1:x.tabIndex);let _=ae(x,y,Re(t,{labelable:!0}));return{isPressed:v,buttonProps:ae(p,_,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"],"aria-disabled":t["aria-disabled"]})}}const Bl=m.createContext({}),To=Mc(function(e,n){[e,n]=Mt(e,n,Bl);let r=e,{isPending:o}=r,{buttonProps:i,isPressed:s}=bb(e,n);i=Xk(i,o);let{focusProps:l,isFocused:a,isFocusVisible:u}=Fi(e),{hoverProps:c,isHovered:d}=$r({...e,isDisabled:e.isDisabled||o}),f={isHovered:d,isPressed:(r.isPressed||s)&&!o,isFocused:a,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:o??!1},h=yt({...e,values:f,defaultClassName:"react-aria-Button"}),g=mt(i.id),b=mt(),p=i["aria-labelledby"];o&&(p?p=`${p} ${b}`:i["aria-label"]&&(p=`${g} ${b}`));let y=m.useRef(o);m.useEffect(()=>{let x={"aria-labelledby":p||g};(!y.current&&a&&o||y.current&&a&&!o)&&yb(x,"assertive"),y.current=o},[o,a,p,g]);let v=Re(e,{global:!0});return delete v.onClick,m.createElement(ot.button,{...ae(v,h,i,l,c),type:i.type==="submit"&&o?"button":i.type,id:g,ref:n,"aria-labelledby":p,slot:e.slot||void 0,"aria-disabled":o?"true":i["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":a||void 0,"data-pending":o||void 0,"data-focus-visible":u||void 0},m.createElement(qk.Provider,{value:{id:b}},h.children))}),Zk=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function Xk(t,e){if(e){for(const n in t)n.startsWith("on")&&!Zk.test(n)&&(t[n]=void 0);t.href=void 0,t.target=void 0}return t}const Qk=m.createContext({}),Po=m.createContext({});function $o(t,e){if(!t)return!1;let n=window.getComputedStyle(t),r=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return t===r&&n.overflow!=="hidden"&&(o=!0),o&&e&&(o=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),o}function Vc(t,e){let n=t;for($o(n,e)&&(n=n.parentElement);n&&!$o(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Uc(t,e){let n=[],r=document.scrollingElement||document.documentElement;for(;t&&($o(t,e)&&n.push(t),t!==r);)t=t.parentElement;return n}function zl(t,e,n={}){let{block:r="nearest",inline:o="nearest"}=n;if(t===e)return;let i=t.scrollTop,s=t.scrollLeft,l=e.getBoundingClientRect(),a=t.getBoundingClientRect(),u=window.getComputedStyle(e),c=window.getComputedStyle(t),d=document.scrollingElement||document.documentElement,f=t===d,h=t===d?0:a.top,g=t===d?t.clientHeight:a.bottom,b=t===d?0:a.left,p=t===d?t.clientWidth:a.right,y=parseFloat(u.scrollMarginTop)||0,v=parseFloat(u.scrollMarginBottom)||0,x=parseFloat(u.scrollMarginLeft)||0,_=parseFloat(u.scrollMarginRight)||0,C=parseFloat(c.scrollPaddingTop)||0,T=parseFloat(c.scrollPaddingBottom)||0,k=parseFloat(c.scrollPaddingLeft)||0,S=parseFloat(c.scrollPaddingRight)||0,w=parseFloat(c.borderTopWidth)||0,D=parseFloat(c.borderBottomWidth)||0,M=parseFloat(c.borderLeftWidth)||0,B=parseFloat(c.borderRightWidth)||0,V=l.top-y,E=l.bottom+v,F=l.left-x,U=l.right+_,I=t===d?0:M+B,Q=t===d?0:w+D,$=t===d?0:t.offsetWidth-t.clientWidth-I,K=t===d?0:t.offsetHeight-t.clientHeight-Q,H=h+(f?0:w)+C,me=g-(f?0:D)-T-K,ve=b+(f?0:M)+k,he=p-(f?0:B)-S;Er()&&Vn()||c.direction==="ltr"?he-=$:c.direction==="rtl"&&(ve+=$);let N=V<H||E>me,q=F<ve||U>he;if(N&&r==="start")i+=V-H;else if(N&&r==="center")i+=(V+E)/2-(H+me)/2;else if(N&&r==="end")i+=E-me;else if(N&&r==="nearest"){let ne=V-H,Ae=E-me;i+=Math.abs(ne)<=Math.abs(Ae)?ne:Ae}if(q&&o==="start")s+=F-ve;else if(q&&o==="center")s+=(F+U)/2-(ve+he)/2;else if(q&&o==="end")s+=U-he;else if(q&&o==="nearest"){let ne=F-ve,Ae=U-he;s+=Math.abs(ne)<=Math.abs(Ae)?ne:Ae}if(process.env.NODE_ENV==="test"){t.scrollLeft=s,t.scrollTop=i;return}t.scrollTo({left:s,top:i})}function vb(t,e={}){let{containingElement:n}=e;if(t&&t.isConnected){let r=document.scrollingElement||document.documentElement;if(window.getComputedStyle(r).overflow==="hidden"){let{left:i,top:s}=t.getBoundingClientRect(),l=Uc(t,!0);for(let c of l)zl(c,t);let{left:a,top:u}=t.getBoundingClientRect();if(Math.abs(i-a)>1||Math.abs(s-u)>1){l=n?Uc(n,!0):[];for(let c of l)zl(c,n,{block:"center",inline:"center"});for(let c of Uc(t,!0))zl(c,t)}}else{let{left:i,top:s}=t.getBoundingClientRect();t?.scrollIntoView?.({block:"nearest"});let{left:l,top:a}=t.getBoundingClientRect();(Math.abs(i-l)>1||Math.abs(s-a)>1)&&(n?.scrollIntoView?.({block:"center",inline:"center"}),t.scrollIntoView?.({block:"nearest"}))}}}let Wk=0;const Hc=new Map;function Jk(t){let[e,n]=m.useState();return pe(()=>{if(!t)return;let r=Hc.get(t);if(r)n(r.element.id);else{let o=`react-aria-description-${Wk++}`;n(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=t,document.body.appendChild(i),r={refCount:0,element:i},Hc.set(t,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),Hc.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}const xb={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function _b(t={}){let{style:e,isFocusable:n}=t,[r,o]=m.useState(!1),{focusWithinProps:i}=Ii({isDisabled:!n,onFocusWithinChange:l=>o(l)}),s=m.useMemo(()=>r?e:e?{...xb,...e}:xb,[r]);return{visuallyHiddenProps:{...i,style:s}}}function eT(t){let{children:e,elementType:n="div",isFocusable:r,style:o,...i}=t,{visuallyHiddenProps:s}=_b(t);return m.createElement(n,ae(i,s),e)}const tT=m.createContext(null),Sb={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Cb={...Sb,customError:!0,valid:!1},Oi={isInvalid:!1,validationDetails:Sb,validationErrors:[]},nT=m.createContext({}),Eb="__reactAriaFormValidationState";function rT(t){if(t[Eb]){let{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}=t[Eb];return{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}}return oT(t)}function oT(t){let{isInvalid:e,validationState:n,name:r,value:o,builtinValidation:i,validate:s,validationBehavior:l="aria"}=t;n&&(e||=n==="invalid");let a=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:Cb}:null,u=m.useMemo(()=>{if(!s||o==null)return null;let D=iT(s,o);return wb(D)},[s,o]);i?.validationDetails.valid&&(i=void 0);let c=m.useContext(nT),d=m.useMemo(()=>r?Array.isArray(r)?r.flatMap(D=>jc(c[D])):jc(c[r]):[],[c,r]),[f,h]=m.useState(c),[g,b]=m.useState(!1);c!==f&&(h(c),b(!1));let p=m.useMemo(()=>wb(g?[]:d),[g,d]),y=m.useRef(Oi),[v,x]=m.useState(Oi),_=m.useRef(Oi),C=()=>{if(!T)return;k(!1);let D=u||i||y.current;Gc(D,_.current)||(_.current=D,x(D))},[T,k]=m.useState(!1);return m.useEffect(C),{realtimeValidation:a||p||u||i||Oi,displayValidation:l==="native"?a||p||v:a||p||u||i||v,updateValidation(D){l==="aria"&&!Gc(v,D)?x(D):y.current=D},resetValidation(){let D=Oi;Gc(D,_.current)||(_.current=D,x(D)),l==="native"&&k(!1),b(!0)},commitValidation(){l==="native"&&k(!0),b(!0)}}}function jc(t){return t?Array.isArray(t)?t:[t]:[]}function iT(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return jc(n)}return[]}function wb(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:Cb}:null}function Gc(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,r)=>n===e.validationErrors[r])&&Object.entries(t.validationDetails).every(([n,r])=>e.validationDetails[n]===r)}const sT=m.createContext(null);function lT(t){let{description:e,errorMessage:n,isInvalid:r,validationState:o}=t,{labelProps:i,fieldProps:s}=pb(t),l=Tn([!!e,!!n,r,o]),a=Tn([!!e,!!n,r,o]);return s=ae(s,{"aria-describedby":[l,a,t["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:i,fieldProps:s,descriptionProps:{id:l},errorMessageProps:{id:a}}}function aT(t,e,n){let r=It(o=>{n&&!o.defaultPrevented&&n(e)});m.useEffect(()=>{let o=t?.current?.form;return o?.addEventListener("reset",r),()=>{o?.removeEventListener("reset",r)}},[t])}function uT(t,e,n){let{validationBehavior:r,focus:o}=t;pe(()=>{if(r==="native"&&n?.current&&"setCustomValidity"in n.current&&!n.current.disabled){let u=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(u),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(dT(n.current))}});let i=m.useRef(!1),s=It(()=>{i.current||e.resetValidation()}),l=It(u=>{e.displayValidation.isInvalid||e.commitValidation();let c=n?.current?.form;!u.defaultPrevented&&n&&c&&fT(c)===n.current&&(o?o():n.current?.focus(),$i("keyboard")),u.preventDefault()}),a=It(()=>{e.commitValidation()});m.useEffect(()=>{let u=n?.current;if(!u)return;let c=u.form,d=c?.reset;return c&&(c.reset=()=>{i.current=!window.event||window.event.type==="message"&&G(window.event)instanceof MessagePort,d?.call(c),i.current=!1}),u.addEventListener("invalid",l),u.addEventListener("change",a),c?.addEventListener("reset",s),()=>{u.removeEventListener("invalid",l),u.removeEventListener("change",a),c?.removeEventListener("reset",s),c&&(c.reset=d)}},[n,r])}function cT(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function dT(t){return{isInvalid:!t.validity.valid,validationDetails:cT(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function fT(t){for(let e=0;e<t.elements.length;e++){let n=t.elements[e];if(n.validity?.valid===!1)return n}return null}function hT(t={}){let{isReadOnly:e}=t,[n,r]=kl(t.isSelected,t.defaultSelected||!1,t.onChange),[o]=m.useState(n);function i(l){e||r(l)}function s(){e||r(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??o,setSelected:i,toggle:s}}const gT=m.createContext({}),pT=m.forwardRef(function(e,n){[e,n]=Mt(e,n,gT);let{isDisabled:r,isInvalid:o,isReadOnly:i,onHoverStart:s,onHoverChange:l,onHoverEnd:a,...u}=e;r??=!!e["aria-disabled"]&&e["aria-disabled"]!=="false",o??=!!e["aria-invalid"]&&e["aria-invalid"]!=="false";let{hoverProps:c,isHovered:d}=$r({onHoverStart:s,onHoverChange:l,onHoverEnd:a,isDisabled:r}),{isFocused:f,isFocusVisible:h,focusProps:g}=Fi({within:!0}),b=yt({...e,values:{isHovered:d,isFocusWithin:f,isFocusVisible:h,isDisabled:r,isInvalid:o},defaultClassName:"react-aria-Group"});return m.createElement(ot.div,{...ae(u,g,c),...b,ref:n,role:e.role??"group",slot:e.slot??void 0,"data-focus-within":f||void 0,"data-hovered":d||void 0,"data-focus-visible":h||void 0,"data-disabled":r||void 0,"data-invalid":o||void 0,"data-readonly":i||void 0},b.children)});var kb={};kb={colorSwatchPicker:"تغييرات الألوان",dropzoneLabel:"DropZone",selectPlaceholder:"حدد عنصرًا",tableResizer:"أداة تغيير الحجم"};var Tb={};Tb={colorSwatchPicker:"Цветови мостри",dropzoneLabel:"DropZone",selectPlaceholder:"Изберете предмет",tableResizer:"Преоразмерител"};var Pb={};Pb={colorSwatchPicker:"Vzorky barev",dropzoneLabel:"Místo pro přetažení",selectPlaceholder:"Vyberte položku",tableResizer:"Změna velikosti"};var $b={};$b={colorSwatchPicker:"Farveprøver",dropzoneLabel:"DropZone",selectPlaceholder:"Vælg et element",tableResizer:"Størrelsesændring"};var Db={};Db={colorSwatchPicker:"Farbfelder",dropzoneLabel:"Ablegebereich",selectPlaceholder:"Element wählen",tableResizer:"Größenanpassung"};var Mb={};Mb={colorSwatchPicker:"Χρωματικά δείγματα",dropzoneLabel:"DropZone",selectPlaceholder:"Επιλέξτε ένα αντικείμενο",tableResizer:"Αλλαγή μεγέθους"};var Ab={};Ab={selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"};var Lb={};Lb={colorSwatchPicker:"Muestras de colores",dropzoneLabel:"DropZone",selectPlaceholder:"Seleccionar un artículo",tableResizer:"Cambiador de tamaño"};var Ib={};Ib={colorSwatchPicker:"Värvinäidised",dropzoneLabel:"DropZone",selectPlaceholder:"Valige üksus",tableResizer:"Suuruse muutja"};var Fb={};Fb={colorSwatchPicker:"Värimallit",dropzoneLabel:"DropZone",selectPlaceholder:"Valitse kohde",tableResizer:"Koon muuttaja"};var Ob={};Ob={colorSwatchPicker:"Échantillons de couleurs",dropzoneLabel:"DropZone",selectPlaceholder:"Sélectionner un élément",tableResizer:"Redimensionneur"};var Kb={};Kb={colorSwatchPicker:"דוגמיות צבע",dropzoneLabel:"DropZone",selectPlaceholder:"בחר פריט",tableResizer:"שינוי גודל"};var Nb={};Nb={colorSwatchPicker:"Uzorci boja",dropzoneLabel:"Zona spuštanja",selectPlaceholder:"Odaberite stavku",tableResizer:"Promjena veličine"};var Rb={};Rb={colorSwatchPicker:"Színtárak",dropzoneLabel:"DropZone",selectPlaceholder:"Válasszon ki egy elemet",tableResizer:"Átméretező"};var Bb={};Bb={colorSwatchPicker:"Campioni di colore",dropzoneLabel:"Zona di rilascio",selectPlaceholder:"Seleziona un elemento",tableResizer:"Ridimensionamento"};var zb={};zb={colorSwatchPicker:"カラースウォッチ",dropzoneLabel:"ドロップゾーン",selectPlaceholder:"項目を選択",tableResizer:"サイズ変更ツール"};var Vb={};Vb={colorSwatchPicker:"색상 견본",dropzoneLabel:"드롭 영역",selectPlaceholder:"항목 선택",tableResizer:"크기 조정기"};var Ub={};Ub={colorSwatchPicker:"Spalvų pavyzdžiai",dropzoneLabel:"„DropZone“",selectPlaceholder:"Pasirinkite elementą",tableResizer:"Dydžio keitiklis"};var Hb={};Hb={colorSwatchPicker:"Krāsu paraugi",dropzoneLabel:"DropZone",selectPlaceholder:"Izvēlēties vienumu",tableResizer:"Izmēra mainītājs"};var jb={};jb={colorSwatchPicker:"Fargekart",dropzoneLabel:"Droppsone",selectPlaceholder:"Velg et element",tableResizer:"Størrelsesendrer"};var Gb={};Gb={colorSwatchPicker:"kleurstalen",dropzoneLabel:"DropZone",selectPlaceholder:"Selecteer een item",tableResizer:"Resizer"};var qb={};qb={colorSwatchPicker:"Próbki kolorów",dropzoneLabel:"Strefa upuszczania",selectPlaceholder:"Wybierz element",tableResizer:"Zmiana rozmiaru"};var Yb={};Yb={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var Zb={};Zb={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var Xb={};Xb={colorSwatchPicker:"Specimene de culoare",dropzoneLabel:"Zonă de plasare",selectPlaceholder:"Selectați un element",tableResizer:"Instrument de redimensionare"};var Qb={};Qb={colorSwatchPicker:"Цветовые образцы",dropzoneLabel:"DropZone",selectPlaceholder:"Выберите элемент",tableResizer:"Средство изменения размера"};var Wb={};Wb={colorSwatchPicker:"Vzorkovníky farieb",dropzoneLabel:"DropZone",selectPlaceholder:"Vyberte položku",tableResizer:"Nástroj na zmenu veľkosti"};var Jb={};Jb={colorSwatchPicker:"Barvne palete",dropzoneLabel:"DropZone",selectPlaceholder:"Izberite element",tableResizer:"Spreminjanje velikosti"};var ev={};ev={colorSwatchPicker:"Uzorci boje",dropzoneLabel:"DropZone",selectPlaceholder:"Izaberite stavku",tableResizer:"Promena veličine"};var tv={};tv={colorSwatchPicker:"Färgrutor",dropzoneLabel:"DropZone",selectPlaceholder:"Välj en artikel",tableResizer:"Storleksändrare"};var nv={};nv={colorSwatchPicker:"Renk örnekleri",dropzoneLabel:"Bırakma Bölgesi",selectPlaceholder:"Bir öğe seçin",tableResizer:"Yeniden boyutlandırıcı"};var rv={};rv={colorSwatchPicker:"Зразки кольорів",dropzoneLabel:"DropZone",selectPlaceholder:"Виберіть елемент",tableResizer:"Засіб змінення розміру"};var ov={};ov={colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"};var iv={};iv={colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizer:"大小調整器"};var sv={};sv={"ar-AE":kb,"bg-BG":Tb,"cs-CZ":Pb,"da-DK":$b,"de-DE":Db,"el-GR":Mb,"en-US":Ab,"es-ES":Lb,"et-EE":Ib,"fi-FI":Fb,"fr-FR":Ob,"he-IL":Kb,"hr-HR":Nb,"hu-HU":Rb,"it-IT":Bb,"ja-JP":zb,"ko-KR":Vb,"lt-LT":Ub,"lv-LV":Hb,"nb-NO":jb,"nl-NL":Gb,"pl-PL":qb,"pt-BR":Yb,"pt-PT":Zb,"ro-RO":Xb,"ru-RU":Qb,"sk-SK":Wb,"sl-SI":Jb,"sr-SP":ev,"sv-SE":tv,"tr-TR":nv,"uk-UA":rv,"zh-CN":ov,"zh-TW":iv};const Vl=m.createContext({}),lv=m.createContext(null),mT=m.forwardRef(function(e,n){let{render:r}=m.useContext(lv);return m.createElement(m.Fragment,null,r(e,n))});function av(t,e){let n=t?.renderDropIndicator,r=t?.isVirtualDragging?.(),o=m.useCallback(i=>{if(r||e?.isDropTarget(i))return n?n(i):m.createElement(mT,{target:i})},[e?.target,r,n]);return t?.useDropIndicator?o:void 0}function yT(t,e,n){let r=t.focusedKey,o=null;if(e?.isVirtualDragging?.()&&n?.target?.type==="item"&&(o=n.target.key,n.target.dropPosition==="after")){let i=n.collection.getKeyAfter(o),s=null;if(i!=null){let l=n.collection.getItem(o)?.level??0;for(;i!=null;){let a=n.collection.getItem(i);if(!a)break;if(a.type!=="item"){i=n.collection.getKeyAfter(i);continue}if((a.level??0)<=l)break;s=i,i=n.collection.getKeyAfter(i)}}o=i??s??o}return m.useMemo(()=>new Set([r,o].filter(i=>i!=null)),[r,o])}const bT=m.createContext({}),vT=m.createContext(null);function xT(t){let e=m.useRef({});return m.createElement(vT.Provider,{value:e},t.children)}const qc=m.createContext({isSelected:!1});function _T(t){let e=Re(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}const uv=m.createContext({}),Md=class Md extends Co{filter(e,n){let r=n.getItem(this.prevKey);if(r&&r.type!=="separator"){let o=this.clone();return n.addDescendants(o,e),o}return null}};Md.type="separator";let Yc=Md;const Zc=Al(Yc,function(e,n){[e,n]=Mt(e,n,uv);let{elementType:r,orientation:o,style:i,className:s,slot:l,...a}=e,u=r||"hr";u==="hr"&&o==="vertical"&&(u="div");let c=ot[u],{separatorProps:d}=_T({...a,elementType:r,orientation:o}),f=Re(e,{global:!0});return m.createElement(c,{render:e.render,...ae(f,d),style:i,className:s??"react-aria-Separator",ref:n,slot:l||void 0})}),Xc=new WeakMap;function ST(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function CT(t,e){let n=Xc.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${ST(e)}`}class ET{constructor(e,n,r,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=s=>{if(s.nodeType===Node.ELEMENT_NODE){const l=s.shadowRoot;if(l){const a=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(a),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(s);if(this.filter?.acceptNode)return this.filter.acceptNode(s);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=n,this.filter=o??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(e.createTreeWalker(n,r,this._acceptNode));const i=n.shadowRoot;if(i){const s=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(s)}}get currentNode(){return this._currentNode}set currentNode(e){if(!J(this.root,e))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=e,o=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const s=r,l=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});n.push(l),l.currentNode=o,this._currentSetFor.add(l),r=o=s.host}else r=r.parentNode;const i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(i),i.currentNode=o,this._currentSetFor.add(i),this._walkerStack=n}get doc(){return this._doc}firstChild(){let e=this.currentNode,n=this.nextNode();return J(e,n)?(n&&(this.currentNode=n),n):(this.currentNode=e,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):this.filter?.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let o=this.nextNode();return o&&(this.currentNode=o),o}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null;return null}const n=e.previousNode();if(n){if(n.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(n):this.filter?.acceptNode&&(o=this.filter.acceptNode(n)),o===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let i=this.lastChild();return i&&(this.currentNode=i),i}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function cv(t,e,n,r){return en()?new ET(t,e,n,r):t.createTreeWalker(e,n,r)}const dv=m.createContext(null),Qc="react-aria-focus-scope-restore";let Me=null;function fv(t){let{children:e,contain:n,restoreFocus:r,autoFocus:o}=t,i=m.useRef(null),s=m.useRef(null),l=m.useRef([]),{parentNode:a}=m.useContext(dv)||{},u=m.useMemo(()=>new td({scopeRef:l}),[l]);pe(()=>{let f=a||Ve.root;if(Ve.getTreeNode(f.scopeRef)&&Me&&!Ul(Me,f.scopeRef)){let h=Ve.getTreeNode(Me);h&&(f=h)}f.addChild(u),Ve.addNode(u)},[u,a]),pe(()=>{let f=Ve.getTreeNode(l);f&&(f.contain=!!n)},[n]),pe(()=>{let f=i.current?.nextSibling,h=[],g=b=>b.stopPropagation();for(;f&&f!==s.current;)h.push(f),f.addEventListener(Qc,g),f=f.nextSibling;return l.current=h,()=>{for(let b of h)b.removeEventListener(Qc,g)}},[e]),MT(l,r,n),PT(l,n),AT(l,r,n),DT(l,o),m.useEffect(()=>{const f=Ee(ue(l.current?l.current[0]:void 0));let h=null;if(Ft(f,l.current)){for(let g of Ve.traverse())g.scopeRef&&Ft(f,g.scopeRef.current)&&(h=g);h===Ve.getTreeNode(l)&&(Me=h.scopeRef)}},[l]),pe(()=>()=>{let f=Ve.getTreeNode(l)?.parent?.scopeRef??null;(l===Me||Ul(l,Me))&&(!f||Ve.getTreeNode(f))&&(Me=f),Ve.removeTreeNode(l)},[l]);let c=m.useMemo(()=>wT(l),[]),d=m.useMemo(()=>({focusManager:c,parentNode:u}),[u,c]);return m.createElement(dv.Provider,{value:d},m.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),e,m.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}function wT(t){return{focusNext(e={}){let n=t.current,{from:r,tabbable:o,wrap:i,accept:s}=e,l=r||Ee(ue(n[0]??void 0)),a=n[0].previousElementSibling,u=Dr(n),c=_t(u,{tabbable:o,accept:s},n);c.currentNode=Ft(l,n)?l:a;let d=c.nextNode();return!d&&i&&(c.currentNode=a,d=c.nextNode()),d&&lt(d,!0),d},focusPrevious(e={}){let n=t.current,{from:r,tabbable:o,wrap:i,accept:s}=e,l=r||Ee(ue(n[0]??void 0)),a=n[n.length-1].nextElementSibling,u=Dr(n),c=_t(u,{tabbable:o,accept:s},n);c.currentNode=Ft(l,n)?l:a;let d=c.previousNode();return!d&&i&&(c.currentNode=a,d=c.previousNode()),d&&lt(d,!0),d},focusFirst(e={}){let n=t.current,{tabbable:r,accept:o}=e,i=Dr(n),s=_t(i,{tabbable:r,accept:o},n);s.currentNode=n[0].previousElementSibling;let l=s.nextNode();return l&&lt(l,!0),l},focusLast(e={}){let n=t.current,{tabbable:r,accept:o}=e,i=Dr(n),s=_t(i,{tabbable:r,accept:o},n);s.currentNode=n[n.length-1].nextElementSibling;let l=s.previousNode();return l&&lt(l,!0),l}}}function Dr(t){return t[0].parentElement}function Ki(t){let e=Ve.getTreeNode(Me);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function kT(t){if(!t.form)return Array.from(ue(t).querySelectorAll(`input[type="radio"][name="${CSS.escape(t.name)}"]`)).filter(r=>!r.form);const e=t.form.elements.namedItem(t.name);let n=We(t);return e instanceof n.RadioNodeList?Array.from(e).filter(r=>r instanceof n.HTMLInputElement):e instanceof n.HTMLInputElement?[e]:[]}function TT(t){if(t.checked)return!0;const e=kT(t);return e.length>0&&!e.some(n=>n.checked)}function PT(t,e){let n=m.useRef(void 0),r=m.useRef(void 0);pe(()=>{let o=t.current;if(!e){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const i=ue(o?o[0]:void 0);let s=u=>{if(u.key!=="Tab"||u.altKey||u.ctrlKey||u.metaKey||!Ki(t)||u.isComposing)return;let c=Ee(i),d=t.current;if(!d||!Ft(c,d))return;let f=Dr(d),h=_t(f,{tabbable:!0},d);if(!c)return;h.currentNode=c;let g=u.shiftKey?h.previousNode():h.nextNode();g||(h.currentNode=u.shiftKey?d[d.length-1].nextElementSibling:d[0].previousElementSibling,g=u.shiftKey?h.previousNode():h.nextNode()),u.preventDefault(),g&&(lt(g,!0),g instanceof We(g).HTMLInputElement&&g.select())},l=u=>{(!Me||Ul(Me,t))&&Ft(G(u),t.current)?(Me=t,n.current=G(u)):Ki(t)&&!Yn(G(u),t)?n.current?lt(n.current):Me&&Me.current&&Wc(Me.current):Ki(t)&&(n.current=G(u))},a=u=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let c=Pi(),d=(c==="virtual"||c===null)&&vl()&&vc(),f=Ee(i);if(!d&&f&&Ki(t)&&!Yn(f,t)){Me=t;let h=G(u);h&&h.isConnected?(n.current=h,lt(n.current)):Me.current&&Wc(Me.current)}})};return i.addEventListener("keydown",s,!1),i.addEventListener("focusin",l,!1),o?.forEach(u=>u.addEventListener("focusin",l,!1)),o?.forEach(u=>u.addEventListener("focusout",a,!1)),()=>{i.removeEventListener("keydown",s,!1),i.removeEventListener("focusin",l,!1),o?.forEach(u=>u.removeEventListener("focusin",l,!1)),o?.forEach(u=>u.removeEventListener("focusout",a,!1))}},[t,e]),pe(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function hv(t){return Yn(t)}function Ft(t,e){return!t||!e?!1:e.some(n=>J(n,t))}function Yn(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of Ve.traverse(Ve.getTreeNode(e)))if(n&&Ft(t,n.current))return!0;return!1}function $T(t){return Yn(t,Me)}function Ul(t,e){let n=Ve.getTreeNode(e)?.parent;for(;n;){if(n.scopeRef===t)return!0;n=n.parent}return!1}function lt(t,e=!1){if(t!=null&&!e)try{jn(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function gv(t,e=!0){let n=t[0].previousElementSibling,r=Dr(t),o=_t(r,{tabbable:e},t);o.currentNode=n;let i=o.nextNode();return e&&!i&&(r=Dr(t),o=_t(r,{tabbable:!1},t),o.currentNode=n,i=o.nextNode()),i}function Wc(t,e=!0){lt(gv(t,e))}function DT(t,e){const n=m.useRef(e);m.useEffect(()=>{if(n.current){Me=t;const r=ue(t.current?t.current[0]:void 0);!Ft(Ee(r),Me.current)&&t.current&&Wc(t.current)}n.current=!1},[t])}function MT(t,e,n){pe(()=>{if(e||n)return;let r=t.current;const o=ue(r?r[0]:void 0);let i=s=>{let l=G(s);Ft(l,t.current)?Me=t:hv(l)||(Me=null)};return o.addEventListener("focusin",i,!1),r?.forEach(s=>s.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),r?.forEach(s=>s.removeEventListener("focusin",i,!1))}},[t,e,n])}function pv(t){let e=Ve.getTreeNode(Me);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return e?.scopeRef===t}function AT(t,e,n){const r=m.useRef(typeof document<"u"?Ee(ue(t.current?t.current[0]:void 0)):null);pe(()=>{let o=t.current;const i=ue(o?o[0]:void 0);if(!e||n)return;let s=()=>{(!Me||Ul(Me,t))&&Ft(Ee(i),t.current)&&(Me=t)};return i.addEventListener("focusin",s,!1),o?.forEach(l=>l.addEventListener("focusin",s,!1)),()=>{i.removeEventListener("focusin",s,!1),o?.forEach(l=>l.removeEventListener("focusin",s,!1))}},[t,n]),pe(()=>{const o=ue(t.current?t.current[0]:void 0);if(!e)return;let i=s=>{if(s.key!=="Tab"||s.altKey||s.ctrlKey||s.metaKey||!Ki(t)||s.isComposing)return;let l=o.activeElement;if(!Yn(l,t)||!pv(t))return;let a=Ve.getTreeNode(t);if(!a)return;let u=a.nodeToRestore,c=_t(o.body,{tabbable:!0});c.currentNode=l;let d=s.shiftKey?c.previousNode():c.nextNode();if((!u||!u.isConnected||u===o.body)&&(u=void 0,a.nodeToRestore=void 0),(!d||!Yn(d,t))&&u){c.currentNode=u;do d=s.shiftKey?c.previousNode():c.nextNode();while(Yn(d,t));s.preventDefault(),s.stopPropagation(),d?lt(d,!0):hv(u)?lt(u,!0):l.blur()}};return n||o.addEventListener("keydown",i,!0),()=>{n||o.removeEventListener("keydown",i,!0)}},[t,e,n]),pe(()=>{const o=ue(t.current?t.current[0]:void 0);if(!e)return;let i=Ve.getTreeNode(t);if(i)return i.nodeToRestore=r.current??void 0,()=>{let s=Ve.getTreeNode(t);if(!s)return;let l=s.nodeToRestore,a=Ee(o);if(e&&l&&(a&&Yn(a,t)||a===o.body&&pv(t))){let u=Ve.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let c=u.getTreeNode(t);for(;c;){if(c.nodeToRestore&&c.nodeToRestore.isConnected){mv(c.nodeToRestore);return}c=c.parent}for(c=u.getTreeNode(t);c;){if(c.scopeRef&&c.scopeRef.current&&Ve.getTreeNode(c.scopeRef)){let d=gv(c.scopeRef.current,!0);mv(d);return}c=c.parent}}})}}},[t,e])}function mv(t){t.dispatchEvent(new CustomEvent(Qc,{bubbles:!0,cancelable:!0}))&&lt(t)}function _t(t,e,n){let r=e?.tabbable?mc:vy,o=t?.nodeType===Node.ELEMENT_NODE?t:null,i=ue(o),s=cv(i,t||i,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return J(e?.from,l)||e?.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!TT(l)||s.currentNode.tagName==="INPUT"&&s.currentNode.type==="radio"&&s.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:r(l)&&(!n||Ft(l,n))&&(!e?.accept||e.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e?.from&&(s.currentNode=e.from),s}function LT(t,e={}){return{focusNext(n={}){let r=t.current;if(!r)return null;let{from:o,tabbable:i=e.tabbable,wrap:s=e.wrap,accept:l=e.accept}=n,a=o||Ee(ue(r)),u=_t(r,{tabbable:i,accept:l});J(r,a)&&(u.currentNode=a);let c=u.nextNode();return!c&&s&&(u.currentNode=r,c=u.nextNode()),c&&lt(c,!0),c},focusPrevious(n=e){let r=t.current;if(!r)return null;let{from:o,tabbable:i=e.tabbable,wrap:s=e.wrap,accept:l=e.accept}=n,a=o||Ee(ue(r)),u=_t(r,{tabbable:i,accept:l});if(J(r,a))u.currentNode=a;else{let d=Jc(u);return d&&lt(d,!0),d??null}let c=u.previousNode();if(!c&&s){u.currentNode=r;let d=Jc(u);if(!d)return null;c=d}return c&&lt(c,!0),c??null},focusFirst(n=e){let r=t.current;if(!r)return null;let{tabbable:o=e.tabbable,accept:i=e.accept}=n,l=_t(r,{tabbable:o,accept:i}).nextNode();return l&&lt(l,!0),l},focusLast(n=e){let r=t.current;if(!r)return null;let{tabbable:o=e.tabbable,accept:i=e.accept}=n,s=_t(r,{tabbable:o,accept:i}),l=Jc(s);return l&&lt(l,!0),l??null}}}function Jc(t){let e,n;do n=t.lastChild(),n&&(e=n);while(n);return e}class ed{constructor(){this.fastMap=new Map,this.root=new td({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,r){let o=this.fastMap.get(n??null);if(!o)return;let i=new td({scopeRef:e});o.addChild(i),i.parent=o,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let r=n.parent;for(let i of this.traverse())i!==n&&n.nodeToRestore&&i.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&Ft(i.nodeToRestore,n.scopeRef.current)&&(i.nodeToRestore=n.nodeToRestore);let o=n.children;r&&(r.removeChild(n),o.size>0&&o.forEach(i=>r&&r.addChild(i))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){let e=new ed;for(let n of this.traverse())e.addTreeNode(n.scopeRef,n.parent?.scopeRef??null,n.nodeToRestore);return e}}class td{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let Ve=new ed;function nd(t){return kw()?t.altKey:t.ctrlKey}function Mr(t,e){let n=`[data-key="${CSS.escape(String(e))}"]`,r=t.current?.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),t.current?.querySelector(n)}const yv=new WeakMap;function IT(t){let e=mt();return yv.set(t,e),e}function FT(t){return yv.get(t)}const bv=1e3;function vv(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,o=m.useRef({search:"",timeout:void 0}),i=l=>{if(o.current.search.length>0&&l.key===" "){if(l.preventDefault(),(!("continuePropagation"in l)||"continuePropagation"in l&&!l.isPropagationStopped())&&l.stopPropagation(),o.current.search+=" ",e.getKeyForSearch!=null){let a=e.getKeyForSearch(o.current.search,n.focusedKey);a==null&&(a=e.getKeyForSearch(o.current.search)),a!=null&&(n.setFocusedKey(a),r&&r(a))}clearTimeout(o.current.timeout),o.current.timeout=setTimeout(()=>{o.current.search=""},bv)}},s=l=>{let a=OT(l.key);if(!(!a||l.ctrlKey||l.metaKey||l.altKey||!J(l.currentTarget,G(l))||o.current.search.length===0&&a===" ")){if(o.current.search+=a,e.getKeyForSearch!=null){let u=e.getKeyForSearch(o.current.search,n.focusedKey);if(u==null&&(u=e.getKeyForSearch(o.current.search)),u!=null)n.setFocusedKey(u),r&&r(u),l.preventDefault(),"continuePropagation"in l||l.stopPropagation();else{o.current.search="",clearTimeout(o.current.timeout),o.current.timeout=void 0;return}}clearTimeout(o.current.timeout),o.current.timeout=setTimeout(()=>{o.current.search=""},bv)}};return m.useEffect(()=>{let l=o.current.timeout;return()=>{clearTimeout(l)}},[o]),{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?i:void 0,onKeyDown:e.getKeyForSearch?s:void 0}}}function OT(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function xv(t,e){const n=m.useRef(!0),r=m.useRef(null);pe(()=>(n.current=!0,()=>{n.current=!1}),[]),pe(()=>{n.current?n.current=!1:(!r.current||e.some((o,i)=>!Object.is(o,r[i])))&&t(),r.current=e},e)}function KT(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:o=!1,shouldFocusWrap:i=!1,disallowEmptySelection:s=!1,disallowSelectAll:l=!1,escapeKeyBehavior:a="clearSelection",selectOnFocus:u=e.selectionBehavior==="replace",disallowTypeAhead:c=!1,shouldUseVirtualFocus:d,allowsTabNavigation:f=!1,scrollRef:h=r,linkBehavior:g="action",UNSTABLE_focusOnEntry:b}=t,{direction:p}=Un(),y=xl();const v=(Y,j,Ue)=>{if(j!=null){if(e.isLink(j)&&g==="selection"&&u&&!nd(Y)){Fr.flushSync(()=>{e.setFocusedKey(j,Ue)});let Le=Mr(r,j),ra=e.getItemProps(j);if(Le){y.open(Le,Y,ra.href,ra.routerOptions);return}return!1}if(e.setFocusedKey(j,Ue),e.isLink(j)&&g==="override")return!1;if(Y.shiftKey&&e.selectionMode==="multiple"){e.extendSelection(j);return}else if(u&&!nd(Y)){e.replaceSelection(j);return}}return!1};let x=Y=>{if(n.getKeyBelow){let j=e.focusedKey!=null?n.getKeyBelow?.(e.focusedKey):n.getFirstKey?.();if(j==null&&i&&(j=n.getFirstKey?.(e.focusedKey)),j!=null){v(Y,j);return}}return!1},_=Y=>{if(n.getKeyAbove){let j=e.focusedKey!=null?n.getKeyAbove?.(e.focusedKey):n.getLastKey?.();if(j==null&&i&&(j=n.getLastKey?.(e.focusedKey)),j!=null){v(Y,j);return}}return!1},C=Y=>{if(n.getFirstKey){if(e.focusedKey===null&&Y.shiftKey)return!1;let j=n.getFirstKey(e.focusedKey,Di(Y));if(e.setFocusedKey(j),j!=null){if(Di(Y)&&Y.shiftKey&&e.selectionMode==="multiple"){e.extendSelection(j);return}else if(u){e.replaceSelection(j);return}}}return!1},T=Y=>{if(n.getKeyLeftOf){let j=e.focusedKey!=null?n.getKeyLeftOf?.(e.focusedKey):n.getFirstKey?.();if(j==null&&i&&(j=p==="rtl"?n.getFirstKey?.(e.focusedKey):n.getLastKey?.(e.focusedKey)),j!=null){v(Y,j,p==="rtl"?"first":"last");return}}return!1},k=Y=>{if(n.getKeyRightOf){let j=e.focusedKey!=null?n.getKeyRightOf?.(e.focusedKey):n.getFirstKey?.();if(j==null&&i&&(j=p==="rtl"?n.getLastKey?.(e.focusedKey):n.getFirstKey?.(e.focusedKey)),j!=null){v(Y,j,p==="rtl"?"last":"first");return}}return!1},S=Y=>{if(n.getLastKey){if(e.focusedKey===null&&Y.shiftKey)return!1;let j=n.getLastKey(e.focusedKey,Di(Y));if(e.setFocusedKey(j),j!=null){if(Di(Y)&&Y.shiftKey&&e.selectionMode==="multiple"){e.extendSelection(j);return}else if(u){e.replaceSelection(j);return}}}return!1},w=Y=>{if(n.getKeyPageBelow&&e.focusedKey!=null){let j=n.getKeyPageBelow(e.focusedKey);if(j!=null)return v(Y,j)}return!1},D=Y=>{if(n.getKeyPageAbove&&e.focusedKey!=null){let j=n.getKeyPageAbove(e.focusedKey);if(j!=null)return v(Y,j)}return!1},M=()=>{if(e.selectionMode==="multiple"&&l!==!0){e.selectAll();return}return!1},B=()=>{if(a==="clearSelection"&&!s&&e.selectedKeys.size!==0){e.clearSelection();return}return!1},V=()=>{if(!f&&r.current){let Y=_t(r.current,{tabbable:!0}),j,Ue;do Ue=Y.lastChild(),Ue&&(j=Ue);while(Ue);let Le=Ee();j&&(!ki(j)||Le&&!mc(Le))&&Ut(j)}return{shouldContinuePropagation:!0,shouldPreventDefault:!1}},E=()=>(!f&&r.current&&r.current.focus(),{shouldContinuePropagation:!0,shouldPreventDefault:!1}),F=(Y,j)=>({[At()?Y+"+Shift+Alt":Y+"+Shift+Control"]:j,[Y+"+Shift"]:j,[At()?Y+"+Alt":Y+"+Control"]:j,[Y]:j}),{keyboardProps:U}=Gn({shortcuts:{...F("ArrowDown",x),...F("ArrowUp",_),...F("ArrowLeft",T),...F("ArrowRight",k),...F("PageDown",w),...F("PageUp",D)},allowRepeats:!0}),{keyboardProps:I}=Gn({shortcuts:{...F("Home",C),...F("End",S),"Mod+A":M,Escape:B,Tab:V,"Tab+Shift":E}}),Q=m.useRef({top:0,left:0});Cl(h,"scroll",()=>{Q.current={top:h.current?.scrollTop??0,left:h.current?.scrollLeft??0}});let $=Y=>{if(e.isFocused){J(Y.currentTarget,G(Y))||e.setFocused(!1);return}if(!J(Y.currentTarget,G(Y)))return;let j=Pi();e.setFocused(!0);let Ue=Le=>{Le!=null&&(e.setFocusedKey(Le),u&&!e.isSelected(Le)&&e.replaceSelection(Le))};if(b&&(j==="keyboard"||j==="virtual"))Ue(b==="first"?n.getFirstKey?.():n.getLastKey?.());else if(e.focusedKey==null){let Le=Y.relatedTarget;Le&&Y.currentTarget.compareDocumentPosition(Le)&Node.DOCUMENT_POSITION_FOLLOWING?Ue(e.lastSelectedKey??n.getLastKey?.()):Ue(e.firstSelectedKey??n.getFirstKey?.())}else h.current&&(h.current.scrollTop=Q.current.top,h.current.scrollLeft=Q.current.left);if(e.focusedKey!=null&&h.current){let Le=Mr(r,e.focusedKey);Le instanceof HTMLElement&&(!ki(Le)&&!d&&Ut(Le),(j==="keyboard"||b&&j==="virtual")&&vb(Le,{containingElement:r.current}))}},K=Y=>{J(Y.currentTarget,Y.relatedTarget)||e.setFocused(!1)},H=m.useRef(!1);Cl(r,uw,d?Y=>{let{detail:j}=Y;Y.stopPropagation(),e.setFocused(!0),j?.focusStrategy==="first"&&(H.current=!0)}:void 0);let me=n.getFirstKey?.()??null;xv(()=>{if(H.current)if(me==null){let Y=Ee();yy(r.current),by(Y,null),e.collection.size>0&&(H.current=!1)}else e.setFocusedKey(me),H.current=!1},[me,e.collection.size]),xv(()=>{e.collection.size>0&&(H.current=!1)},[e.focusedKey]),Cl(r,aw,d?Y=>{Y.stopPropagation(),e.setFocused(!1),Y.detail?.clearFocusKey&&e.setFocusedKey(null)}:void 0);const ve=m.useRef(o),he=m.useRef(!1);m.useEffect(()=>{if(ve.current){let Y=null;o==="first"&&(Y=n.getFirstKey?.()??null),o==="last"&&(Y=n.getLastKey?.()??null);let j=e.selectedKeys;if(j.size){for(let Ue of j)if(e.canSelectItem(Ue)){Y=Ue;break}}e.setFocused(!0),e.setFocusedKey(Y),Y==null&&!d&&r.current&&jn(r.current),e.collection.size>0&&(ve.current=!1,he.current=!0)}});let N=m.useRef(e.focusedKey),q=m.useRef(null);m.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==N.current||he.current)&&h.current&&r.current){let Y=Pi(),j=Mr(r,e.focusedKey);if(!(j instanceof HTMLElement))return;(Y==="keyboard"||he.current)&&(q.current&&cancelAnimationFrame(q.current),q.current=requestAnimationFrame(()=>{h.current&&(zl(h.current,j),Y!=="virtual"&&vb(j,{containingElement:r.current}))}))}!d&&e.isFocused&&e.focusedKey==null&&N.current!=null&&r.current&&jn(r.current),N.current=e.focusedKey,he.current=!1}),m.useEffect(()=>()=>{q.current&&cancelAnimationFrame(q.current)},[]),Cl(r,"react-aria-focus-scope-restore",Y=>{Y.preventDefault(),e.setFocused(!0)});let ne={...ae(I,U),onFocus:$,onBlur:K,onMouseDown(Y){h.current===G(Y)&&Y.preventDefault()}},{typeSelectProps:Ae}=vv({keyboardDelegate:n,selectionManager:e});c||(ne=ae(Ae,ne));let _e;d||(_e=e.focusedKey==null?0:-1);let Kt=IT(e.collection);return{collectionProps:ae(ne,{tabIndex:_e,"data-collection":Kt})}}class _v{constructor(e){this.ref=e}getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?Mr(this.ref,e):null;if(!r)return null;let o=n.getBoundingClientRect(),i=r.getBoundingClientRect();return{x:i.left-o.left-n.clientLeft+n.scrollLeft,y:i.top-o.top-n.clientTop+n.scrollTop,width:i.width,height:i.height}}getContentSize(){let e=this.ref.current;return{width:e?.scrollWidth??0,height:e?.scrollHeight??0}}getVisibleRect(){let e=this.ref.current;return{x:e?.scrollLeft??0,y:e?.scrollTop??0,width:e?.clientWidth??0,height:e?.clientHeight??0}}}class rd{constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new _v(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new _v(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){return this.disabledBehavior==="all"&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&e.props?.disabledBehavior!=="selection"}findNextNonDisabled(e,n,r=!1){let o=e;for(;o!=null;){let i=this.collection.getItem(o);if(i?.type==="item"&&(r||!this.isDisabled(i)))return o;o=n(o)}return null}getNextKey(e,n){let r=e;return r=this.collection.getKeyAfter(r),this.findNextNonDisabled(r,o=>this.collection.getKeyAfter(o),n?.includeDisabled)}getPreviousKey(e,n){let r=e;return r=this.collection.getKeyBefore(r),this.findNextNonDisabled(r,o=>this.collection.getKeyBefore(o),n?.includeDisabled)}findKey(e,n,r){let o=e,i=this.layoutDelegate.getItemRect(o);if(!i||o==null)return null;let s=i;do{if(o=n(o),o==null)break;i=this.layoutDelegate.getItemRect(o)}while(i&&r(s,i)&&o!=null);return o}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}isReversed(e){let n=this.getNextKey(e),r=Mr(this.ref,e);if(n!=null){let i=Mr(this.ref,n);return!r||!i?!1:r.getBoundingClientRect().top>i.getBoundingClientRect().top}let o=this.getPreviousKey(e);if(o!=null){let i=Mr(this.ref,o);return!r||!i?!1:i.getBoundingClientRect().top>r.getBoundingClientRect().top}return!1}getKeyBelow(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getNextKey(r,n),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getPreviousKey(e,n):this.getNextKey(e,n):this.getNextKey(e,n)}getKeyAbove(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getPreviousKey(r,n),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getNextKey(e,n):this.getPreviousKey(e,n):this.getPreviousKey(e,n)}getNextColumn(e,n,r){return n?this.getPreviousKey(e,r):this.getNextKey(e,r)}getKeyRightOf(e,n){let r=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n?.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="rtl",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",n):null}getKeyLeftOf(e,n){let r=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n?.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="ltr",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",n):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;let o=this.isReversed(e);if(n&&!$o(n))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let s=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let s=this.layoutDelegate.getVisibleRect(),l=o?r.y-s.height:Math.max(0,r.y+r.height-s.height);for(;r&&r.y>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??(o?this.getLastKey():this.getFirstKey())}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;let o=this.isReversed(e);if(n&&!$o(n))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,r.x-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.x<s&&i!=null;)i=this.getKeyBelow(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let s=Math.min(this.layoutDelegate.getContentSize().height,r.y-r.height+this.layoutDelegate.getVisibleRect().height);for(;r&&r.y<s&&i!=null;)i=this.getKeyBelow(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??(o?this.getFirstKey():this.getLastKey())}getKeyForSearch(e,n){if(!this.collator)return null;let r=this.collection,o=n||this.getFirstKey();for(;o!=null;){let i=r.getItem(o);if(!i)return null;let s=i.textValue.slice(0,e.length);if(i.textValue&&this.collator.compare(s,e)===0)return o;o=this.getNextKey(o)}return null}}let od=new Map;function id(t){let{locale:e}=Un(),n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(od.has(n))return od.get(n);let r=new Intl.Collator(e,t);return od.set(n,r),r}function NT(t){let{selectionManager:e,collection:n,disabledKeys:r,ref:o,keyboardDelegate:i,layoutDelegate:s,orientation:l}=t,a=id({usage:"search",sensitivity:"base"}),u=e.disabledBehavior,c=m.useMemo(()=>i||new rd({collection:n,disabledKeys:r,disabledBehavior:u,ref:o,collator:a,layoutDelegate:s,orientation:l}),[i,s,n,r,o,a,u,l]),{collectionProps:d}=KT({...t,ref:o,selectionManager:e,keyboardDelegate:c});return{listProps:d}}function RT(t,e,n){let r=Re(t,{labelable:!0}),o=t.selectionBehavior||"toggle",i=t.orientation||"vertical",s=t.linkBehavior||(o==="replace"?"action":"override");o==="toggle"&&s==="action"&&(s="override");let{listProps:l}=NT({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:s}),{focusWithinProps:a}=Ii({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),u=mt(t.id);Xc.set(e,{id:u,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:s,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:c,fieldProps:d}=pb({...t,id:u,labelElementType:"span"});return{labelProps:c,listBoxProps:ae(r,a,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":i,...ae(d,l)})}}const BT=500;function sd(t){let{isDisabled:e,pointerType:n,onLongPressStart:r,onLongPressEnd:o,onLongPress:i,threshold:s=BT,accessibilityDescription:l}=t;const a=m.useRef(void 0);let{addGlobalListener:u,removeAllGlobalListeners:c}=Fl(),d=g=>n?g.pointerType===n:g.pointerType==="mouse"||g.pointerType==="touch",{pressProps:f}=Kl({isDisabled:e,onPressStart(g){if(g.continuePropagation(),d(g)){r&&r({...g,type:"longpressstart"}),a.current=setTimeout(()=>{g.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),u(g.target,"click",p=>p.preventDefault(),{once:!0}),ue(g.target).activeElement!==g.target&&Ut(g.target),i&&i({...g,type:"longpress"}),a.current=void 0},s),g.pointerType==="touch"&&u(g.target,"contextmenu",p=>p.preventDefault(),{once:!0});let b=We(g.target);u(b,"pointerup",()=>{setTimeout(()=>{c()},100)},{once:!0})}},onPressEnd(g){a.current&&clearTimeout(a.current),o&&d(g)&&o({...g,type:"longpressend"})}}),h=Jk(i&&!e?l:void 0);return{longPressProps:ae(f,h)}}function Sv(t){let{id:e,selectionManager:n,key:r,ref:o,shouldSelectOnPressUp:i,shouldUseVirtualFocus:s,focus:l,isDisabled:a,onAction:u,allowsDifferentPressOrigin:c,linkBehavior:d="action"}=t,f=xl();e=mt(e);let h=N=>{if(N.pointerType==="keyboard"&&nd(N))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(d==="selection"&&o.current){let q=n.getItemProps(r);f.open(o.current,N,q.href,q.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(d==="override"||d==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):N&&N.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||N&&(Di(N)||N.pointerType==="touch"||N.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};m.useEffect(()=>{r===n.focusedKey&&n.isFocused&&(s?yy(o.current):l?l():Ee()!==o.current&&o.current&&jn(o.current))},[o,r,n.focusedKey,n.childFocusStrategy,n.isFocused,s]),a=a||n.isDisabled(r);let g={};!s&&!a?g={tabIndex:r===n.focusedKey?0:-1,onFocus(N){G(N)===o.current&&n.setFocusedKey(r)}}:a&&(g.onMouseDown=N=>{N.preventDefault()}),m.useEffect(()=>{a&&n.focusedKey===r&&n.setFocusedKey(null)},[n,a,r]);let b=n.isLink(r)&&d==="override",p=u&&t.UNSTABLE_itemBehavior==="action",y=n.isLink(r)&&d!=="selection"&&d!=="none",v=!a&&n.canSelectItem(r)&&!b&&!p,x=(u||y)&&!a,_=x&&(n.selectionBehavior==="replace"?!v:!v||n.isEmpty),C=x&&v&&n.selectionBehavior==="replace",T=_||C,k=m.useRef(null),S=T&&v,w=m.useRef(!1),D=m.useRef(!1),M=n.getItemProps(r),B=N=>{u&&(u(),o.current?.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),y&&o.current&&f.open(o.current,N,M.href,M.routerOptions)},V={ref:o};i?(V.onPressStart=N=>{k.current=N.pointerType,w.current=S,N.pointerType==="keyboard"&&(!T||Ev(N.key))&&h(N)},c?(V.onPressUp=_?void 0:N=>{N.pointerType==="mouse"&&v&&h(N)},V.onPress=_?B:N=>{N.pointerType!=="keyboard"&&N.pointerType!=="mouse"&&v&&h(N)}):V.onPress=N=>{if(_||C&&N.pointerType!=="mouse"){if(N.pointerType==="keyboard"&&!Cv(N.key))return;B(N)}else N.pointerType!=="keyboard"&&v&&h(N)}):(V.onPressStart=N=>{k.current=N.pointerType,w.current=S,D.current=_,v&&(N.pointerType==="mouse"&&!_||N.pointerType==="keyboard"&&(!x||Ev(N.key)))&&h(N)},V.onPress=N=>{(N.pointerType==="touch"||N.pointerType==="pen"||N.pointerType==="virtual"||N.pointerType==="keyboard"&&T&&Cv(N.key)||N.pointerType==="mouse"&&D.current)&&(T?B(N):v&&h(N))});let E=FT(n.collection);if(g["data-collection"]=E,g["data-key"]=r,V.preventFocusOnPress=s,s&&(V=ae(V,{onPressStart(N){N.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(N){N.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),M)for(let N of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])M[N]&&(V[N]=Jt(V[N],M[N]));let{pressProps:F,isPressed:U}=Kl(V),I=C?N=>{k.current==="mouse"&&(N.stopPropagation(),N.preventDefault(),B(N))}:void 0,{longPressProps:Q}=sd({isDisabled:!S,onLongPress(N){N.pointerType==="touch"&&(h(N),n.setSelectionBehavior("toggle"))}}),$=N=>{k.current==="touch"&&w.current&&N.preventDefault()},K=d!=="none"&&n.isLink(r)?N=>{Pn.isOpening||N.preventDefault()}:void 0,H=ae(g,v||_||s&&!a?F:{},S?Q:{},{onDoubleClick:I,onDragStartCapture:$,onClick:K,id:e},s?{onMouseDown:N=>N.preventDefault()}:void 0),me=N=>{let q=N;for(;q&&q!==o.current;){let ne=q.getAttribute("data-collection");if(ne!=null)return ne!==E;q=q.parentElement}return mc(N)},ve=H.onPointerDown;H.onPointerDown=N=>{let q=G(N);if(q&&q!==o.current&&me(q)){N.stopPropagation();return}ve?.(N)};let he=H.onMouseDown;return H.onMouseDown=N=>{let q=G(N);if(q&&q!==o.current&&me(q)){N.stopPropagation();return}he?.(N)},{itemProps:H,isPressed:U,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:a,allowsSelection:v,hasAction:T}}function Cv(t){return t==="Enter"}function Ev(t){return t===" "}function wv(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function zT(t){return VT(t)}function VT(t,e){for(let n of t)return n}function ld(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...kv(t,e),e],o=[...kv(t,n),n],i=r.slice(0,o.length).findIndex((s,l)=>s!==o[l]);return i!==-1?(e=r[i],n=o[i],e.index-n.index):r.findIndex(s=>s===n)>=0?1:(o.findIndex(s=>s===e)>=0,-1)}function kv(t,e){let n=[],r=e;for(;r?.parentKey!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}const Tv=new WeakMap;function Pv(t){let e=Tv.get(t);if(e!=null)return e;let n=0,r=o=>{for(let i of o)i.type==="section"?r(wv(i,t)):i.type==="item"&&n++};return r(t),Tv.set(t,n),n}function UT(t,e,n){let{key:r}=t,o=Xc.get(e),i=t.isDisabled??e.selectionManager.isDisabled(r),s=t.isSelected??e.selectionManager.isSelected(r),l=t.shouldSelectOnPressUp??o?.shouldSelectOnPressUp,a=t.shouldFocusOnHover??o?.shouldFocusOnHover,u=t.shouldUseVirtualFocus??o?.shouldUseVirtualFocus,c=t.isVirtualized??o?.isVirtualized,d=Tn(),f=Tn(),h={role:"option","aria-disabled":i||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?s:void 0,"aria-label":t["aria-label"],"aria-labelledby":d,"aria-describedby":f},g=e.collection.getItem(r);if(c){let w=Number(g?.index);h["aria-posinset"]=Number.isNaN(w)?void 0:w+1,h["aria-setsize"]=Pv(e.collection)}let b=o?.onAction?()=>o?.onAction?.(r):void 0,p=CT(e,r),{itemProps:y,isPressed:v,isFocused:x,hasAction:_,allowsSelection:C}=Sv({selectionManager:e.selectionManager,key:r,ref:n,shouldSelectOnPressUp:l,allowsDifferentPressOrigin:l&&a,isVirtualized:c,shouldUseVirtualFocus:u,isDisabled:i,onAction:b||g?.props?.onAction?Jt(g?.props?.onAction,b):void 0,linkBehavior:o?.linkBehavior,UNSTABLE_itemBehavior:o?.UNSTABLE_itemBehavior,id:p}),{hoverProps:T}=$r({isDisabled:i||!a,onHoverStart(){Tr()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(r))}}),k=Re(g?.props);delete k.id;let S=ky(g?.props);return{optionProps:{...h,...ae(k,y,T,S),id:p},labelProps:{id:d},descriptionProps:{id:f},isFocused:x,isFocusVisible:x&&e.selectionManager.isFocused&&Tr(),isSelected:s,isDisabled:i,isPressed:v,allowsSelection:C,hasAction:_}}function HT(t){let{heading:e,"aria-label":n}=t,r=mt();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation",onMouseDown:o=>{o.preventDefault()}}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}function jT(t){const e=m.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}class $v{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=s=>{if(this.keyMap.set(s.key,s),s.childNodes&&s.type==="section")for(let l of s.childNodes)n(l)};for(let s of e)n(s);let r=null,o=0,i=0;for(let[s,l]of this.keyMap)r?(r.nextKey=s,l.prevKey=r.key):(this.firstKey=s,l.prevKey=void 0),l.type==="item"&&(l.index=o++),(l.type==="section"||l.type==="item")&&i++,r=l,r.nextKey=void 0;this._size=i,this.lastKey=r?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}}class Ht extends Set{constructor(e,n,r){super(e),e instanceof Ht?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function GT(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function qT(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:o="toggle",disabledBehavior:i="all"}=t,s=m.useRef(!1),[,l]=m.useState(!1),a=m.useRef(null),u=m.useRef(null),[,c]=m.useState(null),d=m.useMemo(()=>Dv(t.selectedKeys),[t.selectedKeys]),f=m.useMemo(()=>Dv(t.defaultSelectedKeys,new Ht),[t.defaultSelectedKeys]),[h,g]=kl(d,f,t.onSelectionChange),b=m.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[p,y]=m.useState(o);o==="replace"&&p==="toggle"&&typeof h=="object"&&h.size===0&&y("replace");let v=m.useRef(o);return m.useEffect(()=>{o!==v.current&&(y(o),v.current=o)},[o]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:p,setSelectionBehavior:y,get isFocused(){return s.current},setFocused(x){s.current=x,l(x)},get focusedKey(){return a.current},get childFocusStrategy(){return u.current},setFocusedKey(x,_="first"){a.current=x,u.current=_,c(x)},selectedKeys:h,setSelectedKeys(x){(r||!GT(x,h))&&g(x)},disabledKeys:b,disabledBehavior:i}}function Dv(t,e){return t?t==="all"?"all":new Ht(t):e}class ad{constructor(e,n,r){this.collection=e,this.state=n,this.allowsCellSelection=r?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null,this.fullCollection=r?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&ld(this.collection,r,e)<0)&&(e=r)}return e?.key??null}get lastSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&ld(this.collection,r,e)>0)&&(e=r)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Ht([n],n,n);else{let o=this.state.selectedKeys,i=o.anchorKey??n;r=new Ht(o,i,n);for(let s of this.getKeyRange(i,o.currentKey??n))r.delete(s);for(let s of this.getKeyRange(n,i))this.canSelectItem(s)&&r.add(s)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),o=this.collection.getItem(n);return r&&o?ld(this.collection,r,o)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let r=[],o=e;for(;o!=null;){let i=this.collection.getItem(o);if(i&&(i.type==="item"||i.type==="cell"&&this.allowsCellSelection)&&r.push(o),o===n)return r;o=this.collection.getKeyAfter(o)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new Ht(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new Ht([n],n,n):new Ht;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Ht;for(let r of e){let o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=this.fullCollection??this.collection,n=[],r=o=>{for(;o!=null;){if(this.canSelectItemIn(o,e)){let i=e.getItem(o);i?.type==="item"&&n.push(o),i?.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&r(zT(wv(i,e))?.key??null)}o=e.getKeyAfter(o)}};return r(e.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Ht)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,n){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=n.getItem(e);return!(!r||r?.props?.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){let n=this.collection.getItem(e);return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!n?.props?.isDisabled)&&n?.props?.disabledBehavior!=="selection"}isLink(e){return!!this.collection.getItem(e)?.props?.href}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(e){return new ad(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class YT{build(e,n){return this.context=n,Mv(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(m.isValidElement(n)&&n.type===m.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let o=0;for(let i of r)yield*this.getFullNode({value:i,index:o},{renderer:n}),o++}else{let o=[];m.Children.forEach(n,s=>{s&&o.push(s)});let i=0;for(let s of o){let l=this.getFullNode({element:s,index:i},{});for(let a of l)i++,yield a}}}getKey(e,n,r,o){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${o}${n.key}`;let i=n.value;if(i!=null){let s=i.key??i.id;if(s==null)throw new Error("No key found for item");return s}return o?`${o}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,o){if(m.isValidElement(e.element)&&e.element.type===m.Fragment){let a=[];m.Children.forEach(e.element.props.children,c=>{a.push(c)});let u=e.index??0;for(const c of a)yield*this.getFullNode({element:c,index:u++},n,r,o);return}let i=e.element;if(!i&&e.value&&n&&n.renderer){let a=this.cache.get(e.value);if(a&&(!a.shouldInvalidate||!a.shouldInvalidate(this.context))){a.index=e.index,a.parentKey=o?o.key:null,yield a;return}i=n.renderer(e.value)}if(m.isValidElement(i)){let a=i.type;if(typeof a!="function"&&typeof a.getCollectionNode!="function"){let f=i.type;throw new Error(`Unknown element <${f}> in collection.`)}let u=a.getCollectionNode(i.props,this.context),c=e.index??0,d=u.next();for(;!d.done&&d.value;){let f=d.value;e.index=c;let h=f.key??null;h==null&&(h=f.element?null:this.getKey(i,e,n,r));let b=[...this.getFullNode({...f,key:h,index:c,wrapper:ZT(e.wrapper,f.wrapper)},this.getChildState(n,f),r?`${r}${i.key}`:i.key,o)];for(let p of b){if(p.value=f.value??e.value??null,p.value&&this.cache.set(p.value,p),e.type&&p.type!==e.type)throw new Error(`Unsupported type <${ud(p.type)}> in <${ud(o?.type??"unknown parent type")}>. Only <${ud(e.type)}> is supported.`);c++,yield p}d=u.next(b)}return}if(e.key==null||e.type==null)return;let s=this,l={type:e.type,props:e.props,key:e.key,parentKey:o?o.key:null,value:e.value??null,level:(o?.level??0)+(o?.type==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Mv(function*(){if(!e.hasChildNodes||!e.childNodes)return;let a=0;for(let u of e.childNodes()){u.key!=null&&(u.key=`${l.key}${u.key}`);let c=s.getFullNode({...u,index:a},s.getChildState(n,u),l.key,l);for(let d of c)a++,yield d}})};yield l}constructor(){this.cache=new WeakMap}}function Mv(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}function ZT(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function ud(t){return t[0].toUpperCase()+t.slice(1)}function XT(t,e,n){let r=m.useMemo(()=>new YT,[]),{children:o,items:i,collection:s}=t;return m.useMemo(()=>{if(s)return s;let a=r.build({children:o,items:i},n);return e(a)},[r,o,i,s,n,e])}function Av(t){let{filter:e,layoutDelegate:n}=t,r=qT(t),o=m.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),i=m.useCallback(u=>e?new $v(e(u)):new $v(u),[e]),s=m.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),l=XT(t,i,s),a=m.useMemo(()=>new ad(l,r,{layoutDelegate:n}),[l,r,n]);return Lv(l,a),{collection:l,disabledKeys:o,selectionManager:a}}function QT(t,e){let n=m.useMemo(()=>e?t.collection.filter(e):t.collection,[t.collection,e]),r=t.selectionManager.withCollection(n);return Lv(n,r),{collection:n,selectionManager:r,disabledKeys:t.disabledKeys}}function Lv(t,e){const n=m.useRef(null);m.useEffect(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){let r=n.current.getKeyAfter(e.focusedKey),o=null;for(;r!=null;){let i=t.getItem(r);if(i&&i.type==="item"&&!e.isDisabled(r)){o=r;break}r=n.current.getKeyAfter(r)}if(o==null)for(r=n.current.getKeyBefore(e.focusedKey);r!=null;){let i=t.getItem(r);if(i&&i.type==="item"&&!e.isDisabled(r)){o=r;break}r=n.current.getKeyBefore(r)}e.setFocusedKey(o)}n.current=t},[t,e])}function WT(t,e){let{collection:n,onLoadMore:r,scrollOffset:o=1,direction:i="end"}=t,s=m.useRef(null),l=It(a=>{for(let u of a)u.isIntersecting&&r&&r()});pe(()=>{if(e.current){const a=100*o,u=i==="start"?`${a}% 0px 0px 0px`:`0px ${a}% ${a}% ${a}%`;s.current=new IntersectionObserver(l,{root:Vc(e?.current),rootMargin:u}),s.current.observe(e.current)}return()=>{s.current&&s.current.disconnect()}},[n,e,o,i])}const cd=m.createContext(null),Do=m.createContext(null),JT=m.forwardRef(function(e,n){[e,n]=Mt(e,n,cd);let r=m.useContext(Do);return r?m.createElement(Iv,{state:r,props:e,listBoxRef:n}):m.createElement(Jy,{content:m.createElement(Dk,e)},o=>m.createElement(e2,{props:e,listBoxRef:n,collection:o}))});function e2({props:t,listBoxRef:e,collection:n}){t={...t,collection:n,children:null,items:null};let{layoutDelegate:r}=m.useContext(Ll),o=Av({...t,layoutDelegate:r});return m.createElement(Iv,{state:o,props:t,listBoxRef:e})}function Iv({state:t,props:e,listBoxRef:n}){[e,n]=Mt(e,n,tk);let{dragAndDropHooks:r,layout:o="stack",orientation:i="vertical",filter:s}=e,l=QT(t,s),{collection:a,selectionManager:u}=l,c=!!r?.useDraggableCollectionState,d=!!r?.useDroppableCollectionState,{direction:f}=Un(),{disabledBehavior:h,disabledKeys:g}=u,b=id({usage:"search",sensitivity:"base"}),{isVirtualized:p,layoutDelegate:y,dropTargetDelegate:v,CollectionRoot:x}=m.useContext(Ll),_=m.useMemo(()=>e.keyboardDelegate||new rd({collection:a,collator:b,ref:n,disabledKeys:g,disabledBehavior:h,layout:o,orientation:i,direction:f,layoutDelegate:y}),[a,b,n,h,g,i,f,e.keyboardDelegate,o,y]),{listBoxProps:C}=RT({...e,shouldSelectOnPressUp:c||e.shouldSelectOnPressUp,keyboardDelegate:_,isVirtualized:p},l,n),T=m.useRef(c),k=m.useRef(d);m.useEffect(()=>{process.env.NODE_ENV!=="production"&&(T.current!==c&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),k.current!==d&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."))},[c,d]);let S,w,D,M=!1,B=null,V=m.useRef(null);if(c&&r){S=r.useDraggableCollectionState({collection:a,selectionManager:u,preview:r.renderDragPreview?V:void 0}),r.useDraggableCollection({},S,n);let me=r.DragPreview;B=r.renderDragPreview?m.createElement(me,{ref:V},r.renderDragPreview):null}if(d&&r){w=r.useDroppableCollectionState({collection:a,selectionManager:u});let me=r.dropTargetDelegate||v||new r.ListDropTargetDelegate(a,n,{orientation:i,layout:o,direction:f});D=r.useDroppableCollection({keyboardDelegate:_,dropTargetDelegate:me},w,n),M=w.isDropTarget({type:"root"})}let{focusProps:E,isFocused:F,isFocusVisible:U}=Fi(),I=l.collection.size===0,Q={isDropTarget:M,isEmpty:I,isFocused:F,isFocusVisible:U,layout:e.layout||"stack",orientation:i,state:l},$=yt({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:Q}),K=null;I&&e.renderEmptyState&&(K=m.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(Q)));let H=Re(e,{global:!0});return m.createElement(fv,null,m.createElement(ot.div,{...ae(H,$,C,E,D?.collectionProps),ref:n,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":M||void 0,"data-empty":I||void 0,"data-focused":F||void 0,"data-focus-visible":U||void 0,"data-layout":e.layout||"stack","data-orientation":i},m.createElement(So,{values:[[cd,e],[Do,l],[Vl,{dragAndDropHooks:r,dragState:S,dropState:w}],[uv,{elementType:"div"}],[lv,{render:r2}],[Ak,{name:"ListBoxSection",render:t2}]]},m.createElement(xT,null,m.createElement(x,{collection:a,scrollRef:n,persistedKeys:yT(u,r,w),renderDropIndicator:av(r,w)}))),K,B))}function t2(t,e,n,r="react-aria-ListBoxSection"){let o=m.useContext(Do),{dragAndDropHooks:i,dropState:s}=m.useContext(Vl),{CollectionBranch:l}=m.useContext(Ll),[a,u]=gy(),{headingProps:c,groupProps:d}=HT({heading:u,"aria-label":t["aria-label"]??void 0}),f=yt({...t,id:void 0,children:void 0,defaultClassName:r,values:void 0}),h=Re(t,{global:!0});return delete h.id,m.createElement(ot.section,{...ae(h,f,d),ref:e},m.createElement(bT.Provider,{value:{...c,ref:a}},m.createElement(l,{collection:o.collection,parent:n,renderDropIndicator:av(i,s)})))}const n2=Al(Tl,function(e,n,r){let o=wi(n),i=m.useContext(Do),{dragAndDropHooks:s,dragState:l,dropState:a}=m.useContext(Vl),u=l&&!(l.isDisabled||l.selectionManager.isDisabled(r.key)),{optionProps:c,labelProps:d,descriptionProps:f,...h}=UT({key:r.key,"aria-label":e?.["aria-label"]},i,o),{hoverProps:g,isHovered:b}=$r({isDisabled:!h.allowsSelection&&!h.hasAction&&!u,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{keyboardProps:p}=Gn(e),{focusProps:y}=$c(e),v=null;l&&s&&(v=s.useDraggableItem({key:r.key,hasAction:h.hasAction},l));let x=null;a&&s&&(x=s.useDroppableItem({target:{type:"item",key:r.key,dropPosition:"on"}},a,o));let _=l&&l.isDragging(r.key),C=yt({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...h,isHovered:b,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!l,isDragging:_,isDropTarget:x?.isDropTarget}});m.useEffect(()=>{!r.textValue&&process.env.NODE_ENV!=="production"&&console.warn("A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.")},[r.textValue]);let T=e.href?ot.a:ot.div,k=Re(e,{global:!0});return delete k.id,delete k.onClick,e.href&&c.tabIndex==null&&(c.tabIndex=-1),m.createElement(T,{...ae(k,C,c,g,p,y,v?.dragProps,x?.dropProps),ref:o,"data-allows-dragging":!!l||void 0,"data-selected":h.isSelected||void 0,"data-disabled":h.isDisabled||void 0,"data-hovered":b||void 0,"data-focused":h.isFocused||void 0,"data-focus-visible":h.isFocusVisible||void 0,"data-pressed":h.isPressed||void 0,"data-dragging":_||void 0,"data-drop-target":x?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode==="none"?void 0:i.selectionManager.selectionMode},m.createElement(So,{values:[[Po,{slots:{[_o]:d,label:d,description:f}}],[qc,{isSelected:h.isSelected}]]},C.children))});function r2(t,e){e=wi(e);let{dragAndDropHooks:n,dropState:r}=m.useContext(Vl),{dropIndicatorProps:o,isHidden:i,isDropTarget:s}=n.useDropIndicator(t,r,e);return i?null:m.createElement(i2,{...t,dropIndicatorProps:o,isDropTarget:s,ref:e})}function o2(t,e){let{dropIndicatorProps:n,isDropTarget:r,...o}=t,i=yt({...o,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:r}});return m.createElement(m.Fragment,null,m.createElement(ot.div,{...n,...i,role:"option",ref:e,"data-drop-target":r||void 0}))}const i2=m.forwardRef(o2);Al(Tc,function(e,n,r){let o=m.useContext(Do),{isLoading:i,onLoadMore:s,scrollOffset:l,...a}=e,u=m.useRef(null),c=m.useMemo(()=>({onLoadMore:s,collection:o?.collection,sentinelRef:u,scrollOffset:l}),[s,l,o?.collection]);WT(c,u);let d=yt({...a,id:void 0,children:r.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),f={tabIndex:-1};return m.createElement(m.Fragment,null,m.createElement("div",{style:{position:"relative",width:0,height:0},inert:jT(!0)},m.createElement("div",{"data-testid":"loadMoreSentinel",ref:u,style:{position:"absolute",height:1,width:1}})),i&&d.children&&m.createElement(m.Fragment,null,m.createElement(ot.div,{...ae(Re(e,{global:!0}),f),...d,role:"option",ref:n},d.children)))});const s2=m.createContext({placement:"bottom"}),l2=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function Fv(t){return t.dataset.liveAnnouncer==="true"||t.dataset.reactAriaTopLayer!==void 0}let Ni=new WeakMap,bt=[];function a2(t,e){let n=We(t?.[0]),r=e instanceof n.Element?{root:e}:e,o=r?.root??document.body,i=r?.shouldUseInert&&l2,s=new Set(t),l=new Set,a=p=>i&&p instanceof n.HTMLElement?p.inert:p.getAttribute("aria-hidden")==="true",u=(p,y)=>{i&&p instanceof n.HTMLElement?p.inert=y:y?p.setAttribute("aria-hidden","true"):(p.removeAttribute("aria-hidden"),p instanceof n.HTMLElement&&(p.inert=!1))},c=new Set;if(en()){let p=o.getRootNode();for(let y of t){let v=y.getRootNode();for(;hc(v)&&v!==p;)c.add(v),v=v.host.getRootNode()}}let d=p=>{for(let _ of p.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))s.add(_);let y=_=>{if(l.has(_)||s.has(_)||_.parentElement&&l.has(_.parentElement)&&_.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let C of s)if(J(_,C))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},v=cv(ue(p),p,NodeFilter.SHOW_ELEMENT,{acceptNode:y}),x=y(p);if(x===NodeFilter.FILTER_ACCEPT&&f(p),x!==NodeFilter.FILTER_REJECT){let _=v.nextNode();for(;_!=null;)f(_),_=v.nextNode()}},f=p=>{let y=Ni.get(p)??0;a(p)&&y===0||(y===0&&u(p,!0),l.add(p),Ni.set(p,y+1))};bt.length&&bt[bt.length-1].disconnect(),d(o);let h=new MutationObserver(p=>{for(let y of p)if(y.type==="childList"){if(y.target.isConnected&&![...s,...l].some(v=>J(v,y.target)))for(let v of y.addedNodes)(v instanceof HTMLElement||v instanceof SVGElement)&&Fv(v)?s.add(v):v instanceof Element&&d(v);if(en()){for(let v of c)if(!v.isConnected){h.disconnect();break}}}});h.observe(o,{childList:!0,subtree:!0});let g=new Set;if(en())for(let p of c){let y=new MutationObserver(v=>{for(let x of v)if(x.type==="childList"){if(x.target.isConnected&&![...s,...l].some(_=>J(_,x.target)))for(let _ of x.addedNodes)(_ instanceof HTMLElement||_ instanceof SVGElement)&&Fv(_)?s.add(_):_ instanceof Element&&d(_);if(en()){for(let _ of c)if(!_.isConnected){h.disconnect();break}}}});y.observe(p,{childList:!0,subtree:!0}),g.add(y)}let b={visibleNodes:s,hiddenNodes:l,observe(){h.observe(o,{childList:!0,subtree:!0})},disconnect(){h.disconnect()}};return bt.push(b),()=>{if(h.disconnect(),en())for(let p of g)p.disconnect();for(let p of l){let y=Ni.get(p);y!=null&&(y===1?(u(p,!1),Ni.delete(p)):Ni.set(p,y-1))}b===bt[bt.length-1]?(bt.pop(),bt.length&&bt[bt.length-1].observe()):bt.splice(bt.indexOf(b),1)}}function u2(t){let e=bt[bt.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}const Ot={top:"top",bottom:"top",left:"left",right:"left"},Hl={top:"bottom",bottom:"top",left:"right",right:"left"},c2={top:"left",left:"top"},dd={top:"height",left:"width"},Ov={width:"totalWidth",height:"totalHeight"},jl={};let d2=()=>typeof document<"u"?window.visualViewport:null;function Kv(t,e){let n=0,r=0,o=0,i=0,s=0,l=0,a={},u=(e?.scale??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let c=document.documentElement;o=c.clientWidth,i=c.clientHeight,n=e?.width??o,r=e?.height??i,a.top=c.scrollTop||t.scrollTop,a.left=c.scrollLeft||t.scrollLeft,e&&(s=e.offsetTop,l=e.offsetLeft)}else({width:n,height:r,top:s,left:l}=Ri(t,!1)),a.top=t.scrollTop,a.left=t.scrollLeft,o=n,i=r;return Vn()&&(t.tagName==="BODY"||t.tagName==="HTML")&&u&&(a.top=0,a.left=0,s=e?.pageTop??0,l=e?.pageLeft??0),{width:n,height:r,totalWidth:o,totalHeight:i,scroll:a,top:s,left:l}}function f2(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Nv(t,e,n,r,o,i,s){let l=o.scroll[t]??0,a=r[dd[t]],u=s[t]+r.scroll[Ot[t]]+i,c=s[t]+r.scroll[Ot[t]]+a-i,d=e-l+r.scroll[Ot[t]]+s[t]-r[Ot[t]],f=e-l+n+r.scroll[Ot[t]]+s[t]-r[Ot[t]];return d<u?u-d:f>c?Math.max(c-f,u-d):0}function h2(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function Rv(t){if(jl[t])return jl[t];let[e,n]=t.split(" "),r=Ot[e]||"right",o=c2[r];Ot[n]||(n="center");let i=dd[r],s=dd[o];return jl[t]={placement:e,crossPlacement:n,axis:r,crossAxis:o,size:i,crossSize:s},jl[t]}function fd(t,e,n,r,o,i,s,l,a,u,c){let{placement:d,crossPlacement:f,axis:h,crossAxis:g,size:b,crossSize:p}=r,y={};y[g]=t[g]??0,f==="center"?y[g]+=((t[p]??0)-(n[p]??0))/2:f!==g&&(y[g]+=(t[p]??0)-(n[p]??0)),y[g]+=i;const v=t[g]-n[p]+a+u,x=t[g]+t[p]-a-u;if(y[g]=zc(y[g],v,x),d===h){let _=l?c[b]:c[Ov[b]];y[Hl[h]]=Math.floor(_-t[h]+o)}else y[h]=Math.floor(t[h]+t[b]+o);return y}function g2(t,e,n,r,o,i,s,l,a,u,c){let d=(t.top!=null?t.top:a[Ov.height]-(t.bottom??0)-s)-(a.scroll.top??0),f=u?n.top:0,h={top:Math.max(e.top+f,(c?.offsetTop??e.top)+f),bottom:Math.min(e.top+e.height+f,(c?.offsetTop??0)+(c?.height??0))};return l!=="top"?Math.max(0,h.bottom-d-((o.top??0)+(o.bottom??0)+i)):Math.max(0,d+s-h.top-((o.top??0)+(o.bottom??0)+i))}function Bv(t,e,n,r,o,i,s,l){let{placement:a,axis:u,size:c}=i;return a===u?Math.max(0,n[u]-(s.scroll[u]??0)-(t[u]+(l?e[u]:0))-(r[u]??0)-r[Hl[u]]-o):Math.max(0,t[c]+t[u]+(l?e[u]:0)-n[u]-n[c]+(s.scroll[u]??0)-(r[u]??0)-r[Hl[u]]-o)}function p2(t,e,n,r,o,i,s,l,a,u,c,d,f,h,g,b,p,y){let v=Rv(t),{size:x,crossAxis:_,crossSize:C,placement:T,crossPlacement:k}=v,S=fd(e,l,n,v,c,d,u,f,g,b,a),w=c,D=Bv(l,u,e,o,i+c,v,a,p);if(s&&n[x]>D){let N=Rv(`${Hl[T]} ${k}`),q=fd(e,l,n,N,c,d,u,f,g,b,a);Bv(l,u,e,o,i+c,N,a,p)>D&&(v=N,S=q,w=c)}let M="bottom";v.axis==="top"?v.placement==="top"?M="top":v.placement==="bottom"&&(M="bottom"):v.crossAxis==="top"&&(v.crossPlacement==="top"?M="bottom":v.crossPlacement==="bottom"&&(M="top"));let B=Nv(_,S[_],n[C],l,a,i,u);S[_]+=B;let V=g2(S,l,u,f,o,i,n.height,M,a,p,y);h&&h<V&&(V=h),n.height=Math.min(n.height,V),S=fd(e,l,n,v,w,d,u,f,g,b,a),B=Nv(_,S[_],n[C],l,a,i,u),S[_]+=B;let E={},F=e[_]-S[_]-o[Ot[_]],U=F+.5*e[C];const I=g/2+b,Q=Ot[_]==="left"?(o.left??0)+(o.right??0):(o.top??0)+(o.bottom??0),$=n[C]-Q-g/2-b,K=e[_]+g/2-(S[_]+o[Ot[_]]),H=e[_]+e[C]-g/2-(S[_]+o[Ot[_]]),me=zc(U,K,H);E[_]=zc(me,I,$),{placement:T,crossPlacement:k}=v,g?F=E[_]:k==="right"?F+=e[C]:k==="center"&&(F+=e[C]/2);let ve=T==="left"||T==="top"?n[x]:0,he={x:T==="top"||T==="bottom"?F:ve,y:T==="left"||T==="right"?F:ve};return{position:S,maxHeight:V,arrowOffsetLeft:E.left,arrowOffsetTop:E.top,placement:T,triggerAnchorPoint:he}}function m2(t){let{placement:e,targetNode:n,overlayNode:r,scrollNode:o,padding:i,shouldFlip:s,boundaryElement:l,offset:a,crossOffset:u,maxHeight:c,arrowSize:d=0,arrowBoundaryOffset:f=0,targetRect:h}=t,g=d2(),b=r instanceof HTMLElement?y2(r):document.documentElement,p=b===document.documentElement;const y=window.getComputedStyle(b).position;let v=!!y&&y!=="static",x=p?Ri(n,!1,h):zv(n,b,!1,h);if(!p){let{marginTop:M,marginLeft:B}=window.getComputedStyle(n);x.top+=parseInt(M,10)||0,x.left+=parseInt(B,10)||0}let _=Ri(r,!0),C=h2(r);_.width+=(C.left??0)+(C.right??0),_.height+=(C.top??0)+(C.bottom??0);let T=f2(o),k=Kv(l,g),S=Kv(b,g),w;if((l.tagName==="BODY"||l.tagName==="HTML")&&!p){let M=Gl(b,!1);w={top:-(M.top-k.top),left:-(M.left-k.left),width:0,height:0}}else(l.tagName==="BODY"||l.tagName==="HTML")&&p?w={top:0,left:0,width:0,height:0}:w=zv(l,b,!1);let D=J(l,b);return p2(e,x,_,T,C,i,s,k,S,w,a,u,v,c,d,f,D,g)}function Gl(t,e){let{top:n,left:r,width:o,height:i}=t.getBoundingClientRect();return e&&t instanceof t.ownerDocument.defaultView.HTMLElement&&(o=t.offsetWidth,i=t.offsetHeight),{top:n,left:r,width:o,height:i}}function Ri(t,e,n){let{top:r,left:o,width:i,height:s}=n||Gl(t,e),{scrollTop:l,scrollLeft:a,clientTop:u,clientLeft:c}=document.documentElement;return{top:r+l-u,left:o+a-c,width:i,height:s}}function zv(t,e,n,r){let o=window.getComputedStyle(t),i;if(o.position==="fixed")i=r||Gl(t,n);else{i=Ri(t,n,r);let s=Ri(e,n),l=window.getComputedStyle(e);s.top+=(parseInt(l.borderTopWidth,10)||0)-e.scrollTop,s.left+=(parseInt(l.borderLeftWidth,10)||0)-e.scrollLeft,i.top-=s.top,i.left-=s.left}return i.top-=parseInt(o.marginTop,10)||0,i.left-=parseInt(o.marginLeft,10)||0,i}function y2(t){let e=t.offsetParent;if(e&&e===document.body&&window.getComputedStyle(e).position==="static"&&!Vv(e)&&(e=document.documentElement),e==null)for(e=t.parentElement;e&&!Vv(e);)e=e.parentElement;return e||document.documentElement}function Vv(t){let e=window.getComputedStyle(t);return e.transform!=="none"||/transform|perspective/.test(e.willChange)||e.filter!=="none"||e.contain==="paint"||"backdropFilter"in e&&e.backdropFilter!=="none"||"WebkitBackdropFilter"in e&&e.WebkitBackdropFilter!=="none"}const Uv=new WeakMap;function b2(t){let{triggerRef:e,isOpen:n,onClose:r}=t;m.useEffect(()=>{if(!n||r===null)return;let o=i=>{let s=G(i);if(!e.current||s instanceof Node&&!J(s,e.current)||s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement)return;let l=r||Uv.get(e.current);l&&l()};return fw(gw(e.current),"scroll",o,!0)},[n,r,e])}function v2(){return typeof window.ResizeObserver<"u"}function hd(t){const{ref:e,box:n,onResize:r}=t;let o=It(r);m.useEffect(()=>{let i=e?.current;if(i)if(v2()){const s=new window.ResizeObserver(l=>{l.length&&o()});return s.observe(i,{box:n}),()=>{i&&s.unobserve(i)}}else return window.addEventListener("resize",o,!1),()=>{window.removeEventListener("resize",o,!1)}},[e,n])}let Ar=typeof document<"u"?window.visualViewport:null;function x2(t){let{direction:e}=Un(),{arrowSize:n,targetRef:r,overlayRef:o,arrowRef:i,scrollRef:s=o,placement:l="bottom",containerPadding:a=12,shouldFlip:u=!0,boundaryElement:c=typeof document<"u"?document.body:null,offset:d=0,crossOffset:f=0,shouldUpdatePosition:h=!0,isOpen:g=!0,onClose:b,maxHeight:p,arrowBoundaryOffset:y=0,getTargetRect:v}=t,[x,_]=m.useState(null),C=[h,l,o.current,r.current,i?.current,s.current,a,u,c,d,f,g,e,p,y,n],T=m.useRef(Ar?.scale);m.useEffect(()=>{g&&(T.current=Ar?.scale)},[g]);let k=m.useCallback(()=>{if(h===!1||!g||!o.current||!r.current||!c||Ar?.scale!==T.current)return;let D=null;if(s.current&&ki(s.current)){let E=Ee()?.getBoundingClientRect(),F=s.current.getBoundingClientRect();D={type:"top",offset:(E?.top??0)-F.top},D.offset>F.height/2&&(D.type="bottom",D.offset=(E?.bottom??0)-F.bottom)}let M=o.current;!p&&o.current&&(M.style.top="0px",M.style.bottom="",M.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+"px");let B=m2({placement:S2(l,e),overlayNode:o.current,targetNode:r.current,scrollNode:s.current||o.current,padding:a,shouldFlip:u,boundaryElement:c,offset:d,crossOffset:f,maxHeight:p,arrowSize:n??(i?.current?Gl(i.current,!0).width:0),arrowBoundaryOffset:y,targetRect:v?.(r.current)});if(!B.position)return;M.style.top="",M.style.bottom="",M.style.left="",M.style.right="",Object.keys(B.position).forEach(E=>M.style[E]=B.position[E]+"px"),M.style.maxHeight=B.maxHeight!=null?B.maxHeight+"px":"";let V=Ee();if(D&&V&&s.current){let E=V.getBoundingClientRect(),F=s.current.getBoundingClientRect(),U=E[D.type]-F[D.type];s.current.scrollTop+=U-D.offset}_(B)},C);pe(k,C),_2(k),hd({ref:o,onResize:k}),hd({ref:r,onResize:k});let S=m.useRef(!1);pe(()=>{let D,M=()=>{S.current=!0,clearTimeout(D),D=setTimeout(()=>{S.current=!1},500),k()},B=()=>{S.current&&M()};return Ar?.addEventListener("resize",M),Ar?.addEventListener("scroll",B),()=>{Ar?.removeEventListener("resize",M),Ar?.removeEventListener("scroll",B)}},[k]);let w=m.useCallback(()=>{S.current||b?.()},[b,S]);return b2({triggerRef:r,isOpen:g,onClose:b&&w}),{overlayProps:{style:{position:x?"absolute":"fixed",top:x?void 0:0,left:x?void 0:0,zIndex:1e5,...x?.position,maxHeight:x?.maxHeight??"100vh"}},placement:x?.placement??null,triggerAnchorPoint:x?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:x?.arrowOffsetLeft,top:x?.arrowOffsetTop}},updatePosition:k}}function _2(t){pe(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function S2(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}function C2(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:o}=t,i=m.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),s=It(a=>{n&&ql(a,e)&&(o&&o(a),i.current.isPointerDown=!0)}),l=It(a=>{n&&n(a)});m.useEffect(()=>{let a=i.current;if(r)return;const u=e.current,c=ue(u);if(typeof PointerEvent<"u"){let d=f=>{a.isPointerDown&&ql(f,e)&&l(f),a.isPointerDown=!1};return c.addEventListener("pointerdown",s,!0),c.addEventListener("click",d,!0),()=>{c.removeEventListener("pointerdown",s,!0),c.removeEventListener("click",d,!0)}}else if(process.env.NODE_ENV==="test"){let d=h=>{a.ignoreEmulatedMouseEvents?a.ignoreEmulatedMouseEvents=!1:a.isPointerDown&&ql(h,e)&&l(h),a.isPointerDown=!1},f=h=>{a.ignoreEmulatedMouseEvents=!0,a.isPointerDown&&ql(h,e)&&l(h),a.isPointerDown=!1};return c.addEventListener("mousedown",s,!0),c.addEventListener("mouseup",d,!0),c.addEventListener("touchstart",s,!0),c.addEventListener("touchend",f,!0),()=>{c.removeEventListener("mousedown",s,!0),c.removeEventListener("mouseup",d,!0),c.removeEventListener("touchstart",s,!0),c.removeEventListener("touchend",f,!0)}}},[e,r])}function ql(t,e){if(t.button>0)return!1;let n=G(t);if(n){const r=n.ownerDocument;if(!r||!J(r.documentElement,n)||n.closest("[data-react-aria-top-layer]"))return!1}return e.current?!t.composedPath().includes(e.current):!1}const nn=[];function E2(t,e){let{onClose:n,shouldCloseOnBlur:r,isOpen:o,isDismissable:i=!1,isKeyboardDismissDisabled:s=!1,shouldCloseOnInteractOutside:l}=t,a=m.useRef(void 0);m.useEffect(()=>{if(o&&!nn.includes(e))return nn.push(e),()=>{let g=nn.indexOf(e);g>=0&&nn.splice(g,1)}},[o,e]);let u=()=>{nn[nn.length-1]===e&&n&&n()},c=g=>{const b=nn[nn.length-1];a.current=b,(!l||l(G(g)))&&b===e&&g.stopPropagation()},d=g=>{(!l||l(G(g)))&&(nn[nn.length-1]===e&&g.stopPropagation(),a.current===e&&u()),a.current=void 0},{keyboardProps:f}=Gn({shortcuts:{Escape:()=>{if(!s){u();return}return!1}}});C2({ref:e,onInteractOutside:i&&o?d:void 0,onInteractOutsideStart:c});let{focusWithinProps:h}=Ii({isDisabled:!r,onBlurWithin:g=>{!g.relatedTarget||$T(g.relatedTarget)||(!l||l(g.relatedTarget))&&n?.()}});return{overlayProps:{...f,...h},underlayProps:{}}}const Bi=typeof document<"u"&&window.visualViewport;let Yl=0,gd;function w2(t={}){let{isDisabled:e}=t;pe(()=>{if(!e)return Yl++,Yl===1&&(Er()&&Vn()?gd=T2():gd=k2()),()=>{Yl--,Yl===0&&gd()}},[e])}function k2(){let t=window.innerWidth-document.documentElement.clientWidth;return Jt(t>0&&("scrollbarGutter"in document.documentElement.style?Zl(document.documentElement,"scrollbarGutter","stable"):Zl(document.documentElement,"paddingRight",`${t}px`)),Zl(document.documentElement,"overflow","hidden"))}function T2(){let t=Zl(document.documentElement,"overflow","hidden"),e,n=!1,r=c=>{let d=G(c);e=$o(d)?d:Vc(d,!0),n=!1;let f=d.ownerDocument.defaultView.getSelection();f&&!f.isCollapsed&&f.containsNode(d,!0)&&(n=!0),c.composedPath().some(h=>h instanceof HTMLInputElement&&h.type==="range")&&(n=!0),"selectionStart"in d&&"selectionEnd"in d&&d.selectionStart<d.selectionEnd&&d.ownerDocument.activeElement===d&&(n=!0)},o=document.createElement("style"),i=ib();i&&(o.nonce=i),o.textContent=`
31
+ @layer {
32
+ * {
33
+ overscroll-behavior: contain;
34
+ }
35
+ }`.trim(),document.head.prepend(o);let s=c=>{if(!(c.touches.length===2||n)){if(!e||e===document.documentElement||e===document.body){c.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&c.preventDefault()}},l=c=>{let d=G(c),f=c.relatedTarget;f&&Ec(f)?(f.focus({preventScroll:!0}),Hv(f,Ec(d))):f||d.parentElement?.closest("[tabindex]")?.focus({preventScroll:!0})},a=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(c){let d=Ee(),f=d!=null&&Ec(d);a.call(this,{...c,preventScroll:!0}),(!c||!c.preventScroll)&&Hv(this,f)};let u=Jt(pd(document,"touchstart",r,{passive:!1,capture:!0}),pd(document,"touchmove",s,{passive:!1,capture:!0}),pd(document,"blur",l,!0));return()=>{t(),u(),o.remove(),HTMLElement.prototype.focus=a}}function Zl(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function pd(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function Hv(t,e){e||!Bi?jv(t):Bi.addEventListener("resize",()=>jv(t),{once:!0})}function jv(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=Vc(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let o=r.getBoundingClientRect(),i=n.getBoundingClientRect();if(i.top<o.top||i.bottom>o.top+n.clientHeight){let s=o.bottom;Bi&&(s=Math.min(s,Bi.offsetTop+Bi.height));let l=i.top-o.top-((s-o.top)/2-i.height/2);r.scrollTo({top:Math.max(0,Math.min(r.scrollHeight-r.clientHeight,r.scrollTop+l)),behavior:"smooth"})}}n=r.parentElement}}function P2(t,e){let{triggerRef:n,popoverRef:r,groupRef:o,isNonModal:i,isKeyboardDismissDisabled:s,shouldCloseOnInteractOutside:l,...a}=t,u=a.trigger==="SubmenuTrigger",{overlayProps:c,underlayProps:d}=E2({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!i||u,isKeyboardDismissDisabled:s,shouldCloseOnInteractOutside:l},o??r),{overlayProps:f,arrowProps:h,placement:g,triggerAnchorPoint:b}=x2({...a,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:i&&!u?e.close:null,getTargetRect:a.getTargetRect??(e.point?()=>new DOMRect(e.point.x,e.point.y,0,0):void 0)});w2({isDisabled:i||!e.isOpen}),m.useEffect(()=>{if(e.isOpen&&r.current)return i?u2(o?.current??r.current):a2([o?.current??r.current],{shouldUseInert:!0})},[i,e.isOpen,r,o]);let{focusWithinProps:p}=Ii(t);return{popoverProps:ae(c,f,p),arrowProps:h,underlayProps:d,placement:g,triggerAnchorPoint:b}}var Gv={};Gv={dismiss:"تجاهل"};var qv={};qv={dismiss:"Отхвърляне"};var Yv={};Yv={dismiss:"Odstranit"};var Zv={};Zv={dismiss:"Luk"};var Xv={};Xv={dismiss:"Schließen"};var Qv={};Qv={dismiss:"Απόρριψη"};var Wv={};Wv={dismiss:"Dismiss"};var Jv={};Jv={dismiss:"Descartar"};var e0={};e0={dismiss:"Lõpeta"};var t0={};t0={dismiss:"Hylkää"};var n0={};n0={dismiss:"Rejeter"};var r0={};r0={dismiss:"התעלם"};var o0={};o0={dismiss:"Odbaci"};var i0={};i0={dismiss:"Elutasítás"};var s0={};s0={dismiss:"Ignora"};var l0={};l0={dismiss:"閉じる"};var a0={};a0={dismiss:"무시"};var u0={};u0={dismiss:"Atmesti"};var c0={};c0={dismiss:"Nerādīt"};var d0={};d0={dismiss:"Lukk"};var f0={};f0={dismiss:"Negeren"};var h0={};h0={dismiss:"Zignoruj"};var g0={};g0={dismiss:"Descartar"};var p0={};p0={dismiss:"Dispensar"};var m0={};m0={dismiss:"Revocare"};var y0={};y0={dismiss:"Пропустить"};var b0={};b0={dismiss:"Zrušiť"};var v0={};v0={dismiss:"Opusti"};var x0={};x0={dismiss:"Odbaci"};var _0={};_0={dismiss:"Avvisa"};var S0={};S0={dismiss:"Kapat"};var C0={};C0={dismiss:"Скасувати"};var E0={};E0={dismiss:"取消"};var w0={};w0={dismiss:"關閉"};var k0={};k0={"ar-AE":Gv,"bg-BG":qv,"cs-CZ":Yv,"da-DK":Zv,"de-DE":Xv,"el-GR":Qv,"en-US":Wv,"es-ES":Jv,"et-EE":e0,"fi-FI":t0,"fr-FR":n0,"he-IL":r0,"hr-HR":o0,"hu-HU":i0,"it-IT":s0,"ja-JP":l0,"ko-KR":a0,"lt-LT":u0,"lv-LV":c0,"nb-NO":d0,"nl-NL":f0,"pl-PL":h0,"pt-BR":g0,"pt-PT":p0,"ro-RO":m0,"ru-RU":y0,"sk-SK":b0,"sl-SI":v0,"sr-SP":x0,"sv-SE":_0,"tr-TR":S0,"uk-UA":C0,"zh-CN":E0,"zh-TW":w0};function $2(t){return t&&t.__esModule?t.default:t}function T0(t){let{onDismiss:e,...n}=t,r=kc($2(k0),"@react-aria/overlays"),o=My(n,r.format("dismiss")),i=()=>{e&&e()};return m.createElement(eT,null,m.createElement("button",{...o,tabIndex:-1,onClick:i,style:{width:1,height:1}}))}const D2=m.forwardRef(({children:t,...e},n)=>{let r=m.useRef(!1),o=m.useContext(Li),i=ae(o||{},{...e,register(){r.current=!0,o&&o.register()}});return i.ref=wi(n||o?.ref),Dc(o,i.ref),m.useEffect(()=>{r.current||(process.env.NODE_ENV!=="production"&&console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component."),r.current=!0)},[]),m.createElement(Li.Provider,{value:i},t)});function M2({children:t}){let e=m.useMemo(()=>({register:()=>{}}),[]);return m.createElement(Li.Provider,{value:e},t)}const A2=m.createContext({});function L2(){return m.useContext(A2)??{}}const P0=m.createContext(null);function $0(t){let e=Ei(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[o,i]=m.useState(!1),s=m.useMemo(()=>({contain:o,setContain:i}),[o,i]),{getContainer:l}=L2();if(!t.portalContainer&&l&&(n=l()),!n)return null;let a=t.children;return t.disableFocusManagement||(a=m.createElement(fv,{restoreFocus:!0,contain:(t.shouldContainFocus||o)&&!r},a)),a=m.createElement(P0.Provider,{value:s},m.createElement(M2,null,m.createElement($l.Provider,{value:null},a))),Fr.createPortal(a,n)}function I2(){let e=m.useContext(P0)?.setContain;pe(()=>{e?.(!0)},[e])}function md(t){let[e,n]=kl(t.isOpen,t.defaultOpen||!1,t.onOpenChange),[r,o]=m.useState(null);const i=m.useCallback(()=>{n(!0)},[n]),s=m.useCallback(()=>{n(!1)},[n]),l=m.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:i,close:s,toggle:l,point:r,setPoint:o}}function F2(t,e=!0){let[n,r]=m.useState(!0),o=n&&e;return pe(()=>{if(o&&t.current&&"getAnimations"in t.current)for(let i of t.current.getAnimations())i instanceof CSSTransition&&i.cancel()},[t,o]),D0(t,o,m.useCallback(()=>r(!1),[])),o}function O2(t,e){let[n,r]=m.useState(e?"open":"closed");switch(n){case"open":e||r("exiting");break;case"closed":case"exiting":e&&r("open");break}let o=n==="exiting";return D0(t,o,m.useCallback(()=>{r(i=>i==="exiting"?"closed":i)},[])),o}function D0(t,e,n){pe(()=>{if(e&&t.current){if(!("getAnimations"in t.current)){n();return}let r=t.current.getAnimations();if(r.length===0){n();return}let o=!1;return Promise.allSettled(r.map(i=>i.finished)).then(()=>{o||Fr.flushSync(()=>{n()})}),()=>{o=!0}}},[t,e,n])}const yd=m.createContext(null),M0=m.createContext(null),A0=m.forwardRef(function(e,n){[e,n]=Mt(e,n,yd);let r=m.useContext(Xl),o=md(e),i=e.isOpen!=null||e.defaultOpen!=null||!r?o:r,s=O2(n,i.isOpen),l=e.isExiting||!e.shouldSkipAnimation&&s||!1,a=bk(),{direction:u}=Un();if(a){let c=e.children;return typeof c=="function"&&(c=c({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),m.createElement(m.Fragment,null,c)}return i&&!i.isOpen&&!l?null:m.createElement(K2,{...e,triggerRef:e.triggerRef,state:i,popoverRef:n,isExiting:l,dir:u})});function K2({state:t,isExiting:e,UNSTABLE_portalContainer:n,clearContexts:r,...o}){let i=m.useRef(null),s=m.useRef(null),l=m.useContext(M0),a=l&&o.trigger==="SubmenuTrigger",{popoverProps:u,underlayProps:c,arrowProps:d,placement:f,triggerAnchorPoint:h}=P2({...o,offset:o.offset??8,arrowRef:i,groupRef:a?l:s},t),g=o.popoverRef,b=F2(g,!!f),p=o.isEntering||!o.shouldSkipAnimation&&b||!1,y=yt({...o,defaultClassName:"react-aria-Popover",values:{trigger:o.trigger||null,placement:f,isEntering:p,isExiting:e}}),v=!o.isNonModal||o.trigger==="SubmenuTrigger"||o.trigger==="PreviewTrigger",[x,_]=m.useState(o.trigger==="PreviewTrigger");pe(()=>{g.current&&_(v&&!g.current.querySelector("[role=dialog]"))},[g,v]),m.useEffect(()=>{x&&o.trigger!=="PreviewTrigger"&&(o.trigger!=="SubmenuTrigger"||Pi()!=="pointer")&&g.current&&!ki(g.current)&&jn(g.current)},[x,g,o.trigger]);let C=m.useMemo(()=>{let M=y.children;if(r)for(let B of r)M=m.createElement(B.Provider,{value:null},M);return M},[y.children,r]),[T,k]=m.useState(null),S=m.useCallback(()=>{o.triggerRef.current&&k(o.triggerRef.current.getBoundingClientRect().width+"px")},[o.triggerRef]);pe(S,[S]),hd({ref:y.style?.["--trigger-width"]?void 0:o.triggerRef,onResize:S});let w={...u.style,"--trigger-anchor-point":h?`${h.x}px ${h.y}px`:void 0,...y.style,"--trigger-width":y.style?.["--trigger-width"]||T},D=m.createElement(ot.div,{...ae(Re(o,{global:!0}),u),...y,id:x?o.id:void 0,role:x?"dialog":void 0,tabIndex:x?-1:void 0,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"],ref:g,slot:o.slot||void 0,style:w,dir:o.dir,"data-trigger":o.trigger,"data-placement":f,"data-entering":p||void 0,"data-exiting":e||void 0},!o.isNonModal&&m.createElement(T0,{onDismiss:t.close}),m.createElement(s2.Provider,{value:{...d,placement:f,ref:i}},C),m.createElement(T0,{onDismiss:t.close}));return a?m.createElement($0,{...o,shouldContainFocus:x&&o.trigger!=="PreviewTrigger",isExiting:e,portalContainer:n??l?.current??void 0},D):m.createElement($0,{...o,shouldContainFocus:x&&o.trigger!=="PreviewTrigger",isExiting:e,portalContainer:n},!o.isNonModal&&t.isOpen&&m.createElement("div",{"data-testid":"underlay",...c,style:{position:"fixed",inset:0}}),m.createElement("div",{ref:s,style:{display:"contents"}},m.createElement(M0.Provider,{value:s},D)))}const N2=m.createContext({});var L0={};L0={longPressMessage:"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"};var I0={};I0={longPressMessage:"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"};var F0={};F0={longPressMessage:"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"};var O0={};O0={longPressMessage:"Langt tryk eller tryk på Alt + pil ned for at åbne menuen"};var K0={};K0={longPressMessage:"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"};var N0={};N0={longPressMessage:"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"};var R0={};R0={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var B0={};B0={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"};var z0={};z0={longPressMessage:"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"};var V0={};V0={longPressMessage:"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"};var U0={};U0={longPressMessage:"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."};var H0={};H0={longPressMessage:"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"};var j0={};j0={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var G0={};G0={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"};var q0={};q0={longPressMessage:"Premi a lungo o premi Alt + Freccia giù per aprire il menu"};var Y0={};Y0={longPressMessage:"長押しまたは Alt+下矢印キーでメニューを開く"};var Z0={};Z0={longPressMessage:"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"};var X0={};X0={longPressMessage:"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."};var Q0={};Q0={longPressMessage:"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"};var W0={};W0={longPressMessage:"Langt trykk eller trykk Alt + PilNed for å åpne menyen"};var J0={};J0={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var ex={};ex={longPressMessage:"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"};var tx={};tx={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var nx={};nx={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var rx={};rx={longPressMessage:"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"};var ox={};ox={longPressMessage:"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"};var ix={};ix={longPressMessage:"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"};var sx={};sx={longPressMessage:"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"};var lx={};lx={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var ax={};ax={longPressMessage:"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"};var ux={};ux={longPressMessage:"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"};var cx={};cx={longPressMessage:"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"};var dx={};dx={longPressMessage:"长按或按 Alt + 向下方向键以打开菜单"};var fx={};fx={longPressMessage:"長按或按 Alt+向下鍵以開啟功能表"};var hx={};hx={"ar-AE":L0,"bg-BG":I0,"cs-CZ":F0,"da-DK":O0,"de-DE":K0,"el-GR":N0,"en-US":R0,"es-ES":B0,"et-EE":z0,"fi-FI":V0,"fr-FR":U0,"he-IL":H0,"hr-HR":j0,"hu-HU":G0,"it-IT":q0,"ja-JP":Y0,"ko-KR":Z0,"lt-LT":X0,"lv-LV":Q0,"nb-NO":W0,"nl-NL":J0,"pl-PL":ex,"pt-BR":tx,"pt-PT":nx,"ro-RO":rx,"ru-RU":ox,"sk-SK":ix,"sl-SI":sx,"sr-SP":lx,"sv-SE":ax,"tr-TR":ux,"uk-UA":cx,"zh-CN":dx,"zh-TW":fx};function R2(t){let{onContextMenu:e}=t,n=m.useRef(!1),{longPressProps:r}=sd({onLongPressStart(){n.current=!1},onLongPress(o){n.current?n.current=!1:e?.({target:o.target,x:o.x,y:o.y})}});return e?{contextMenuProps:ae(Er()?r:{},{onContextMenu(o){o.stopPropagation(),o.preventDefault(),n.current=!0;let i=o.currentTarget.getBoundingClientRect();e({target:o.currentTarget,x:o.clientX-i.x,y:o.clientY-i.y})},onKeyDown(o){if(At()&&o.ctrlKey&&o.key==="Enter"){n.current=!1;let i=o.currentTarget;o.stopPropagation(),setTimeout(()=>{if(n.current)n.current=!1;else{let s=i.getBoundingClientRect();e({target:i,x:s.width/2,y:s.height/2})}},10)}}})}:{contextMenuProps:{}}}function gx(t,e,n){let{type:r}=t,{isOpen:o}=e;m.useEffect(()=>{n&&n.current&&Uv.set(n.current,e.close)});let i;r==="menu"?i=!0:r==="listbox"&&(i="listbox");let s=mt();return{triggerProps:{"aria-haspopup":i,"aria-expanded":o,"aria-controls":o?s:void 0,onPress:e.toggle},overlayProps:{id:s}}}function B2(t){return t&&t.__esModule?t.default:t}function z2(t,e,n){let{type:r="menu",isDisabled:o,trigger:i="press"}=t,s=mt(),{triggerProps:l,overlayProps:a}=gx({type:r},e,n),u=(p,y,v="first")=>{if(!p||y.isDefaultPrevented())return!1;e.toggle(v)},{keyboardProps:c}=Gn({isDisabled:o,shortcuts:{Enter:p=>u(i!=="longPress",p,"first")," ":p=>u(i!=="longPress",p,"first"),ArrowDown:p=>u(i!=="longPress",p,"first"),ArrowUp:p=>u(i!=="longPress",p,"last"),"Alt+Enter":p=>u(i==="longPress",p,"first"),"Alt+ ":p=>u(i==="longPress",p,"first"),"Alt+ArrowDown":p=>u(!0,p,"first"),"Alt+ArrowUp":p=>u(!0,p,"last")}}),d=kc(B2(hx),"@react-aria/menu"),{longPressProps:f}=sd({isDisabled:o||i!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),h={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!o&&(Ut(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!o&&(Ut(p.target),e.toggle())}};delete l.onPress;let{contextMenuProps:g}=R2({onContextMenu(p){let y=p.target.getBoundingClientRect();e.setPoint({x:y.x+p.x,y:y.y+p.y}),e.open()}});m.useEffect(()=>{if(e.isOpen&&i==="contextMenu"){let p=y=>{(y.button===2||y.button===0&&y.ctrlKey===!0)&&G(y)===document.body&&e.close()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)}},[e,i]);let b;if(i==="press")b={...h,...c};else if(i==="longPress")b={...f,...c};else if(i==="contextMenu"){b=g;let{"aria-haspopup":p,"aria-expanded":y,"aria-controls":v,...x}=l;l=x}return{menuTriggerProps:{...l,...b,id:s},menuProps:{...a,"aria-labelledby":s,autoFocus:e.focusStrategy||!0,onClose:e.close}}}const V2=new WeakMap;function U2(t,e,n){let{id:r,key:o,closeOnSelect:i,shouldCloseOnSelect:s,isVirtualized:l,"aria-haspopup":a,onPressStart:u,onPressUp:c,onPress:d,onPressChange:f,onPressEnd:h,onClick:g,onHoverStart:b,onHoverChange:p,onHoverEnd:y,onKeyDown:v,onKeyUp:x,onFocus:_,onFocusChange:C,onBlur:T,selectionManager:k=e.selectionManager}=t,S=!!a,w=S&&t["aria-expanded"]==="true",D=t.isDisabled??k.isDisabled(o),M=t.isSelected??k.isSelected(o),B=V2.get(e),V=e.collection.getItem(o),E=t.onClose||B.onClose,F=xl(),U=()=>{if(!S&&(V?.props?.onAction?V.props.onAction():t.onAction&&t.onAction(o),B.onAction)){let Fe=B.onAction;Fe(o,V?.value)}},I="menuitem";S||(k.selectionMode==="single"?I="menuitemradio":k.selectionMode==="multiple"&&(I="menuitemcheckbox"));let Q=Tn(),$=Tn(),K=Tn(),H={id:r,"aria-disabled":D||void 0,role:I,"aria-label":t["aria-label"],"aria-labelledby":Q,"aria-describedby":[t["aria-describedby"],$,K].filter(Boolean).join(" ")||void 0,"aria-controls":t["aria-controls"],"aria-haspopup":a,"aria-expanded":t["aria-expanded"]};if(k.selectionMode!=="none"&&!S&&(H["aria-checked"]=M),l){let Fe=Number(V?.index);H["aria-posinset"]=Number.isNaN(Fe)?void 0:Fe+1,H["aria-setsize"]=Pv(e.collection)}let me=m.useRef(!1),ve=Fe=>{f?.(Fe),me.current=Fe},he=m.useRef(null),N=Fe=>{Fe.pointerType!=="keyboard"&&(he.current={pointerType:Fe.pointerType}),Fe.pointerType==="mouse"&&(me.current||Fe.target.click()),c?.(Fe)},q=Fe=>{g?.(Fe),U(),Aw(Fe,F,V.props.href,V?.props.routerOptions);let Lo=he.current?.pointerType==="keyboard"?he.current?.key==="Enter"||k.selectionMode==="none"||k.isLink(o):k.selectionMode!=="multiple"||k.isLink(o);Lo=s??i??Lo,E&&!S&&Lo&&E(),he.current=null},{itemProps:ne,isFocused:Ae}=Sv({id:r,selectionManager:k,key:o,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:B.shouldUseVirtualFocus}),{pressProps:_e,isPressed:Kt}=Kl({onPressStart:u,onPress:d,onPressUp:N,onPressChange:ve,onPressEnd:h,isDisabled:D}),{hoverProps:Y}=$r({isDisabled:D,onHoverStart(Fe){!Tr()&&!(w&&a)&&(k.setFocused(!0),k.setFocusedKey(o)),b?.(Fe)},onHoverChange:p,onHoverEnd:y}),{keyboardProps:j}=Gn({shortcuts:{" ":Fe=>{he.current={pointerType:"keyboard",key:" "},G(Fe).click(),$i("keyboard")},Enter:Fe=>{he.current={pointerType:"keyboard",key:"Enter"};let Lo=G(Fe);if(Lo.tagName!=="A"){Lo.click(),$i("keyboard");return}return $i("keyboard"),{shouldPreventDefault:!1,shouldContinuePropagation:!1}}},onKeyDown:v,onKeyUp:x}),{focusableProps:Ue}=Yy({onBlur:T,onFocus:_,onFocusChange:C},n),Le=Re(V?.props);delete Le.id;let ra=ky(V?.props);return{menuItemProps:{...H,...ae(Le,ra,S?{onFocus:ne.onFocus,"data-collection":ne["data-collection"],"data-key":ne["data-key"]}:ne,_e,Y,j,Ue,B.shouldUseVirtualFocus||S?{onMouseDown:Fe=>Fe.preventDefault()}:void 0,D?void 0:{onClick:q}),tabIndex:ne.tabIndex!=null&&w&&!B.shouldUseVirtualFocus?-1:ne.tabIndex},labelProps:{id:Q},descriptionProps:{id:$},keyboardShortcutProps:{id:K},isFocused:Ae,isFocusVisible:Ae&&k.isFocused&&Tr()&&!w,isSelected:M,isPressed:Kt,isDisabled:D}}function H2(t){let e=md(t),[n,r]=m.useState(null),[o,i]=m.useState([]),s=()=>{i([]),e.close()};return{focusStrategy:n,...e,open(u=null){r(u),e.open()},toggle(u=null){r(u),e.toggle()},close(){s()},expandedKeysStack:o,openSubmenu:(u,c)=>{i(d=>c>d.length?d:[...d.slice(0,c),u])},closeSubmenu:(u,c)=>{i(d=>d[c]===u?d.slice(0,c):d)}}}const j2=m.createContext(null),G2=m.createContext(null),q2=m.createContext(null),Ad=class Ad extends Co{filter(e,n,r){let o=e.getItem(this.firstChildKey);if(o&&r(o.textValue,this)){let i=this.clone();return n.addDescendants(i,e),i}return null}};Ad.type="submenutrigger";let px=Ad;const mx=m.createContext(null),Y2=Al(Tl,function(e,n,r){[e,n]=Mt(e,n,mx);let o=pl(mx)?.id,i=m.useContext(j2),s=wi(n),l=m.useContext(q2),{isVirtualized:a}=m.useContext(Ll),{menuItemProps:u,labelProps:c,descriptionProps:d,keyboardShortcutProps:f,...h}=U2({...e,id:o,key:r.key,selectionManager:l,isVirtualized:a},i,s),{hoverProps:g,isHovered:b}=$r({isDisabled:h.isDisabled}),p=yt({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...h,isHovered:b,isFocusVisible:h.isFocusVisible,selectionMode:l.selectionMode,selectionBehavior:l.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),y=e.href?ot.a:ot.div,v=Re(e,{global:!0});return delete v.id,delete v.onClick,m.createElement(y,{...ae(v,p,u,g),ref:s,"data-disabled":h.isDisabled||void 0,"data-hovered":b||void 0,"data-focused":h.isFocused||void 0,"data-focus-visible":h.isFocusVisible||void 0,"data-pressed":h.isPressed||void 0,"data-selected":h.isSelected||void 0,"data-selection-mode":l.selectionMode==="none"?void 0:l.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},m.createElement(So,{values:[[Po,{slots:{[_o]:c,label:c,description:d}}],[N2,f],[qc,{isSelected:h.isSelected}]]},p.children))});function Z2(t,e){let{role:n="dialog"}=t,r=Tn();r=t["aria-label"]?void 0:r;let o=Tn();o=n==="alertdialog"&&!t["aria-describedby"]?o:void 0;let i=m.useRef(!1);m.useEffect(()=>{if(e.current&&!ki(e.current)){jn(e.current);let a=setTimeout(()=>{(Ee()===e.current||Ee()===document.body)&&(i.current=!0,e.current&&(e.current.blur(),jn(e.current)),i.current=!1)},500);return()=>{clearTimeout(a)}}},[e]),I2();let s=m.useRef(!1);m.useEffect(()=>{if(process.env.NODE_ENV!=="production"&&!s.current&&e.current){let a=e.current,u=a.hasAttribute("aria-label"),c=a.hasAttribute("aria-labelledby");!u&&!c&&(console.warn("A dialog must have a title for accessibility. Either provide an aria-label or aria-labelledby prop, or render a heading element inside the dialog."),s.current=!0)}});let l=t["aria-describedby"]??o;return{dialogProps:{...Re(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]??r,"aria-describedby":l,onBlur:a=>{i.current&&a.stopPropagation()}},titleProps:{id:r},contentProps:{id:o}}}const yx=m.createContext(null),Xl=m.createContext(null);function X2(t){let e=H2(t),n=m.useRef(null),{triggerProps:r,overlayProps:o}=gx({type:"dialog"},e,n);return r.id=mt(),o["aria-labelledby"]=r.id,m.createElement(So,{values:[[Xl,e],[G2,e],[yx,o],[yd,{trigger:"DialogTrigger",triggerRef:n,id:o.id,"aria-labelledby":o["aria-labelledby"]}]]},m.createElement(D2,{...r,ref:n,isPressed:e.isOpen},t.children))}const Q2=m.forwardRef(function(e,n){let r=e["aria-labelledby"];[e,n]=Mt(e,n,yx);let{dialogProps:o,titleProps:i,contentProps:s}=Z2({...e,"aria-labelledby":r},n),l=m.useContext(Xl);!o["aria-label"]&&!o["aria-labelledby"]&&(e["aria-labelledby"]?o["aria-labelledby"]=e["aria-labelledby"]:process.env.NODE_ENV!=="production"&&console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));let a=yt({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:l?.close||(()=>{})}}),u=Re(e,{global:!0});return m.createElement(ot.section,{...ae(u,a,o),render:e.render,ref:n,slot:e.slot||void 0},m.createElement(So,{values:[[Qk,{slots:{[_o]:{},title:{...i,level:2}}}],[Po,{slots:{[_o]:{},description:s}}],[Bl,{slots:{[_o]:{},close:{onPress:()=>l?.close()}}}]]},a.children))});function W2(t={}){let{locale:e}=Un();return m.useMemo(()=>new Intl.ListFormat(e,t),[e,t])}const bd=new WeakMap;function J2(t,e,n){let{keyboardDelegate:r,isDisabled:o,isRequired:i,name:s,form:l,validationBehavior:a="aria"}=t,u=id({usage:"search",sensitivity:"base"}),c=m.useMemo(()=>r||new rd(e.collection,e.disabledKeys,n,u),[r,e.collection,e.disabledKeys,u,n]),{menuTriggerProps:d,menuProps:f}=z2({isDisabled:o,type:"listbox"},e,n),{keyboardProps:h}=Gn({shortcuts:{ArrowLeft:()=>{if(e.selectionManager.selectionMode==="multiple")return!1;let w=e.selectedKey!=null?c.getKeyAbove?.(e.selectedKey):c.getFirstKey?.();w!=null&&e.setSelectedKey(w)},ArrowRight:()=>{if(e.selectionManager.selectionMode==="multiple")return!1;let w=e.selectedKey!=null?c.getKeyBelow?.(e.selectedKey):c.getFirstKey?.();w!=null&&e.setSelectedKey(w)}},allowRepeats:!0,onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp}),{typeSelectProps:g}=vv({keyboardDelegate:c,selectionManager:e.selectionManager,onTypeSelect(w){e.setSelectedKey(w)}}),{isInvalid:b,validationErrors:p,validationDetails:y}=e.displayValidation,{labelProps:v,fieldProps:x,descriptionProps:_,errorMessageProps:C}=lT({...t,labelElementType:"span",isInvalid:b,errorMessage:t.errorMessage||p});e.selectionManager.selectionMode==="multiple"&&(g={});let T=Re(t,{labelable:!0}),k=ae(g,d,x),S=mt();return bd.set(e,{isDisabled:o,isRequired:i,name:s,form:l,validationBehavior:a}),{labelProps:{...v,onClick:()=>{t.isDisabled||(n.current?.focus(),$i("keyboard"))}},triggerProps:ae(T,{...k,isDisabled:o,onKeyDown:Jt(k.onKeyDown,h.onKeyDown),onKeyUp:h.onKeyUp,"aria-labelledby":[S,k["aria-labelledby"],k["aria-label"]&&!k["aria-labelledby"]?k.id:null].filter(Boolean).join(" "),onFocus(w){e.isFocused||(t.onFocus&&t.onFocus(w),t.onFocusChange&&t.onFocusChange(!0),e.setFocused(!0))},onBlur(w){e.isOpen||(t.onBlur&&t.onBlur(w),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:S},menuProps:{...f,onAction:void 0,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:w=>{J(w.currentTarget,w.relatedTarget)||(t.onBlur&&t.onBlur(w),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[x["aria-labelledby"],k["aria-label"]&&!x["aria-labelledby"]?k.id:null].filter(Boolean).join(" ")},descriptionProps:_,errorMessageProps:C,isInvalid:b,validationErrors:p,validationDetails:y,hiddenSelectProps:{isDisabled:o,name:s,label:t.label,state:e,triggerRef:n,form:l}}}function e4(t,e,n){let r=bd.get(e)||{},{autoComplete:o,name:i=r.name,form:s=r.form,isDisabled:l=r.isDisabled}=t,{validationBehavior:a,isRequired:u}=r,{visuallyHiddenProps:c}=_b({style:{position:"fixed",top:0,left:0}});aT(t.selectRef,e.defaultValue,e.setValue),uT({validationBehavior:a,focus:()=>n.current?.focus()},e,t.selectRef);let d=e.setValue,f=m.useCallback(h=>{let g=G(h);g.multiple?d(Array.from(g.selectedOptions,b=>b.value)):d(h.currentTarget.value)},[d]);return{containerProps:{...c,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:o,disabled:l,multiple:e.selectionManager.selectionMode==="multiple",required:a==="native"&&u,name:i,form:s,value:e.value??"",onChange:f,onInput:f}}}function t4(t){let{state:e,triggerRef:n,label:r,name:o,form:i,isDisabled:s}=t,l=m.useRef(null),a=m.useRef(null),{containerProps:u,selectProps:c}=e4({...t,selectRef:e.collection.size<=300?l:a},e,n),d=Array.isArray(e.value)?e.value:[e.value];if(e.collection.size<=300)return m.createElement("div",{...u,"data-testid":"hidden-select-container"},m.createElement("label",null,r,m.createElement("select",{...c,ref:l},m.createElement("option",{value:"",label:" "}," "),[...e.collection.getKeys()].map(f=>{let h=e.collection.getItem(f);if(h&&h.type==="item")return m.createElement("option",{key:h.key,value:h.key},h.textValue)}),e.collection.size===0&&o&&d.map((f,h)=>m.createElement("option",{key:h,value:f??""})))));if(o){let f=bd.get(e)||{},{validationBehavior:h}=f;d.length===0&&(d=[null]);let g=d.map((b,p)=>{let y={type:"hidden",autoComplete:c.autoComplete,name:o,form:i,disabled:s,value:b??""};return h==="native"?m.createElement("input",{key:p,...y,ref:p===0?a:null,style:{display:"none"},type:"text",required:p===0?c.required:!1,onChange:()=>{}}):m.createElement("input",{key:p,...y,ref:p===0?a:null})});return m.createElement(m.Fragment,null,g)}return null}function n4(t){let{selectionMode:e="single",shouldCloseOnSelect:n=e==="single"}=t,r=md(t),[o,i]=m.useState(null),s=m.useMemo(()=>t.defaultValue!==void 0?t.defaultValue:e==="single"?t.defaultSelectedKey??null:[],[t.defaultValue,t.defaultSelectedKey,e]),l=m.useMemo(()=>t.value!==void 0?t.value:e==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,e]),[a,u]=kl(l,s,t.onChange),c=e==="single"&&Array.isArray(a)?a[0]:a,d=x=>{if(e==="single"){let _=Array.isArray(x)?x[0]??null:x;u(_),_!==c&&t.onSelectionChange?.(_)}else{let _=[];Array.isArray(x)?_=x:x!=null&&(_=[x]),u(_)}},f=Av({...t,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:m.useMemo(()=>r4(c),[c]),onSelectionChange:x=>{if(x!=="all"){if(e==="single"){let _=x.values().next().value??null;d(_)}else d([...x]);n&&r.close(),b.commitValidation()}}}),h=f.selectionManager.firstSelectedKey,g=m.useMemo(()=>[...f.selectionManager.selectedKeys].map(x=>f.collection.getItem(x)).filter(x=>x!=null),[f.selectionManager.selectedKeys,f.collection]),b=rT({...t,value:Array.isArray(c)&&c.length===0?null:c}),[p,y]=m.useState(!1),[v]=m.useState(c);return{...b,...f,...r,value:c,defaultValue:s??v,setValue:d,selectedKey:h,setSelectedKey:d,selectedItem:g[0]??null,selectedItems:g,defaultSelectedKey:t.defaultSelectedKey??(t.selectionMode==="single"?v:null),focusStrategy:o,open(x=null){(f.collection.size!==0||t.allowsEmptyCollection)&&(i(x),r.open())},toggle(x=null){(f.collection.size!==0||t.allowsEmptyCollection)&&(i(x),r.toggle())},isFocused:p,setFocused:y}}function r4(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}function o4(t){return t&&t.__esModule?t.default:t}const vd=m.createContext(null),bx=m.createContext(null),i4=Mc(function(e,n){[e,n]=Mt(e,n,vd);let{children:r,isDisabled:o=!1,isInvalid:i=!1,isRequired:s=!1}=e,l=m.useMemo(()=>typeof r=="function"?r({isOpen:!1,isDisabled:o,isInvalid:i,isRequired:s,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):r,[r,o,i,s]);return m.createElement(Jy,{content:l},a=>m.createElement(l4,{props:e,collection:a,selectRef:n}))}),s4=[gb,Bl,Po];function l4({props:t,selectRef:e,collection:n}){let{validationBehavior:r}=pl(sT)||{},o=t.validationBehavior??r??"native",i=n4({...t,collection:n,children:void 0,validationBehavior:o}),{isFocusVisible:s,focusProps:l}=Fi({within:!0}),a=m.useRef(null),[u,c]=gy(!t["aria-label"]&&!t["aria-labelledby"]),{labelProps:d,triggerProps:f,valueProps:h,menuProps:g,descriptionProps:b,errorMessageProps:p,hiddenSelectProps:y,...v}=J2({...sw(t),label:c,validationBehavior:o},i,a),x=m.useMemo(()=>({isOpen:i.isOpen,isFocused:i.isFocused,isFocusVisible:s,isDisabled:t.isDisabled||!1,isInvalid:v.isInvalid||!1,isRequired:t.isRequired||!1}),[i.isOpen,i.isFocused,s,t.isDisabled,v.isInvalid,t.isRequired]),_=yt({...t,values:x,defaultClassName:"react-aria-Select"}),C=Re(t,{global:!0});delete C.id;let T=m.useRef(null);return m.createElement(So,{values:[[vd,t],[bx,i],[vx,h],[gb,{...d,ref:u,elementType:"span"}],[Bl,{...f,ref:a,isPressed:i.isOpen,autoFocus:t.autoFocus}],[Xl,i],[yd,{trigger:"Select",triggerRef:a,scrollRef:T,placement:"bottom start","aria-labelledby":g["aria-labelledby"],clearContexts:s4}],[cd,{...g,ref:T}],[Do,i],[Po,{slots:{description:b,errorMessage:p}}],[tT,v]]},m.createElement(ot.div,{...ae(C,_,l),ref:e,slot:t.slot||void 0,"data-focused":i.isFocused||void 0,"data-focus-visible":s||void 0,"data-open":i.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-invalid":v.isInvalid||void 0,"data-required":t.isRequired||void 0},_.children,m.createElement(t4,{...y,autoComplete:t.autoComplete})))}const vx=m.createContext(null),a4=Mc(function(e,n){[e,n]=Mt(e,n,vx);let r=m.useContext(bx),{placeholder:o}=pl(vd),i=r.selectedItems.map(g=>{let b=g.props?.children;return typeof b=="function"&&(b=b({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:"single",selectionBehavior:"toggle"})),b}),s=W2(),l=m.useMemo(()=>r.selectedItems.map(g=>g?.textValue),[r.selectedItems]),a=r.selectionManager.selectionMode,u=m.useMemo(()=>a==="single"?l[0]??"":s.format(l),[a,s,l]),c=m.useMemo(()=>{if(a==="single")return i[0];let g=s.formatToParts(l);if(g.length===0)return null;let b=0;return g.map(p=>p.type==="element"?m.createElement(m.Fragment,{key:b},i[b++]):p.value)},[a,s,l,i]),d=kc(o4(sv),"react-aria-components"),f=yt({...e,defaultChildren:c??o??d.format("selectPlaceholder"),defaultClassName:"react-aria-SelectValue",values:{selectedItem:r.selectedItems[0]?.value??null,selectedItems:m.useMemo(()=>r.selectedItems.map(g=>g.value??null),[r.selectedItems]),selectedText:u,isPlaceholder:r.selectedItems.length===0,state:r}}),h=Re(e,{global:!0});return m.createElement(ot.span,{ref:n,...h,...f,"data-placeholder":r.selectedItems.length===0||void 0},m.createElement(Po.Provider,{value:void 0},f.children))});function xx(t,e,n){const{isSelected:r}=e,{isPressed:o,buttonProps:i}=bb({...t,onPress:Jt(e.toggle,t.onPress)},n);return{isPressed:o,isSelected:r,isDisabled:t.isDisabled||!1,buttonProps:ae(i,{"aria-pressed":r})}}function u4(t,e){const{"aria-label":n,"aria-labelledby":r,orientation:o="horizontal"}=t;let[i,s]=m.useState(!1);pe(()=>{s(!!(e.current&&e.current.parentElement?.closest('[role="toolbar"]')))});const{direction:l}=Un(),a=l==="rtl"&&o==="horizontal";let u=LT(e);const c=g=>{if(J(g.currentTarget,G(g))){if(o==="horizontal"&&g.key==="ArrowRight"||o==="vertical"&&g.key==="ArrowDown")a?u.focusPrevious():u.focusNext();else if(o==="horizontal"&&g.key==="ArrowLeft"||o==="vertical"&&g.key==="ArrowUp")a?u.focusNext():u.focusPrevious();else if(g.key==="Tab"){d.current=Ee(),g.shiftKey?u.focusFirst():u.focusLast();return}else return;g.stopPropagation(),g.preventDefault()}},d=m.useRef(null),f=g=>{!J(g.currentTarget,g.relatedTarget)&&!d.current&&(d.current=G(g))},h=g=>{d.current&&!J(g.currentTarget,g.relatedTarget)&&J(e.current,G(g))&&(d.current?.focus(),d.current=null)};return{toolbarProps:{...Re(t,{labelable:!0}),role:i?"group":"toolbar","aria-orientation":o,"aria-label":n,"aria-labelledby":n==null?r:void 0,onKeyDownCapture:i?void 0:c,onFocusCapture:i?void 0:h,onBlurCapture:i?void 0:f}}}function c4(t,e,n){let r={isSelected:e.selectedKeys.has(t.id),defaultSelected:!1,setSelected(a){e.setSelected(t.id,a)},toggle(){e.toggleKey(t.id)}},{isPressed:o,isSelected:i,isDisabled:s,buttonProps:l}=xx({...t,id:void 0,isDisabled:t.isDisabled||e.isDisabled},r,n);return e.selectionMode==="single"&&(l.role="radio",l["aria-checked"]=r.isSelected,delete l["aria-pressed"]),{isPressed:o,isSelected:i,isDisabled:s,buttonProps:l}}const d4=m.createContext(null),f4=m.createContext({}),zi=m.forwardRef(function(e,n){[e,n]=Mt(e,n,f4);let r=m.useContext(d4),o=hT(r&&e.id!=null?{isSelected:r.selectedKeys.has(e.id),onChange(p){r.setSelected(e.id,p)}}:e),{buttonProps:i,isPressed:s,isSelected:l,isDisabled:a}=r&&e.id!=null?c4({...e,id:e.id},r,n):xx({...e,id:e.id!=null?String(e.id):void 0},o,n),{focusProps:u,isFocused:c,isFocusVisible:d}=Fi(e),{hoverProps:f,isHovered:h}=$r({...e,isDisabled:a}),g=yt({...e,id:void 0,values:{isHovered:h,isPressed:s,isFocused:c,isSelected:o.isSelected,isFocusVisible:d,isDisabled:a,state:o},defaultClassName:"react-aria-ToggleButton"}),b=Re(e,{global:!0});return delete b.id,delete b.onClick,m.createElement(ot.button,{...ae(b,g,i,u,f),ref:n,slot:e.slot||void 0,"data-focused":c||void 0,"data-disabled":a||void 0,"data-pressed":s||void 0,"data-selected":l||void 0,"data-hovered":h||void 0,"data-focus-visible":d||void 0},m.createElement(qc.Provider,{value:{isSelected:l}},g.children))}),h4=m.createContext({}),g4=m.forwardRef(function(e,n){[e,n]=Mt(e,n,h4);let{toolbarProps:r}=u4(e,n),o=yt({...e,values:{orientation:e.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),i=Re(e,{global:!0});return delete i.id,m.createElement(ot.div,{...ae(i,o,r),ref:n,slot:e.slot||void 0,"data-orientation":e.orientation||"horizontal"},o.children)});var p4={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const rn=(t,e,n,r)=>{const o=m.forwardRef(({color:i="currentColor",size:s=24,stroke:l=2,title:a,className:u,children:c,...d},f)=>m.createElement("svg",{ref:f,...p4[t],width:s,height:s,className:["tabler-icon",`tabler-icon-${e}`,u].join(" "),strokeWidth:l,stroke:i,...d},[a&&m.createElement("title",{key:"svg-title"},a),...r.map(([h,g])=>m.createElement(h,g)),...Array.isArray(c)?c:[c]]));return o.displayName=`${n}`,o};const m4=rn("outline","arrow-back-up","ArrowBackUp",[["path",{d:"M9 14l-4 -4l4 -4",key:"svg-0"}],["path",{d:"M5 10h11a4 4 0 1 1 0 8h-1",key:"svg-1"}]]);const y4=rn("outline","arrow-forward-up","ArrowForwardUp",[["path",{d:"M15 14l4 -4l-4 -4",key:"svg-0"}],["path",{d:"M19 10h-11a4 4 0 1 0 0 8h1",key:"svg-1"}]]);const b4=rn("outline","bold","Bold",[["path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6l0 -7",key:"svg-0"}],["path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7",key:"svg-1"}]]);const _x=rn("outline","check","Check",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);const v4=rn("outline","chevron-down","ChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);const x4=rn("outline","italic","Italic",[["path",{d:"M11 5l6 0",key:"svg-0"}],["path",{d:"M7 19l6 0",key:"svg-1"}],["path",{d:"M14 5l-4 14",key:"svg-2"}]]);const _4=rn("outline","link","Link",[["path",{d:"M9 15l6 -6",key:"svg-0"}],["path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464",key:"svg-1"}],["path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463",key:"svg-2"}]]);const S4=rn("outline","list-numbers","ListNumbers",[["path",{d:"M11 6h9",key:"svg-0"}],["path",{d:"M11 12h9",key:"svg-1"}],["path",{d:"M12 18h8",key:"svg-2"}],["path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4",key:"svg-3"}],["path",{d:"M6 10v-6l-2 2",key:"svg-4"}]]);const C4=rn("outline","list","List",[["path",{d:"M9 6l11 0",key:"svg-0"}],["path",{d:"M9 12l11 0",key:"svg-1"}],["path",{d:"M9 18l11 0",key:"svg-2"}],["path",{d:"M5 6l0 .01",key:"svg-3"}],["path",{d:"M5 12l0 .01",key:"svg-4"}],["path",{d:"M5 18l0 .01",key:"svg-5"}]]);const E4=rn("outline","strikethrough","Strikethrough",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5",key:"svg-1"}]]),w4=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},k4=(t,e)=>({classGroupId:t,validator:e}),Sx=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Ql="-",Cx=[],T4="arbitrary..",P4=t=>{const e=D4(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return $4(s);const l=s.split(Ql),a=l[0]===""&&l.length>1?1:0;return Ex(l,a,e)},getConflictingClassGroupIds:(s,l)=>{if(l){const a=r[s],u=n[s];return a?u?w4(u,a):a:u||Cx}return n[s]||Cx}}},Ex=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],i=n.nextPart.get(o);if(i){const u=Ex(t,e+1,i);if(u)return u}const s=n.validators;if(s===null)return;const l=e===0?t.join(Ql):t.slice(e).join(Ql),a=s.length;for(let u=0;u<a;u++){const c=s[u];if(c.validator(l))return c.classGroupId}},$4=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?T4+r:void 0})(),D4=t=>{const{theme:e,classGroups:n}=t;return M4(n,e)},M4=(t,e)=>{const n=Sx();for(const r in t){const o=t[r];xd(o,n,r,e)}return n},xd=(t,e,n,r)=>{const o=t.length;for(let i=0;i<o;i++){const s=t[i];A4(s,e,n,r)}},A4=(t,e,n,r)=>{if(typeof t=="string"){L4(t,e,n);return}if(typeof t=="function"){I4(t,e,n,r);return}F4(t,e,n,r)},L4=(t,e,n)=>{const r=t===""?e:wx(e,t);r.classGroupId=n},I4=(t,e,n,r)=>{if(O4(t)){xd(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(k4(n,t))},F4=(t,e,n,r)=>{const o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){const[l,a]=o[s];xd(a,wx(e,l),n,r)}},wx=(t,e)=>{let n=t;const r=e.split(Ql),o=r.length;for(let i=0;i<o;i++){const s=r[i];let l=n.nextPart.get(s);l||(l=Sx(),n.nextPart.set(s,l)),n=l}return n},O4=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,K4=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},_d="!",kx=":",N4=[],Tx=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),R4=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const i=[];let s=0,l=0,a=0,u;const c=o.length;for(let b=0;b<c;b++){const p=o[b];if(s===0&&l===0){if(p===kx){i.push(o.slice(a,b)),a=b+1;continue}if(p==="/"){u=b;continue}}p==="["?s++:p==="]"?s--:p==="("?l++:p===")"&&l--}const d=i.length===0?o:o.slice(a);let f=d,h=!1;d.endsWith(_d)?(f=d.slice(0,-1),h=!0):d.startsWith(_d)&&(f=d.slice(1),h=!0);const g=u&&u>a?u-a:void 0;return Tx(i,h,f,g)};if(e){const o=e+kx,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Tx(N4,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},B4=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],l=s[0]==="[",a=e.has(s);l||a?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},z4=t=>({cache:K4(t.cacheSize),parseClassName:R4(t),sortModifiers:B4(t),postfixLookupClassGroupIds:V4(t),...P4(t)}),V4=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},U4=/\s+/,H4=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=e,l=[],a=t.trim().split(U4);let u="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:f,modifiers:h,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:p}=n(d);if(f){u=d+(u.length>0?" "+u:u);continue}let y=!!p,v;if(y){const k=b.substring(0,p);v=r(k);const S=v&&s[v]?r(b):void 0;S&&S!==v&&(v=S,y=!1)}else v=r(b);if(!v){if(!y){u=d+(u.length>0?" "+u:u);continue}if(v=r(b),!v){u=d+(u.length>0?" "+u:u);continue}y=!1}const x=h.length===0?"":h.length===1?h[0]:i(h).join(":"),_=g?x+_d:x,C=_+v;if(l.indexOf(C)>-1)continue;l.push(C);const T=o(v,y);for(let k=0;k<T.length;++k){const S=T[k];l.push(_+S)}u=d+(u.length>0?" "+u:u)}return u},j4=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=Px(n))&&(o&&(o+=" "),o+=r);return o},Px=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=Px(t[r]))&&(n&&(n+=" "),n+=e);return n},$x=(t,...e)=>{let n,r,o,i;const s=a=>{const u=e.reduce((c,d)=>d(c),t());return n=z4(u),r=n.cache.get,o=n.cache.set,i=l,l(a)},l=a=>{const u=r(a);if(u)return u;const c=H4(a,n);return o(a,c),c};return i=s,(...a)=>i(j4(...a))},G4=[],qe=t=>{const e=n=>n[t]||G4;return e.isThemeGetter=!0,e},Dx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,q4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Y4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Z4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,X4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Q4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zn=t=>q4.test(t),se=t=>!!t&&!Number.isNaN(Number(t)),on=t=>!!t&&Number.isInteger(Number(t)),Sd=t=>t.endsWith("%")&&se(t.slice(0,-1)),$n=t=>Y4.test(t),Ax=()=>!0,J4=t=>Z4.test(t)&&!X4.test(t),Cd=()=>!1,eP=t=>Q4.test(t),tP=t=>W4.test(t),nP=t=>!Z(t)&&!X(t),rP=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),oP=t=>Xn(t,Nx,Cd),Z=t=>Dx.test(t),Lr=t=>Xn(t,Rx,J4),Lx=t=>Xn(t,fP,se),iP=t=>Xn(t,zx,Ax),sP=t=>Xn(t,Bx,Cd),Ix=t=>Xn(t,Ox,Cd),lP=t=>Xn(t,Kx,tP),Wl=t=>Xn(t,Vx,eP),X=t=>Mx.test(t),Vi=t=>Ir(t,Rx),aP=t=>Ir(t,Bx),Fx=t=>Ir(t,Ox),uP=t=>Ir(t,Nx),cP=t=>Ir(t,Kx),Jl=t=>Ir(t,Vx,!0),dP=t=>Ir(t,zx,!0),Xn=(t,e,n)=>{const r=Dx.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Ir=(t,e,n=!1)=>{const r=Mx.exec(t);return r?r[1]?e(r[1]):n:!1},Ox=t=>t==="position"||t==="percentage",Kx=t=>t==="image"||t==="url",Nx=t=>t==="length"||t==="size"||t==="bg-size",Rx=t=>t==="length",fP=t=>t==="number",Bx=t=>t==="family-name",zx=t=>t==="number"||t==="weight",Vx=t=>t==="shadow",Ux=()=>{const t=qe("color"),e=qe("font"),n=qe("text"),r=qe("font-weight"),o=qe("tracking"),i=qe("leading"),s=qe("breakpoint"),l=qe("container"),a=qe("spacing"),u=qe("radius"),c=qe("shadow"),d=qe("inset-shadow"),f=qe("text-shadow"),h=qe("drop-shadow"),g=qe("blur"),b=qe("perspective"),p=qe("aspect"),y=qe("ease"),v=qe("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),X,Z],T=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],S=()=>[X,Z,a],w=()=>[Zn,"full","auto",...S()],D=()=>[on,"none","subgrid",X,Z],M=()=>["auto",{span:["full",on,X,Z]},on,X,Z],B=()=>[on,"auto",X,Z],V=()=>["auto","min","max","fr",X,Z],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...S()],I=()=>[Zn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],Q=()=>[Zn,"screen","full","dvw","lvw","svw","min","max","fit",...S()],$=()=>[Zn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],K=()=>[t,X,Z],H=()=>[..._(),Fx,Ix,{position:[X,Z]}],me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ve=()=>["auto","cover","contain",uP,oP,{size:[X,Z]}],he=()=>[Sd,Vi,Lr],N=()=>["","none","full",u,X,Z],q=()=>["",se,Vi,Lr],ne=()=>["solid","dashed","dotted","double"],Ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>[se,Sd,Fx,Ix],Kt=()=>["","none",g,X,Z],Y=()=>["none",se,X,Z],j=()=>["none",se,X,Z],Ue=()=>[se,X,Z],Le=()=>[Zn,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$n],breakpoint:[$n],color:[Ax],container:[$n],"drop-shadow":[$n],ease:["in","out","in-out"],font:[nP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$n],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$n],shadow:[$n],spacing:["px",se],text:[$n],"text-shadow":[$n],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Zn,Z,X,p]}],container:["container"],"container-type":[{"@container":["","normal","size",X,Z]}],"container-named":[rP],columns:[{columns:[se,Z,X,l]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[on,"auto",X,Z]}],basis:[{basis:[Zn,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,Zn,"auto","initial","none",Z]}],grow:[{grow:["",se,X,Z]}],shrink:[{shrink:["",se,X,Z]}],order:[{order:[on,"first","last","none",X,Z]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[l,"screen",...I()]}],"min-w":[{"min-w":[l,"screen","none",...I()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[s]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,Vi,Lr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,dP,iP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sd,Z]}],"font-family":[{font:[aP,sP,e]}],"font-features":[{"font-features":[Z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,X,Z]}],"line-clamp":[{"line-clamp":[se,"none",X,Lx]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",X,Z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",X,Z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",X,Lr]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[se,"auto",X,Z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[on,X,Z]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",X,Z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",X,Z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:me()}],"bg-size":[{bg:ve()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},on,X,Z],radial:["",X,Z],conic:[on,X,Z]},cP,lP]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-bs":[{"border-bs":K()}],"border-color-be":[{"border-be":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,X,Z]}],"outline-w":[{outline:["",se,Vi,Lr]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",c,Jl,Wl]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",d,Jl,Wl]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[se,Lr]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",f,Jl,Wl]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[se,X,Z]}],"mix-blend":[{"mix-blend":[...Ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[X,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:me()}],"mask-size":[{mask:ve()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",X,Z]}],filter:[{filter:["","none",X,Z]}],blur:[{blur:Kt()}],brightness:[{brightness:[se,X,Z]}],contrast:[{contrast:[se,X,Z]}],"drop-shadow":[{"drop-shadow":["","none",h,Jl,Wl]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",se,X,Z]}],"hue-rotate":[{"hue-rotate":[se,X,Z]}],invert:[{invert:["",se,X,Z]}],saturate:[{saturate:[se,X,Z]}],sepia:[{sepia:["",se,X,Z]}],"backdrop-filter":[{"backdrop-filter":["","none",X,Z]}],"backdrop-blur":[{"backdrop-blur":Kt()}],"backdrop-brightness":[{"backdrop-brightness":[se,X,Z]}],"backdrop-contrast":[{"backdrop-contrast":[se,X,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,X,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,X,Z]}],"backdrop-invert":[{"backdrop-invert":["",se,X,Z]}],"backdrop-opacity":[{"backdrop-opacity":[se,X,Z]}],"backdrop-saturate":[{"backdrop-saturate":[se,X,Z]}],"backdrop-sepia":[{"backdrop-sepia":["",se,X,Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",X,Z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",X,Z]}],ease:[{ease:["linear","initial",y,X,Z]}],delay:[{delay:[se,X,Z]}],animate:[{animate:["none",v,X,Z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,X,Z]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:j()}],"scale-x":[{"scale-x":j()}],"scale-y":[{"scale-y":j()}],"scale-z":[{"scale-z":j()}],"scale-3d":["scale-3d"],skew:[{skew:Ue()}],"skew-x":[{"skew-x":Ue()}],"skew-y":[{"skew-y":Ue()}],transform:[{transform:[X,Z,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[on,X,Z]}],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",X,Z]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":K()}],"scrollbar-track-color":[{"scrollbar-track":K()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",X,Z]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[se,Vi,Lr,Lx]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hP=(t,{cacheSize:e,prefix:n,experimentalParseClassName:r,extend:o={},override:i={}})=>(Mo(t,"cacheSize",e),Mo(t,"prefix",n),Mo(t,"experimentalParseClassName",r),ea(t.theme,i.theme),ea(t.classGroups,i.classGroups),ea(t.conflictingClassGroups,i.conflictingClassGroups),ea(t.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Mo(t,"postfixLookupClassGroups",i.postfixLookupClassGroups),Mo(t,"orderSensitiveModifiers",i.orderSensitiveModifiers),ta(t.theme,o.theme),ta(t.classGroups,o.classGroups),ta(t.conflictingClassGroups,o.conflictingClassGroups),ta(t.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Ed(t,o,"postfixLookupClassGroups"),Ed(t,o,"orderSensitiveModifiers"),t),Mo=(t,e,n)=>{n!==void 0&&(t[e]=n)},ea=(t,e)=>{if(e)for(const n in e)Mo(t,n,e[n])},ta=(t,e)=>{if(e)for(const n in e)Ed(t,e,n)},Ed=(t,e,n)=>{const r=e[n];r!==void 0&&(t[n]=t[n]?t[n].concat(r):r)},gP=((t,...e)=>typeof t=="function"?$x(Ux,t,...e):$x(()=>hP(Ux(),t),...e))({extend:{theme:{text:["h1","h2","h3","h4","h5","h6","body-lg","body-sm","caption-lg","caption-sm"]}}});function at(...t){return gP(fc(t))}const Hx=ce.createContext(null),jx=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Gx=fc,sn=(t,e)=>n=>{var r;if(e?.variants==null)return Gx(t,n?.class,n?.className);const{variants:o,defaultVariants:i}=e,s=Object.keys(o).map(u=>{const c=n?.[u],d=i?.[u];if(c===null)return null;const f=jx(c)||jx(d);return o[u][f]}),l=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),a=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(g=>{let[b,p]=g;return Array.isArray(p)?p.includes({...i,...l}[b]):{...i,...l}[b]===p})?[...u,d,f]:u},[]);return Gx(t,s,a,n?.class,n?.className)},pP=sn(["inline-flex items-center justify-center","border transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white"],{variants:{size:{sm:"h-4 w-4 rounded-[4px]",md:"h-5 w-5 rounded-[6px]",lg:"h-5 w-5 rounded-[6px]"},checked:{true:"",false:""},disabled:{true:"cursor-not-allowed",false:"cursor-pointer"}},compoundVariants:[{checked:!1,disabled:!1,className:"bg-white border-light-200 hover:border-light-400"},{checked:!0,disabled:!1,className:"bg-primary-500 border-primary-500 text-white hover:bg-primary-800 hover:border-primary-800"},{disabled:!0,className:"bg-light-100 border-light-200 text-white"}],defaultVariants:{size:"md",checked:!1,disabled:!1}}),qx=at("group flex h-12 w-full items-center px-2 py-0.5 outline-none","cursor-pointer data-[disabled]:cursor-not-allowed"),mP=sn(["flex h-11 min-w-0 flex-1 items-center gap-2 overflow-hidden rounded-md","py-2.5 pl-1 pr-2.5 text-left font-nunito text-body-sm font-medium","[&_[data-slot=supporting-text]]:font-normal"],{variants:{active:{true:"bg-light-50 text-light-800",false:"text-light-900"},focusVisible:{true:"shadow-focus",false:""},nativeInteraction:{true:"group-hover:bg-light-50 group-active:bg-light-50",false:""},disabled:{true:"text-light-400 [&_[data-slot=supporting-text]]:text-light-400",false:"[&_[data-slot=supporting-text]]:text-light-700"}},defaultVariants:{active:!1,focusVisible:!1,nativeInteraction:!1,disabled:!1}}),yP="flex shrink-0 items-center justify-center",bP="flex min-w-0 flex-1 items-center gap-2 overflow-hidden whitespace-nowrap",vP="ml-auto flex shrink-0 items-center justify-center",Yx=t=>t!=null&&t!==!1;function Zx({state:t,leadingSlot:e,hasCustomLeadingSlot:n=!1,children:r,trailingSlot:o,nativeInteraction:i=!1}){const s=n?e:t.selectionMode==="multiple"?R.jsx("span",{"aria-hidden":"true","data-slot":"selection-indicator","data-selected":String(t.isSelected),className:`${pP({size:"sm",checked:t.isSelected,disabled:t.isDisabled})} pointer-events-none shrink-0`,children:t.isSelected&&R.jsx(_x,{size:12,strokeWidth:2.5})}):null;return R.jsxs("span",{"data-slot":"collection-item-content",className:at(mP({active:t.isHovered||t.isPressed||t.isSelected||t.isFocusVisible,focusVisible:t.isFocusVisible,nativeInteraction:i&&!t.isDisabled,disabled:t.isDisabled})),children:[Yx(s)&&R.jsx("span",{"data-slot":"leading",className:yP,children:s}),R.jsx("span",{"data-slot":"main",className:bP,children:r}),Yx(o)&&R.jsx("span",{"data-slot":"trailing",className:vP,children:o})]})}const Ao=(t,e)=>typeof t=="function"?t(e):t,Xx=t=>({isHovered:t.isHovered,isPressed:t.isPressed,isSelected:t.isSelected,isFocused:t.isFocused,isFocusVisible:t.isFocusVisible,isDisabled:t.isDisabled,selectionMode:t.selectionMode,selectionBehavior:t.selectionBehavior});function xP({className:t,style:e,leadingSlot:n,children:r,trailingSlot:o,...i},s){const l=i.textValue??(typeof r=="string"?r:void 0);return R.jsx(n2,{ref:s,...i,textValue:l,style:e,className:at(qx,t),children:a=>R.jsx(Zx,{state:Xx(a),leadingSlot:Ao(n,a),hasCustomLeadingSlot:n!==void 0,trailingSlot:Ao(o,a),children:Ao(r,a)})})}const Qx=ce.forwardRef(xP);function _P({className:t,style:e,leadingSlot:n,children:r,trailingSlot:o,...i},s){const l=i.textValue??(typeof r=="string"?r:void 0);return R.jsx(Y2,{ref:s,...i,textValue:l,style:e,className:at(qx,t),children:a=>R.jsx(Zx,{state:Xx(a),leadingSlot:Ao(n,a),hasCustomLeadingSlot:n!==void 0,trailingSlot:Ao(o,a),children:Ao(r,a)})})}const SP=ce.forwardRef(_P);function CP({id:t,value:e,textValue:n,"aria-label":r,isDisabled:o,onAction:i,className:s,style:l,leadingSlot:a,children:u,trailingSlot:c},d){const f=ce.useContext(Hx),h={id:t,value:e,textValue:n,"aria-label":r,isDisabled:o,onAction:i,className:s,style:l,leadingSlot:a,children:u,trailingSlot:c};if(f==="menu")return R.jsx(SP,{ref:d,...h});if(f==="listbox")return R.jsx(Qx,{ref:d,...h});throw new Error("CollectionItem must be rendered inside a supported collection parent.")}const EP=ce.forwardRef(CP),wP=at("flex max-h-60 w-full flex-col overflow-y-auto py-1 outline-none","[scrollbar-width:thin] [scrollbar-color:theme(colors.light.300)_theme(colors.light.50)]","[&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-light-50","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-light-300"),kP=at("flex size-4 shrink-0 items-center justify-center text-light-500"),TP=at("ml-auto shrink-0 font-normal text-caption-sm text-light-500");at("my-1 h-px w-full shrink-0 bg-light-200");function PP({className:t,style:e,...n},r){return R.jsx(Hx.Provider,{value:"listbox",children:R.jsx(JT,{ref:r,...n,style:e,className:at(wP,t)})})}const $P=ce.forwardRef(PP);function DP({className:t,style:e,content:n="none",icon:r,shortcut:o,children:i,...s},l){const a=n==="icon"?r:n==="selection"?u=>R.jsx("span",{className:kP,children:u.isSelected&&R.jsx(_x,{size:16,"aria-hidden":"true"})}):void 0;return R.jsx(Qx,{ref:l,...s,style:e,className:t,leadingSlot:a,trailingSlot:o?R.jsx("span",{className:TP,children:o}):void 0,children:i})}ce.forwardRef(DP);const MP=1e3,AP=sn(["flex flex-col overflow-hidden","rounded-lg border border-light-200 bg-white shadow-lg","outline-none"]);function LP(t){ce.useEffect(()=>{let e=0;const n=r=>{!t.current||e||r.target instanceof Node&&t.current.contains(r.target)||(e=requestAnimationFrame(()=>{e=0,window.dispatchEvent(new Event("resize"))}))};return document.addEventListener("scroll",n,!0),()=>{document.removeEventListener("scroll",n,!0),e&&cancelAnimationFrame(e)}},[t])}function IP(t){const e=()=>{t.hasAttribute("role")&&t.removeAttribute("role")};e();const n=new MutationObserver(e);return n.observe(t,{attributes:!0,attributeFilter:["role"]}),()=>n.disconnect()}const Wx=ce.forwardRef(({className:t,style:e,matchTriggerWidth:n=!1,children:r,...o},i)=>{const s=ce.useRef(null),l=ce.useRef(null),a=ce.useCallback(u=>{s.current=u,typeof i=="function"?i(u):i&&(i.current=u),l.current?.(),l.current=u?IP(u):null},[i]);return LP(s),R.jsx(A0,{ref:a,...o,style:{zIndex:MP,...n?{width:"var(--trigger-width)"}:void 0,...e},className:at(AP(),t),children:r})});Wx.displayName="Popover";const FP=ce.createContext(null),OP=sn(["flex w-full items-center justify-between gap-2 border bg-white text-left","text-light-900 outline-none cursor-pointer","transition-[border-color,box-shadow]","border-light-200 group-data-[open]:border-primary-500","group-data-[focus-visible]:shadow-focus","group-data-[invalid]:border-error-200 group-data-[invalid]:group-data-[open]:border-error-500 group-data-[invalid]:group-data-[focus-visible]:border-error-500","group-data-[disabled]:cursor-not-allowed group-data-[disabled]:bg-light-100 group-data-[disabled]:text-light-400"],{variants:{size:{xs:"h-7 rounded px-3 text-caption-sm",sm:"h-9 rounded-lg px-3 text-caption-lg",md:"h-11 rounded-lg px-3 text-body-sm"}},defaultVariants:{size:"md"}}),KP="flex size-4 shrink-0 items-center justify-center text-light-500",NP={xs:18,sm:20,md:24},RP=sn("min-w-0 flex-1 truncate",{variants:{placeholder:{true:"text-light-400",false:"font-medium text-light-800"}},defaultVariants:{placeholder:!1}}),BP=sn("shrink-0 text-light-500 transition-transform",{variants:{open:{true:"rotate-180",false:""}},defaultVariants:{open:!1}});function zP({isOpen:t,onClose:e}){const n=ce.useRef(t);return ce.useEffect(()=>{n.current&&!t&&e(),n.current=t},[t,e]),null}function VP({className:t,style:e,children:n,...r},o){const[i,s]=ce.useState(""),l=ce.useMemo(()=>({query:i,setQuery:s}),[i]);return R.jsx(i4,{ref:o,...r,style:e,className:at("group w-full",t),children:a=>R.jsxs(FP.Provider,{value:l,children:[R.jsx(zP,{isOpen:a.isOpen,onClose:()=>s("")}),typeof n=="function"?n(a):n]})})}const UP=ce.forwardRef(VP),Jx=ce.forwardRef(({className:t,style:e,size:n="md",icon:r,children:o,...i},s)=>R.jsx(To,{ref:s,...i,style:e,className:at(OP({size:n}),t),children:l=>R.jsxs(R.Fragment,{children:[r&&R.jsx("span",{className:KP,children:r}),typeof o=="function"?o(l):o,R.jsx(v4,{size:NP[n],"aria-hidden":"true",className:BP({open:l.isPressed})})]})}));Jx.displayName="SelectTrigger";function HP({className:t,style:e,...n},r){return R.jsx(a4,{ref:r,...n,style:e,className:o=>at(RP({placeholder:o.isPlaceholder}),t)})}const jP=ce.forwardRef(HP),GP="flex w-full flex-col gap-1",qP=sn("flex items-center gap-1 text-sm font-bold",{variants:{invalid:{true:"text-error-500",false:"text-light-800"}},defaultVariants:{invalid:!1}}),YP="text-caption-lg text-light-700",ZP=sn(["w-full overflow-hidden rounded-lg border bg-white","transition-[border-color,border-width,background-color]","data-[disabled]:cursor-not-allowed data-[disabled]:bg-light-100","data-[invalid]:border-error-200 data-[focus-within]:data-[invalid]:border-2 data-[focus-within]:data-[invalid]:border-error-500"],{variants:{invalid:{true:"",false:"border-light-200 data-[focus-within]:border-2 data-[focus-within]:border-primary-500"}},defaultVariants:{invalid:!1}}),XP=["flex min-h-11 w-full items-center gap-1 overflow-x-auto border-b border-light-200","bg-light-50 px-2 py-2"].join(" "),wd="flex shrink-0 items-center gap-1",kd="mx-1 h-5 w-px shrink-0 bg-light-200 forced-colors:bg-[ButtonText]",Qn=["inline-flex size-[28px] shrink-0 items-center justify-center rounded-md border border-transparent","bg-transparent text-light-700 outline-none transition-[color,background-color,border-color,box-shadow]","hover:bg-light-100 hover:text-light-900","data-[selected]:border-primary-200 data-[selected]:bg-primary-100 data-[selected]:text-primary-800","data-[focus-visible]:ring-2 data-[focus-visible]:ring-primary-400 data-[focus-visible]:ring-offset-1","data-[disabled]:cursor-not-allowed data-[disabled]:text-light-400 data-[disabled]:opacity-60"].join(" "),QP=["relative bg-transparent","data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-light-100"].join(" "),WP=["min-h-[132px] px-3 py-3 text-caption-lg leading-6 text-light-900 outline-none","selection:bg-primary-100 selection:text-primary-900","data-[disabled=true]:cursor-not-allowed data-[disabled=true]:text-light-400","[&_p]:my-2 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0","[&_h2]:my-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:leading-tight","[&_h3]:my-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:leading-tight","[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-6","[&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-6","[&_li]:my-0.5","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-light-300 [&_blockquote]:pl-3 [&_blockquote]:text-light-700","[&_a]:text-primary-600 [&_a]:underline","[&_s]:text-light-600"].join(" "),JP="pointer-events-none absolute left-3 top-3 text-caption-lg leading-6 text-light-500",e3="flex min-h-5 items-start justify-between gap-3",t3=sn("text-caption-lg",{variants:{invalid:{true:"text-error-500",false:"text-light-700"}},defaultVariants:{invalid:!1}}),n3=sn("ml-auto shrink-0 text-caption-lg",{variants:{invalid:{true:"font-semibold text-error-500",false:"text-light-600"}},defaultVariants:{invalid:!1}}),r3=["history","bold","italic","strikethrough","heading","quote","link","bulletList","orderedList"],Ui=[Nm,Rm,Bm,zm,Vm,Um,Hm,jm,qm,Ym,Gm,Xm],e_="cekat-rich-text-external-value",o3={heading:{h2:"cekat-rich-text-h2",h3:"cekat-rich-text-h3"},link:"cekat-rich-text-link",list:{listitem:"cekat-rich-text-list-item",nested:{listitem:"cekat-rich-text-nested-list-item"},ol:"cekat-rich-text-ordered-list",ul:"cekat-rich-text-unordered-list"},paragraph:"cekat-rich-text-paragraph",quote:"cekat-rich-text-quote"},i3=[{id:"paragraph",label:"Normal text"},{id:"h2",label:"Heading 2"},{id:"h3",label:"Heading 3"},{id:"quote",label:"Quote"}],s3={blockType:"paragraph",canRedo:!1,canUndo:!1,isBold:!1,isBulletList:!1,isItalic:!1,isLink:!1,isOrderedList:!1,isStrikethrough:!1,hasTextSelection:!1,linkUrl:""};function l3(t){return t.read(()=>{const e=z();if(!A(e))return{blockType:"paragraph",isBold:!1,isBulletList:!1,isItalic:!1,isLink:!1,isOrderedList:!1,isStrikethrough:!1,hasTextSelection:!1,linkUrl:""};const r=Pu(e.anchor.getNode(),Rn)?.getListType(),o=e.anchor.getNode(),i=o.getKey()==="root"?o:o.getTopLevelElementOrThrow(),s=Xu(i)?i.getTag():"paragraph",l=Pu(o,wn);return{blockType:Si(i)?"quote":s==="h2"||s==="h3"?s:"paragraph",hasTextSelection:!e.isCollapsed(),isBold:e.hasFormat("bold"),isBulletList:r==="bullet",isItalic:e.hasFormat("italic"),isLink:!!l,isOrderedList:r==="number",isStrikethrough:e.hasFormat("strikethrough"),linkUrl:l?.getURL()??""}})}function na(t){requestAnimationFrame(()=>t.focus())}function a3({features:t,isDisabled:e}){const[n]=Vt(),[r,o]=ce.useState(s3),[i,s]=ce.useState("https://"),l=t.has("bold")||t.has("italic")||t.has("strikethrough")||t.has("link"),a=t.has("heading")||t.has("quote"),u=t.has("bulletList")||t.has("orderedList"),c=i3.filter(p=>p.id==="paragraph"||(p.id==="quote"?t.has("quote"):t.has("heading"))),d=ce.useCallback(p=>{o(y=>({...y,...l3(p)}))},[]);ce.useEffect(()=>xt(n.registerUpdateListener(({editorState:p})=>d(p)),n.registerCommand(Ca,()=>(d(n.getEditorState()),!1),ks),n.registerCommand(Zo,p=>(o(y=>({...y,canUndo:p})),!1),ks),n.registerCommand(Yo,p=>(o(y=>({...y,canRedo:p})),!1),ks)),[n,d]);const f=p=>{n.dispatchCommand(hn,p),na(n)},h=p=>{const y=p==="bullet"?r.isBulletList:r.isOrderedList;n.dispatchCommand(y?jp:p==="bullet"?Up:Hp,void 0),na(n)},g=p=>{n.update(()=>{const y=z();A(y)&&PC(y,()=>p==="paragraph"?Se():p==="quote"?nl():Ci(p))}),na(n)},b=p=>{n.dispatchCommand(Ru,p),na(n)};return R.jsxs(g4,{"aria-label":"Text formatting",className:XP,children:[t.has("history")&&R.jsxs("div",{className:wd,children:[R.jsx(To,{"aria-label":"Undo",isDisabled:e||!r.canUndo,className:Qn,onPress:()=>n.dispatchCommand(qo,void 0),children:R.jsx(m4,{size:16,"aria-hidden":"true"})}),R.jsx(To,{"aria-label":"Redo",isDisabled:e||!r.canRedo,className:Qn,onPress:()=>n.dispatchCommand(Hr,void 0),children:R.jsx(y4,{size:16,"aria-hidden":"true"})})]}),t.has("history")&&(l||a||u)&&R.jsx(Zc,{orientation:"vertical",className:kd}),l&&R.jsxs("div",{className:wd,children:[t.has("bold")&&R.jsx(zi,{"aria-label":"Bold",isDisabled:e,isSelected:r.isBold,className:Qn,onPress:()=>f("bold"),children:R.jsx(b4,{size:16,"aria-hidden":"true"})}),t.has("italic")&&R.jsx(zi,{"aria-label":"Italic",isDisabled:e,isSelected:r.isItalic,className:Qn,onPress:()=>f("italic"),children:R.jsx(x4,{size:16,"aria-hidden":"true"})}),t.has("strikethrough")&&R.jsx(zi,{"aria-label":"Strikethrough",isDisabled:e,isSelected:r.isStrikethrough,className:Qn,onPress:()=>f("strikethrough"),children:R.jsx(E4,{size:16,"aria-hidden":"true"})}),t.has("link")&&R.jsxs(X2,{children:[R.jsx(To,{"aria-label":r.isLink?"Edit link":"Add link",isDisabled:e||!r.hasTextSelection&&!r.isLink,className:at(Qn,r.isLink&&"border-primary-200 bg-primary-100 text-primary-800"),onPress:()=>s(r.linkUrl||"https://"),children:R.jsx(_4,{size:16,"aria-hidden":"true"})}),R.jsx(A0,{placement:"bottom start",className:"w-[280px] rounded-lg border border-light-200 bg-white p-3 shadow-lg outline-none",children:R.jsx(Q2,{"aria-label":r.isLink?"Edit link":"Add link",className:"outline-none",children:({close:p})=>R.jsxs("form",{className:"flex flex-col gap-3",onSubmit:y=>{y.preventDefault();const v=i.trim();v&&(b(v),p())},children:[R.jsxs("label",{className:"flex flex-col gap-1 text-caption-sm font-bold text-light-800",children:["URL",R.jsx("input",{autoFocus:!0,type:"url",required:!0,value:i,onChange:y=>s(y.target.value),className:"h-[34px] rounded-lg border border-light-200 px-3 text-caption-lg text-light-900 outline-none focus:border-2 focus:border-primary-500"})]}),R.jsxs("div",{className:"flex justify-end gap-2",children:[r.isLink&&R.jsx(To,{type:"button",className:"h-8 rounded-lg px-3 text-caption-sm font-semibold text-error-500 outline-none hover:bg-error-50 data-[focus-visible]:ring-2 data-[focus-visible]:ring-primary-400",onPress:()=>{b(null),p()},children:"Remove"}),R.jsx(To,{type:"submit",className:"h-8 rounded-lg bg-primary-500 px-3 text-caption-sm font-semibold text-white outline-none hover:bg-primary-600 data-[focus-visible]:ring-2 data-[focus-visible]:ring-primary-400",children:"Apply"})]})]})})})]})]}),l&&(a||u)&&R.jsx(Zc,{orientation:"vertical",className:kd}),a&&R.jsxs(UP,{"aria-label":"Text style",selectedKey:r.blockType,isDisabled:e,onSelectionChange:p=>g(p),children:[R.jsx(Jx,{size:"xs",className:"ml-1 !w-[132px] shrink-0",children:R.jsx(jP,{children:({selectedText:p})=>p})}),R.jsx(Wx,{placement:"bottom start",matchTriggerWidth:!0,children:R.jsx($P,{items:c,children:p=>R.jsx(EP,{id:p.id,textValue:p.label,children:p.label})})})]}),a&&u&&R.jsx(Zc,{orientation:"vertical",className:kd}),u&&R.jsxs("div",{className:wd,children:[t.has("bulletList")&&R.jsx(zi,{"aria-label":"Bullet list",isDisabled:e,isSelected:r.isBulletList,className:Qn,onPress:()=>h("bullet"),children:R.jsx(C4,{size:16,"aria-hidden":"true"})}),t.has("orderedList")&&R.jsx(zi,{"aria-label":"Numbered list",isDisabled:e,isSelected:r.isOrderedList,className:Qn,onPress:()=>h("number"),children:R.jsx(S4,{size:16,"aria-hidden":"true"})})]})]})}function u3({value:t,onChange:e}){const[n]=Vt(),r=ce.useRef(e),o=ce.useRef(t);return ce.useEffect(()=>{r.current=e},[e]),ce.useEffect(()=>n.registerUpdateListener(({editorState:i,dirtyElements:s,dirtyLeaves:l,tags:a})=>{if(a.has(e_)||s.size===0&&l.size===0)return;const u=i.read(()=>ay(Ui));o.current=u,r.current(u)}),[n]),ce.useEffect(()=>{if(t===o.current)return;n.getEditorState().read(()=>ay(Ui))!==t&&n.update(()=>{we().clear(),ly(t,Ui)},{tag:e_}),o.current=t},[n,t]),null}function c3({isEditable:t}){const[e]=Vt();return ce.useEffect(()=>e.setEditable(t),[e,t]),null}const t_=ce.forwardRef(({value:t,onChange:e,label:n,description:r,hint:o,errorMessage:i,placeholder:s="Write something…",features:l=r3,maxLength:a,isRequired:u=!1,isReadOnly:c=!1,isDisabled:d=!1,isInvalid:f=!1,className:h,editorClassName:g},b)=>{const p=ce.useId(),y=ce.useId(),v=ce.useMemo(()=>new Set(l),[l]),x=a!==void 0&&t.length>=a,_=f||x,C=!d&&!c,T=_?i:o,k=[r?p:null,T?y:null].filter(Boolean).join(" ")||void 0,S=ce.useMemo(()=>({namespace:"CekatRichTextEditor",editable:C,editorState:()=>ly(t,Ui),nodes:[rl,tl,Rn,Nn,wn],onError:w=>{throw w},theme:o3}),[C,t]);return R.jsxs("div",{ref:b,className:at(GP,h),children:[n&&R.jsxs("div",{className:qP({invalid:_}),children:[n,u&&R.jsx("span",{className:"text-error-400",children:"*"})]}),r&&R.jsx("div",{id:p,className:YP,children:r}),R.jsx(yC,{initialConfig:S,children:R.jsxs(pT,{isDisabled:d,isInvalid:_,className:at(ZP({invalid:_}),g),children:[!c&&R.jsx(a3,{features:v,isDisabled:d}),R.jsxs("div",{className:QP,"data-disabled":d||void 0,children:[R.jsx(GE,{contentEditable:R.jsx(CC,{"aria-label":typeof n=="string"?n:"Rich text editor","aria-describedby":k,"aria-invalid":_||void 0,"aria-multiline":"true","aria-readonly":c||void 0,"aria-required":u||void 0,"data-disabled":d||void 0,className:WP}),placeholder:R.jsx("div",{className:JP,"aria-hidden":"true",children:s}),ErrorBoundary:e1}),R.jsx(WC,{}),R.jsx(L1,{}),R.jsx(w1,{}),R.jsx(KE,{transformers:Ui}),R.jsx(u3,{value:t,onChange:e}),R.jsx(c3,{isEditable:C})]})]})}),(T||a!==void 0)&&R.jsxs("div",{className:e3,children:[T&&R.jsx("div",{id:y,className:t3({invalid:_}),children:T}),a!==void 0&&R.jsxs("div",{className:n3({invalid:x}),"aria-live":"polite",children:[t.length,"/",a]})]})]})});t_.displayName="RichTextEditor",ln.RichTextEditor=t_,Object.defineProperty(ln,Symbol.toStringTag,{value:"Module"})}));