@ycodium-ai/plugin-conversation 0.2.3681 → 0.2.3710

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/assets/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- var pz=Object.create;var yp=Object.defineProperty;var fz=Object.getOwnPropertyDescriptor;var mz=Object.getOwnPropertyNames;var gz=Object.getPrototypeOf,hz=Object.prototype.hasOwnProperty;var vz=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var Cp=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},un=(e,t)=>{for(var n in t)yp(e,n,{get:t[n],enumerable:!0})},OS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of mz(t))!hz.call(e,r)&&r!==n&&yp(e,r,{get:()=>t[r],enumerable:!(o=fz(t,r))||o.enumerable});return e};var Hd=(e,t,n)=>(n=e!=null?pz(gz(e)):{},OS(t||!e||!e.__esModule?yp(n,"default",{value:e,enumerable:!0}):n,e)),FS=e=>OS(yp({},"__esModule",{value:!0}),e);var bp={};un(bp,{Activity:()=>Cz,Children:()=>Kh,Component:()=>oa,Fragment:()=>As,Profiler:()=>xz,PureComponent:()=>bz,StrictMode:()=>Sz,Suspense:()=>$h,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>Iz,__COMPILER_RUNTIME:()=>wz,act:()=>Tz,cache:()=>kz,cacheSignal:()=>Pz,captureOwnerStack:()=>Rz,cloneElement:()=>xp,createContext:()=>pt,createElement:()=>Be,createRef:()=>Lz,default:()=>In,forwardRef:()=>wn,isValidElement:()=>qh,lazy:()=>Ez,memo:()=>de,startTransition:()=>Mz,unstable_useCacheRefresh:()=>Az,use:()=>Je,useActionState:()=>Nz,useCallback:()=>M,useContext:()=>Dt,useDebugValue:()=>_z,useDeferredValue:()=>Dz,useEffect:()=>$,useEffectEvent:()=>Vh,useId:()=>pn,useImperativeHandle:()=>Xo,useInsertionEffect:()=>Ud,useLayoutEffect:()=>fe,useMemo:()=>K,useOptimistic:()=>Oz,useReducer:()=>ur,useRef:()=>A,useState:()=>W,useSyncExternalStore:()=>Ao,useTransition:()=>Fz,version:()=>Bz});var zS,In,Cz,Kh,oa,As,xz,bz,Sz,$h,Iz,wz,Tz,kz,Pz,Rz,xp,pt,Be,Lz,wn,qh,Ez,de,Mz,Az,Je,Nz,M,Dt,_z,Dz,$,Vh,pn,Xo,Ud,fe,K,Oz,ur,A,W,Ao,Fz,Bz,V=vz(()=>{zS=window.__ycodiumPluginHost.react,In=zS,{Activity:Cz,Children:Kh,Component:oa,Fragment:As,Profiler:xz,PureComponent:bz,StrictMode:Sz,Suspense:$h,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:Iz,__COMPILER_RUNTIME:wz,act:Tz,cache:kz,cacheSignal:Pz,captureOwnerStack:Rz,cloneElement:xp,createContext:pt,createElement:Be,createRef:Lz,forwardRef:wn,isValidElement:qh,lazy:Ez,memo:de,startTransition:Mz,unstable_useCacheRefresh:Az,use:Je,useActionState:Nz,useCallback:M,useContext:Dt,useDebugValue:_z,useDeferredValue:Dz,useEffect:$,useEffectEvent:Vh,useId:pn,useImperativeHandle:Xo,useInsertionEffect:Ud,useLayoutEffect:fe,useMemo:K,useOptimistic:Oz,useReducer:ur,useRef:A,useState:W,useSyncExternalStore:Ao,useTransition:Fz,version:Bz}=zS});var Ak=Cp(no=>{"use strict";var a3=(V(),FS(bp));function Mk(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function as(){}var to={d:{f:as,r:function(){throw Error(Mk(522))},D:as,C:as,L:as,m:as,X:as,S:as,M:as},p:0,findDOMNode:null},s3=Symbol.for("react.portal");function i3(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s3,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}var Wc=a3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function zf(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}no.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=to;no.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Mk(299));return i3(e,t,null,n)};no.flushSync=function(e){var t=Wc.T,n=to.p;try{if(Wc.T=null,to.p=2,e)return e()}finally{Wc.T=t,to.p=n,to.d.f()}};no.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,to.d.C(e,t))};no.prefetchDNS=function(e){typeof e=="string"&&to.d.D(e)};no.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,o=zf(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?to.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:o,integrity:r,fetchPriority:a}):n==="script"&&to.d.X(e,{crossOrigin:o,integrity:r,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};no.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=zf(t.as,t.crossOrigin);to.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&to.d.M(e)};no.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,o=zf(n,t.crossOrigin);to.d.L(e,n,{crossOrigin:o,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};no.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=zf(t.as,t.crossOrigin);to.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else to.d.m(e)};no.requestFormReset=function(e){to.d.r(e)};no.unstable_batchedUpdates=function(e,t){return e(t)};no.useFormState=function(e,t,n){return Wc.H.useFormState(e,t,n)};no.useFormStatus=function(){return Wc.H.useHostTransitionStatus()};no.version="19.2.6"});var Gc=Cp((Fge,_k)=>{"use strict";function Nk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nk)}catch(e){console.error(e)}}Nk(),_k.exports=Ak()});var r1=Cp(o1=>{"use strict";var Id=(V(),FS(bp));function R8(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var L8=typeof Object.is=="function"?Object.is:R8,E8=Id.useState,M8=Id.useEffect,A8=Id.useLayoutEffect,N8=Id.useDebugValue;function _8(e,t){var n=t(),o=E8({inst:{value:n,getSnapshot:t}}),r=o[0].inst,a=o[1];return A8(function(){r.value=n,r.getSnapshot=t,vb(r)&&a({inst:r})},[e,n,t]),M8(function(){return vb(r)&&a({inst:r}),e(function(){vb(r)&&a({inst:r})})},[e]),N8(n),n}function vb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!L8(e,n)}catch{return!0}}function D8(e,t){return t()}var O8=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?D8:_8;o1.useSyncExternalStore=Id.useSyncExternalStore!==void 0?Id.useSyncExternalStore:O8});var s1=Cp((xRe,a1)=>{"use strict";a1.exports=r1()});var BS=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
1
+ var pz=Object.create;var yp=Object.defineProperty;var fz=Object.getOwnPropertyDescriptor;var mz=Object.getOwnPropertyNames;var gz=Object.getPrototypeOf,hz=Object.prototype.hasOwnProperty;var vz=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var Cp=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},un=(e,t)=>{for(var n in t)yp(e,n,{get:t[n],enumerable:!0})},OS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of mz(t))!hz.call(e,r)&&r!==n&&yp(e,r,{get:()=>t[r],enumerable:!(o=fz(t,r))||o.enumerable});return e};var Hd=(e,t,n)=>(n=e!=null?pz(gz(e)):{},OS(t||!e||!e.__esModule?yp(n,"default",{value:e,enumerable:!0}):n,e)),FS=e=>OS(yp({},"__esModule",{value:!0}),e);var bp={};un(bp,{Activity:()=>Cz,Children:()=>Kh,Component:()=>oa,Fragment:()=>As,Profiler:()=>xz,PureComponent:()=>bz,StrictMode:()=>Sz,Suspense:()=>$h,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>Iz,__COMPILER_RUNTIME:()=>wz,act:()=>Tz,cache:()=>kz,cacheSignal:()=>Pz,captureOwnerStack:()=>Rz,cloneElement:()=>xp,createContext:()=>pt,createElement:()=>Be,createRef:()=>Lz,default:()=>In,forwardRef:()=>wn,isValidElement:()=>qh,lazy:()=>Ez,memo:()=>de,startTransition:()=>Mz,unstable_useCacheRefresh:()=>Az,use:()=>Je,useActionState:()=>Nz,useCallback:()=>M,useContext:()=>Dt,useDebugValue:()=>_z,useDeferredValue:()=>Dz,useEffect:()=>$,useEffectEvent:()=>Vh,useId:()=>pn,useImperativeHandle:()=>Xo,useInsertionEffect:()=>Ud,useLayoutEffect:()=>fe,useMemo:()=>K,useOptimistic:()=>Oz,useReducer:()=>ur,useRef:()=>A,useState:()=>W,useSyncExternalStore:()=>Ao,useTransition:()=>Fz,version:()=>Bz});var zS,In,Cz,Kh,oa,As,xz,bz,Sz,$h,Iz,wz,Tz,kz,Pz,Rz,xp,pt,Be,Lz,wn,qh,Ez,de,Mz,Az,Je,Nz,M,Dt,_z,Dz,$,Vh,pn,Xo,Ud,fe,K,Oz,ur,A,W,Ao,Fz,Bz,V=vz(()=>{zS=window.__ycodiumPluginHost.react,In=zS,{Activity:Cz,Children:Kh,Component:oa,Fragment:As,Profiler:xz,PureComponent:bz,StrictMode:Sz,Suspense:$h,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:Iz,__COMPILER_RUNTIME:wz,act:Tz,cache:kz,cacheSignal:Pz,captureOwnerStack:Rz,cloneElement:xp,createContext:pt,createElement:Be,createRef:Lz,forwardRef:wn,isValidElement:qh,lazy:Ez,memo:de,startTransition:Mz,unstable_useCacheRefresh:Az,use:Je,useActionState:Nz,useCallback:M,useContext:Dt,useDebugValue:_z,useDeferredValue:Dz,useEffect:$,useEffectEvent:Vh,useId:pn,useImperativeHandle:Xo,useInsertionEffect:Ud,useLayoutEffect:fe,useMemo:K,useOptimistic:Oz,useReducer:ur,useRef:A,useState:W,useSyncExternalStore:Ao,useTransition:Fz,version:Bz}=zS});var Ak=Cp(no=>{"use strict";var a3=(V(),FS(bp));function Mk(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function as(){}var to={d:{f:as,r:function(){throw Error(Mk(522))},D:as,C:as,L:as,m:as,X:as,S:as,M:as},p:0,findDOMNode:null},s3=Symbol.for("react.portal");function i3(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s3,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}var Wc=a3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function zf(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}no.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=to;no.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Mk(299));return i3(e,t,null,n)};no.flushSync=function(e){var t=Wc.T,n=to.p;try{if(Wc.T=null,to.p=2,e)return e()}finally{Wc.T=t,to.p=n,to.d.f()}};no.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,to.d.C(e,t))};no.prefetchDNS=function(e){typeof e=="string"&&to.d.D(e)};no.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,o=zf(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?to.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:o,integrity:r,fetchPriority:a}):n==="script"&&to.d.X(e,{crossOrigin:o,integrity:r,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};no.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=zf(t.as,t.crossOrigin);to.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&to.d.M(e)};no.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,o=zf(n,t.crossOrigin);to.d.L(e,n,{crossOrigin:o,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};no.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=zf(t.as,t.crossOrigin);to.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else to.d.m(e)};no.requestFormReset=function(e){to.d.r(e)};no.unstable_batchedUpdates=function(e,t){return e(t)};no.useFormState=function(e,t,n){return Wc.H.useFormState(e,t,n)};no.useFormStatus=function(){return Wc.H.useHostTransitionStatus()};no.version="19.2.6"});var Gc=Cp((zge,_k)=>{"use strict";function Nk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nk)}catch(e){console.error(e)}}Nk(),_k.exports=Ak()});var r1=Cp(o1=>{"use strict";var Id=(V(),FS(bp));function R8(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var L8=typeof Object.is=="function"?Object.is:R8,E8=Id.useState,M8=Id.useEffect,A8=Id.useLayoutEffect,N8=Id.useDebugValue;function _8(e,t){var n=t(),o=E8({inst:{value:n,getSnapshot:t}}),r=o[0].inst,a=o[1];return A8(function(){r.value=n,r.getSnapshot=t,vb(r)&&a({inst:r})},[e,n,t]),M8(function(){return vb(r)&&a({inst:r}),e(function(){vb(r)&&a({inst:r})})},[e]),N8(n),n}function vb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!L8(e,n)}catch{return!0}}function D8(e,t){return t()}var O8=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?D8:_8;o1.useSyncExternalStore=Id.useSyncExternalStore!==void 0?Id.useSyncExternalStore:O8});var s1=Cp((SRe,a1)=>{"use strict";a1.exports=r1()});var BS=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
2
  @layer properties, theme, base, components, utilities;
3
3
  @layer properties;
4
4
  :root, :host {
@@ -3749,10 +3749,10 @@ var pz=Object.create;var yp=Object.defineProperty;var fz=Object.getOwnPropertyDe
3749
3749
  }
3750
3750
  }
3751
3751
  }
3752
- `;V();V();var HS=pt(null),Xi=HS.Provider,US=pt(""),Sp=US.Provider;function Ip(){return Dt(US)}function Tn(){let e=Dt(HS);if(e===null)throw new Error("Conversation UI has not been registered.");return e}var wp="ycodium:assistant-quote-open",Ji="ycodium:thread-reference-open";var Tp="conversation",Wh="conversation.prompt-preview";var kp="__ycodiumConversationBridge",Gh="ycodium.conversation.rebindable-bridge.v1",jh="conversation.pendingRequests";var Kd=18,KS=`ycodium.conversation.host-data.v${Kd}`,$S=80,ra="\uFFFC";V();function qS(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=qS(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function VS(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=qS(e))&&(o&&(o+=" "),o+=t);return o}var WS=VS;var zz=(e,t)=>{let n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},Hz=(e,t)=>({classGroupId:e,validator:t}),eI=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n});var GS=[],Uz="arbitrary..",Kz=e=>{let t=qz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return $z(s);let i=s.split("-"),l=i[0]===""&&i.length>1?1:0;return tI(i,l,t)},getConflictingClassGroupIds:(s,i)=>{if(i){let l=o[s],d=n[s];return l?d?zz(d,l):l:d||GS}return n[s]||GS}}},tI=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let d=tI(e,t+1,a);if(d)return d}let s=n.validators;if(s===null)return;let i=t===0?e.join("-"):e.slice(t).join("-"),l=s.length;for(let d=0;d<l;d++){let u=s[d];if(u.validator(i))return u.classGroupId}},$z=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?Uz+o:void 0})(),qz=e=>{let{theme:t,classGroups:n}=e;return Vz(n,t)},Vz=(e,t)=>{let n=eI();for(let o in e){let r=e[o];Xh(r,n,o,t)}return n},Xh=(e,t,n,o)=>{let r=e.length;for(let a=0;a<r;a++){let s=e[a];Wz(s,t,n,o)}},Wz=(e,t,n,o)=>{if(typeof e=="string"){Gz(e,t,n);return}if(typeof e=="function"){jz(e,t,n,o);return}Qz(e,t,n,o)},Gz=(e,t,n)=>{let o=e===""?t:nI(t,e);o.classGroupId=n},jz=(e,t,n,o)=>{if(Yz(e)){Xh(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Hz(n,e))},Qz=(e,t,n,o)=>{let r=Object.entries(e),a=r.length;for(let s=0;s<a;s++){let[i,l]=r[s];Xh(l,nI(t,i),n,o)}},nI=(e,t)=>{let n=e,o=t.split("-"),r=o.length;for(let a=0;a<r;a++){let s=o[a],i=n.nextPart.get(s);i||(i=eI(),n.nextPart.set(s,i)),n=i}return n},Yz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Xz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null),r=(a,s)=>{n[a]=s,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=o[a])!==void 0)return r(a,s),s},set(a,s){a in n?n[a]=s:r(a,s)}}};var Jz=[],jS=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),Zz=e=>{let{prefix:t,experimentalParseClassName:n}=e,o=r=>{let a=[],s=0,i=0,l=0,d,u=r.length;for(let h=0;h<u;h++){let v=r[h];if(s===0&&i===0){if(v===":"){a.push(r.slice(l,h)),l=h+1;continue}if(v==="/"){d=h;continue}}v==="["?s++:v==="]"?s--:v==="("?i++:v===")"&&i--}let p=a.length===0?r:r.slice(l),f=p,m=!1;p.endsWith("!")?(f=p.slice(0,-1),m=!0):p.startsWith("!")&&(f=p.slice(1),m=!0);let g=d&&d>l?d-l:void 0;return jS(a,m,f,g)};if(t){let r=t+":",a=o;o=s=>s.startsWith(r)?a(s.slice(r.length)):jS(Jz,!1,s,void 0,!0)}if(n){let r=o;o=a=>n({className:a,parseClassName:r})}return o},eH=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{let o=[],r=[];for(let a=0;a<n.length;a++){let s=n[a],i=s[0]==="[",l=t.has(s);i||l?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(s)):r.push(s)}return r.length>0&&(r.sort(),o.push(...r)),o}},tH=e=>({cache:Xz(e.cacheSize),parseClassName:Zz(e),sortModifiers:eH(e),postfixLookupClassGroupIds:nH(e),...Kz(e)}),nH=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let o=0;o<n.length;o++)t[n[o]]=!0;return t},oH=/\s+/,rH=(e,t)=>{let{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a,postfixLookupClassGroupIds:s}=t,i=[],l=e.trim().split(oH),d="";for(let u=l.length-1;u>=0;u-=1){let p=l[u],{isExternal:f,modifiers:m,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:v}=n(p);if(f){d=p+(d.length>0?" "+d:d);continue}let C=!!v,y;if(C){let k=h.substring(0,v);y=o(k);let P=y&&s[y]?o(h):void 0;P&&P!==y&&(y=P,C=!1)}else y=o(h);if(!y){if(!C){d=p+(d.length>0?" "+d:d);continue}if(y=o(h),!y){d=p+(d.length>0?" "+d:d);continue}C=!1}let x=m.length===0?"":m.length===1?m[0]:a(m).join(":"),w=g?x+"!":x,I=w+y;if(i.indexOf(I)>-1)continue;i.push(I);let S=r(y,C);for(let k=0;k<S.length;++k){let P=S[k];i.push(w+P)}d=p+(d.length>0?" "+d:d)}return d},aH=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=oI(n))&&(r&&(r+=" "),r+=o);return r},oI=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=oI(e[o]))&&(n&&(n+=" "),n+=t);return n},QS=(e,...t)=>{let n,o,r,a,s=l=>{let d=t.reduce((u,p)=>p(u),e());return n=tH(d),o=n.cache.get,r=n.cache.set,a=i,i(l)},i=l=>{let d=o(l);if(d)return d;let u=rH(l,n);return r(l,u),u};return a=s,(...l)=>a(aH(...l))},sH=[],vn=e=>{let t=n=>n[e]||sH;return t.isThemeGetter=!0,t},rI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dH=/\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$/,cH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ua=e=>iH.test(e),Ct=e=>!!e&&!Number.isNaN(Number(e)),Dr=e=>!!e&&Number.isInteger(Number(e)),Qh=e=>e.endsWith("%")&&Ct(e.slice(0,-1)),aa=e=>lH.test(e),sI=()=>!0,fH=e=>dH.test(e)&&!cH.test(e),Jh=()=>!1,mH=e=>uH.test(e),gH=e=>pH.test(e),hH=e=>!ze(e)&&!He(e),vH=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),yH=e=>Ka(e,dI,Jh),ze=e=>rI.test(e),Ns=e=>Ka(e,cI,fH),YS=e=>Ka(e,kH,Ct),CH=e=>Ka(e,pI,sI),xH=e=>Ka(e,uI,Jh),XS=e=>Ka(e,iI,Jh),bH=e=>Ka(e,lI,gH),Pp=e=>Ka(e,fI,mH),He=e=>aI.test(e),$d=e=>_s(e,cI),SH=e=>_s(e,uI),JS=e=>_s(e,iI),IH=e=>_s(e,dI),wH=e=>_s(e,lI),Rp=e=>_s(e,fI,!0),TH=e=>_s(e,pI,!0),Ka=(e,t,n)=>{let o=rI.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},_s=(e,t,n=!1)=>{let o=aI.exec(e);return o?o[1]?t(o[1]):n:!1},iI=e=>e==="position"||e==="percentage",lI=e=>e==="image"||e==="url",dI=e=>e==="length"||e==="size"||e==="bg-size",cI=e=>e==="length",kH=e=>e==="number",uI=e=>e==="family-name",pI=e=>e==="number"||e==="weight",fI=e=>e==="shadow";var ZS=()=>{let e=vn("color"),t=vn("font"),n=vn("text"),o=vn("font-weight"),r=vn("tracking"),a=vn("leading"),s=vn("breakpoint"),i=vn("container"),l=vn("spacing"),d=vn("radius"),u=vn("shadow"),p=vn("inset-shadow"),f=vn("text-shadow"),m=vn("drop-shadow"),g=vn("blur"),h=vn("perspective"),v=vn("aspect"),C=vn("ease"),y=vn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...w(),He,ze],S=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],P=()=>[He,ze,l],T=()=>[Ua,"full","auto",...P()],R=()=>[Dr,"none","subgrid",He,ze],E=()=>["auto",{span:["full",Dr,He,ze]},Dr,He,ze],D=()=>[Dr,"auto",He,ze],L=()=>["auto","min","max","fr",He,ze],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...P()],_=()=>[Ua,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],j=()=>[Ua,"screen","full","dvw","lvw","svw","min","max","fit",...P()],N=()=>[Ua,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],z=()=>[e,He,ze],re=()=>[...w(),JS,XS,{position:[He,ze]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",IH,yH,{size:[He,ze]}],q=()=>[Qh,$d,Ns],J=()=>["","none","full",d,He,ze],X=()=>["",Ct,$d,Ns],se=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[Ct,Qh,JS,XS],ne=()=>["","none",g,He,ze],ke=()=>["none",Ct,He,ze],xe=()=>["none",Ct,He,ze],be=()=>[Ct,He,ze],le=()=>[Ua,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[aa],breakpoint:[aa],color:[sI],container:[aa],"drop-shadow":[aa],ease:["in","out","in-out"],font:[hH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[aa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[aa],shadow:[aa],spacing:["px",Ct],text:[aa],"text-shadow":[aa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ua,ze,He,v]}],container:["container"],"container-type":[{"@container":["","normal","size",He,ze]}],"container-named":[vH],columns:[{columns:[Ct,ze,He,i]}],"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:I()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Dr,"auto",He,ze]}],basis:[{basis:[Ua,"full","auto",i,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ct,Ua,"auto","initial","none",ze]}],grow:[{grow:["",Ct,He,ze]}],shrink:[{shrink:["",Ct,He,ze]}],order:[{order:[Dr,"first","last","none",He,ze]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...N()]}],"min-block-size":[{"min-block":["auto",...N()]}],"max-block-size":[{"max-block":["none",...N()]}],w:[{w:[i,"screen",..._()]}],"min-w":[{"min-w":[i,"screen","none",..._()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",n,$d,Ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,TH,CH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qh,ze]}],"font-family":[{font:[SH,xH,t]}],"font-features":[{"font-features":[ze]}],"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:[r,He,ze]}],"line-clamp":[{"line-clamp":[Ct,"none",He,YS]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",He,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ct,"from-font","auto",He,Ns]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ct,"auto",He,ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[Dr,He,ze]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,ze]}],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",He,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dr,He,ze],radial:["",He,ze],conic:[Dr,He,ze]},wH,bH]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ct,He,ze]}],"outline-w":[{outline:["",Ct,$d,Ns]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,Rp,Pp]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,Rp,Pp]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ct,Ns]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,Rp,Pp]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ct,He,ze]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[Ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[He,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[Ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,ze]}],filter:[{filter:["","none",He,ze]}],blur:[{blur:ne()}],brightness:[{brightness:[Ct,He,ze]}],contrast:[{contrast:[Ct,He,ze]}],"drop-shadow":[{"drop-shadow":["","none",m,Rp,Pp]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ct,He,ze]}],"hue-rotate":[{"hue-rotate":[Ct,He,ze]}],invert:[{invert:["",Ct,He,ze]}],saturate:[{saturate:[Ct,He,ze]}],sepia:[{sepia:["",Ct,He,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",He,ze]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[Ct,He,ze]}],"backdrop-contrast":[{"backdrop-contrast":[Ct,He,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ct,He,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ct,He,ze]}],"backdrop-invert":[{"backdrop-invert":["",Ct,He,ze]}],"backdrop-opacity":[{"backdrop-opacity":[Ct,He,ze]}],"backdrop-saturate":[{"backdrop-saturate":[Ct,He,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",Ct,He,ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ct,"initial",He,ze]}],ease:[{ease:["linear","initial",C,He,ze]}],delay:[{delay:[Ct,He,ze]}],animate:[{animate:["none",y,He,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,He,ze]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[He,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"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:[Dr,He,ze]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",He,ze]}],"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":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",He,ze]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ct,$d,Ns,YS]}],stroke:[{stroke:["none",...z()]}],"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"]}},PH=(e,{cacheSize:t,prefix:n,experimentalParseClassName:o,extend:r={},override:a={}})=>(Zi(e,"cacheSize",t),Zi(e,"prefix",n),Zi(e,"experimentalParseClassName",o),Lp(e.theme,a.theme),Lp(e.classGroups,a.classGroups),Lp(e.conflictingClassGroups,a.conflictingClassGroups),Lp(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Zi(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Zi(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),Ep(e.theme,r.theme),Ep(e.classGroups,r.classGroups),Ep(e.conflictingClassGroups,r.conflictingClassGroups),Ep(e.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),Yh(e,r,"postfixLookupClassGroups"),Yh(e,r,"orderSensitiveModifiers"),e),Zi=(e,t,n)=>{n!==void 0&&(e[t]=n)},Lp=(e,t)=>{if(t)for(let n in t)Zi(e,n,t[n])},Ep=(e,t)=>{if(t)for(let n in t)Yh(e,t,n)},Yh=(e,t,n)=>{let o=t[n];o!==void 0&&(e[n]=e[n]?e[n].concat(o):o)},mI=(e,...t)=>typeof e=="function"?QS(ZS,e,...t):QS(()=>PH(ZS(),e),...t);var RH=mI({extend:{classGroups:{"font-size":[{text:["chat","chat-row","chat-code","chat-dense","chat-meta","control-1","control-2","control-3","control-4","control-5"]}]}}});function G(...e){return RH(WS(e))}V();var Mp=pt(!0);function gI(){return Je(Mp)}var Zh=pt(void 0);function No(){let e=Je(Mp);return Je(Zh)??e}V();var Ap=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();var hI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var vI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase());var ev=e=>{let t=vI(e);return t.charAt(0).toUpperCase()+t.slice(1)};V();var yI={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"};var CI=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var xI=wn(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:s,...i},l)=>Be("svg",{ref:l,...yI,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Ap("lucide",r),...!a&&!CI(i)&&{"aria-hidden":"true"},...i},[...s.map(([d,u])=>Be(d,u)),...Array.isArray(a)?a:[a]]));var Z=(e,t)=>{let n=wn(({className:o,...r},a)=>Be(xI,{ref:a,iconNode:t,className:Ap(`lucide-${hI(ev(e))}`,`lucide-${e}`,o),...r}));return n.displayName=ev(e),n};var LH=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ds=Z("archive",LH);var EH=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],qd=Z("arrow-down",EH);var MH=[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]],Vd=Z("arrow-up-to-line",MH);var AH=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Wd=Z("arrow-up-right",AH);var NH=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Gd=Z("arrow-up",NH);var _H=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],jd=Z("blocks",_H);var DH=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Qd=Z("book-open",DH);var OH=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],el=Z("bookmark",OH);var FH=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Os=Z("bot",FH);var BH=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zn=Z("check",BH);var zH=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qt=Z("chevron-down",zH);var HH=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Fs=Z("chevron-left",HH);var UH=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yn=Z("chevron-right",UH);var KH=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Yd=Z("chevrons-left",KH);var $H=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Xd=Z("chevrons-right",$H);var qH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Jt=Z("circle-alert",qH);var VH=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Jd=Z("clock",VH);var WH=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bs=Z("copy",WH);var GH=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],co=Z("ellipsis",GH);var jH=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Zd=Z("eye-off",jH);var QH=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ec=Z("eye",QH);var YH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],tc=Z("file-code",YH);var XH=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],pr=Z("file-headphone",XH);var JH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],$a=Z("file-play",JH);var ZH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],nc=Z("file-text",ZH);var eU=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],oc=Z("file-type",eU);var tU=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],rc=Z("file",tU);var nU=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],qa=Z("folder",nU);var oU=[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]],ac=Z("frame",oU);var rU=[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]],sc=Z("git-branch-plus",rU);var aU=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],ic=Z("git-branch",aU);var sU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],lc=Z("globe",sU);var iU=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],dc=Z("grip-vertical",iU);var lU=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],cc=Z("hammer",lU);var dU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],uc=Z("image",dU);var cU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],pc=Z("info",cU);var uU=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Va=Z("layers",uU);var pU=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],fc=Z("list-ordered",pU);var fU=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],zs=Z("list-todo",fU);var mU=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],mc=Z("list",mU);var gU=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wa=Z("loader-circle",gU);var hU=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],Ga=Z("lock-open",hU);var vU=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],gc=Z("lock",vU);var yU=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],tl=Z("maximize",yU);var CU=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ja=Z("message-circle-question-mark",CU);var xU=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Hs=Z("message-circle",xU);var bU=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Us=Z("message-square",bU);var SU=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],sa=Z("messages-square",SU);var IU=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],hc=Z("minimize-2",IU);var wU=[["path",{d:"M5 12h14",key:"1ays0h"}]],vc=Z("minus",wU);var TU=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Or=Z("mouse-pointer-click",TU);var kU=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],yc=Z("package",kU);var PU=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],Ks=Z("paintbrush",PU);var RU=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],_o=Z("paperclip",RU);var LU=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Fr=Z("pen-line",LU);var EU=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Cc=Z("pencil-ruler",EU);var MU=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],xc=Z("pencil",MU);var AU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bc=Z("plus",AU);var NU=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],$s=Z("puzzle",NU);var _U=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],qs=Z("rotate-ccw",_U);var DU=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Vs=Z("search",DU);var OU=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Sc=Z("send",OU);var FU=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ic=Z("settings",FU);var BU=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],nl=Z("skip-forward",BU);var zU=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ol=Z("sliders-horizontal",zU);var HU=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Qa=Z("sparkles",HU);var UU=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],uo=Z("square-pen",UU);var KU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],wc=Z("square",KU);var $U=[["path",{d:"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152",key:"19ctli"}],["path",{d:"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099",key:"ptqqvy"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Tc=Z("star-off",$U);var qU=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ws=Z("star",qU);var VU=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Do=Z("terminal",VU);var WU=[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]],ia=Z("text-quote",WU);var GU=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],la=Z("user-round",GU);var jU=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],kc=Z("wrench",jU);var QU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ut=Z("x",QU);var YU=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Gs=Z("zap",YU);V();function Q(){return{t:Tn().i18n.usePluginTranslation()}}V();V();var Ya=pt(null),Pc=pt(null);function rl(e,t){let n=Je(Pc);fe(()=>{if(!(!t||e===null||n===null))return n(e)},[n,t,e])}function Rc(){let e=new Map;return{rows:()=>[...e.keys()],acquire:(t,n)=>{e.set(t,(e.get(t)??0)+1),n();let o=!0;return()=>{if(!o)return;o=!1;let r=e.get(t)??0;r>1?e.set(t,r-1):e.delete(t),n()}}}}var bI=new Set(["Select","AlertDialog","Dialog","Menu","Popover","Tooltip","Combobox"]);function Se(e){let t=bI.has(e),n=o=>{let r=Tn(),a=Ip(),s=No(),i=r.ui[e],l={};if(t){let d=Je(Ya),[u,p]=W(o.defaultOpen===!0),f=typeof o.open=="boolean"?o.open:u;rl(d,s&&f),fe(()=>{s||p(!1)},[s]),l={open:s&&f,onOpenChange:(m,...g)=>{p(m),typeof o.onOpenChange=="function"&&o.onOpenChange(m,...g)}}}return Be(i,{...o,...l,...bI.has(e)&&!s?{open:!1}:{},className:`${a} ${typeof o.className=="string"?o.className:""}`})};return n.displayName=e,n}var coe=Se("useLinkContextMenu"),fr=Se("ProviderInstanceIcon"),SI=Se("UserAvatar"),po=Se("Badge"),uoe=Se("InlineTag"),tv=Se("Meter"),Y=Se("Button"),Np=Se("Label"),Xa=Se("Input"),II=Se("SearchInput"),Ja=Se("EmptyInline"),wI=Se("Textarea"),_p=Se("Switch"),poe=Se("Separator"),nv=Se("Skeleton"),Za=Se("Spinner"),foe=Se("ScrollArea"),moe=Se("Card"),goe=Se("CardAction"),hoe=Se("CardPanel"),voe=Se("CardDescription"),yoe=Se("CardFooter"),Coe=Se("CardHeader"),xoe=Se("CardTitle"),boe=Se("Empty"),Soe=Se("EmptyContent"),Ioe=Se("EmptyDescription"),woe=Se("EmptyHeader"),Toe=Se("EmptyMedia"),koe=Se("EmptyTitle"),Poe=Se("InputGroup"),Roe=Se("InputGroupAddon"),Loe=Se("InputGroupInput"),Eoe=Se("DocumentPanel"),Moe=Se("MasterDetail"),al=Se("Select"),js=Se("SelectItem"),sl=Se("SelectPopup"),Dp=Se("SelectTrigger"),Op=Se("SelectValue"),Lc=Se("Toggle"),TI=Se("ToggleGroup"),il=Se("Dialog"),Aoe=Se("DialogClose"),ll=Se("DialogDescription"),Fp=Se("DialogFooter"),Bp=Se("DialogHeader"),dl=Se("DialogPopup"),kI=Se("DialogPanel"),cl=Se("DialogTitle"),Noe=Se("DialogTrigger"),Kn=Se("Menu"),ul=Se("MenuGroup"),PI=Se("MenuGroupLabel"),$n=Se("MenuItem"),qn=Se("MenuPopup"),mr=Se("MenuRadioGroup"),Oo=Se("MenuRadioItem"),da=Se("MenuSeparator"),Vn=Se("MenuTrigger"),fo=Se("Popover"),mo=Se("PopoverPopup"),go=Se("PopoverTrigger"),RI=Se("Table"),LI=Se("TableBody"),gr=Se("TableCell"),Qs=Se("TableHead"),EI=Se("TableHeader"),es=Se("TableRow"),Ne=Se("Tooltip"),_e=Se("TooltipPopup"),De=Se("TooltipTrigger"),Ec=Se("Alert"),Mc=Se("AlertAction"),zp=Se("AlertDescription"),ov=Se("AlertTitle"),pl=Se("Kbd"),Hp=Se("DecisionCard"),MI=Se("ChoiceList"),Up=Se("Command"),Kp=Se("CommandGroup"),$p=Se("CommandItem"),qp=Se("CommandList"),AI=Se("Combobox"),NI=Se("ComboboxEmpty"),_I=Se("ComboboxInput"),Br=Se("ComboboxItem"),DI=Se("ComboboxListVirtualized"),OI=Se("TooltipProvider"),FI=Se("StyledDiffCodeView"),BI=Se("DevBackdropArt"),eo=Se("Markdown"),zI=Se("DiffView"),HI=Se("MediaPlayer");var{jsx:c,jsxs:b,Fragment:Ce}=window.__ycodiumPluginHost.jsxRuntime;var XU="sr-only @min-[30rem]/composer-first-row:not-sr-only";function KI({mode:e,onModeChange:t}){let{t:n}=Q();return c("div",{className:"flex shrink-0 items-center gap-1",children:b(TI,{className:"shrink-0","data-view-mode-toggle":!0,size:"xs","aria-label":n("trajectory.toggleLabel"),variant:"segmented",value:[e],onValueChange:o=>{let r=o[0];(r==="chat"||r==="trajectory")&&t(r)},children:[c(UI,{value:"chat",label:n("trajectory.toggleChat"),icon:c(Us,{"aria-hidden":!0})}),c(UI,{value:"trajectory",label:n("trajectory.toggleTrajectory"),icon:c(fc,{"aria-hidden":!0})})]})})}function UI({value:e,label:t,icon:n}){return b(Ne,{children:[b(De,{render:c(Lc,{value:e,"aria-label":t}),children:[n,c("span",{className:XU,children:t})]}),c(_e,{side:"top",children:t})]})}function $I({mode:e,visible:t,chat:n,trajectory:o}){return c("div",{className:"relative flex min-h-0 flex-1 flex-col","aria-hidden":t?void 0:!0,inert:t?void 0:!0,"data-chat-view-pane":e,"data-pane-visible":t?"true":"false",children:c(Zh,{value:t,children:e==="chat"?n:o})})}V();function qI(e){if(e.cacheDisjoint!==!0)return null;let t=e.cachedInputTokens,n=e.inputTokens;if(t===void 0||n===void 0)return null;let o=t+n;if(o<=0)return null;if(t>=o)return"100%";let r=t/o*100;for(let a=0;a<=3;a+=1){let s=r.toFixed(a);if(Number.parseFloat(s)<100)return`${s}%`}return"99.9%"}function VI(e){let t,n,o,r=!0,a=!1;for(let s of e)s!==void 0&&(a=!0,s.cacheDisjoint!==!0&&(r=!1),s.outputTokens!==void 0&&(t=(t??0)+s.outputTokens),s.inputTokens!==void 0&&(n=(n??0)+s.inputTokens),s.cachedInputTokens!==void 0&&(o=(o??0)+s.cachedInputTokens));if(!(t===void 0&&n===void 0&&o===void 0))return{...a&&r?{cacheDisjoint:!0}:{},...t!==void 0?{outputTokens:t}:{},...n!==void 0?{inputTokens:n}:{},...o!==void 0?{cachedInputTokens:o}:{}}}V();V();var WI=pt(null);function GI({data:e,target:t,children:n}){let o=M(r=>e.readTurnChanges(t,r),[e,t.environmentId,t.threadId]);return c(WI,{value:e.readTurnChanges?o:null,children:n})}function jI({turnId:e,filePath:t,onClose:n}){let o=Je(WI),r=A(o),a=A(n);a.current=n;let{t:s}=Q(),[i,l]=W(0),[d,u]=W(0),[p,f]=W(null),[m,g]=W("loading");return $(()=>{if(o!==r.current){a.current();return}let h=!0;if(g("loading"),!o){g("ready");return}return o({turnId:e,filePath:t,textOffset:i}).then(v=>{h&&(f(C=>({...v,text:i===0?v.text:(C?.text??"")+v.text})),g("ready"))},()=>{h&&g("failed")}),()=>{h=!1}},[o,e,t,i,d]),c(il,{open:!0,onOpenChange:h=>{h||n()},children:b(dl,{className:"flex max-h-[80vh] w-[min(90vw,60rem)] flex-col gap-3",children:[c(cl,{children:s("turnOverview.recordedChanges")}),c(ll,{children:t}),c("p",{className:"text-xs text-muted-foreground",children:p||m==="ready"?s(p?.machineUpdateRequired?"turnOverview.changesUpgradeMachine":`turnOverview.changesSource.${p?.source??"unavailable"}`):null}),m==="loading"?c("p",{role:"status",children:s("turnOverview.changesLoading")}):null,m==="failed"?c(Y,{onClick:()=>u(h=>h+1),children:s("turnOverview.changesRetry")}):null,p?.text?c("pre",{className:"min-h-0 overflow-auto whitespace-pre-wrap break-all text-xs",tabIndex:0,children:p.text}):null,p?.truncated?c("p",{children:s("turnOverview.changesTruncated")}):null,p?.textWindow?.nextOffset!=null?c(Y,{disabled:m==="loading",onClick:()=>l(p.textWindow.nextOffset),children:s("turnOverview.changesMore")}):null,c(Y,{onClick:n,children:s("turnOverview.changesClose")})]})})}V();V();function Ac(e,t){if(!Number.isFinite(e)||e<0)return t.milliseconds("0");if(e<1e3)return t.milliseconds(String(Math.max(1,Math.round(e))));if(e<1e4){let i=Math.round(e/100)/10;return t.seconds(i>=10?"10":i.toFixed(1))}if(e<6e4)return t.seconds(String(Math.round(e/1e3)));let n=Math.round(e/1e3),o=Math.floor(n/3600),r=Math.floor(n%3600/60),a=n%60,s=[];return o>0&&s.push(t.hours(String(o))),r>0&&s.push(t.minutes(String(r))),a>0&&s.push(t.seconds(String(a))),s.reduce((i,l)=>t.pair(i,l))}function QI(e,t){return!Number.isFinite(e)||e<=0?t.seconds("0"):Ac(e,t)}function ho(){let{t:e}=Q();return K(()=>{let t={milliseconds:n=>e("duration.milliseconds",{value:n}),seconds:n=>e("duration.seconds",{value:n}),minutes:n=>e("duration.minutes",{value:n}),hours:n=>e("duration.hours",{value:n}),pair:(n,o)=>e("duration.pair",{left:n,right:o})};return{units:t,formatDuration:n=>Ac(n,t),formatCountedDuration:n=>QI(n,t)}},[e])}function JU({fact:e,ownerId:t,onLocate:n,turnId:o}){let{t:r}=Q(),{formatDuration:a}=ho(),[s,i]=W(!1),[l,d]=W(null);rl(t,s||l!==null);let u=r(`turnOverview.${e.kind}`,{count:e.value,duration:a(e.value)}),p=e.targets[0];return e.targets.length===1&&p?.filePath===void 0?c(Y,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs",title:r("turnOverview.locate"),onClick:()=>p&&n(p.rowId),disabled:!p,children:u}):b(Ce,{children:[b(fo,{open:s,onOpenChange:i,children:[c(go,{render:c(Y,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs"}),children:u}),b(mo,{className:"flex max-h-72 w-80 flex-col gap-1 overflow-auto p-2",children:[e.partial?c("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:r("turnOverview.loadedFacts")}):null,e.targets.map((f,m)=>b("div",{className:"flex min-w-0 items-center gap-1",children:[f.filePath?c(Y,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start whitespace-normal break-all text-left",title:r("turnOverview.recordedChanges"),onClick:()=>{i(!1),d(f.filePath)},children:f.filePath}):c("span",{className:"min-w-0 flex-1 px-2 text-xs",children:r("turnOverview.step",{index:m+1})}),c(Y,{size:"xs",variant:"outline",onClick:()=>{i(!1),n(f.rowId)},children:r("turnOverview.locate")})]},`${f.rowId}:${f.filePath??m}`))]})]}),l!==null?c(jI,{turnId:o,filePath:l,onClose:()=>d(null)},`${o}:${l}`):null]})}function Vp({summary:e,...t}){let{t:n}=Q();return b("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5 text-muted-foreground","data-turn-facts":e.turnId,children:[e.facts.map(o=>c(JU,{fact:o,turnId:e.turnId,ownerId:`turn:${e.turnId}`,...t},o.kind)),e.facts.some(o=>o.partial)?c(YI,{className:"px-1 text-ui-2xs",detail:n("turnOverview.loadedFacts"),children:n("turnOverview.loaded")}):null]})}function Wp({summary:e}){let{t}=Q();return e.hasCompaction?b(YI,{className:"inline-flex shrink-0 items-center text-muted-foreground",detail:t("turnOverview.compaction"),children:[c(Ds,{className:"size-3","aria-hidden":!0}),c("span",{className:"sr-only",children:t("turnOverview.compaction")})]}):null}function YI({children:e,detail:t,className:n}){return b(Ne,{children:[c(De,{render:c("span",{className:n}),children:e}),c(_e,{children:t})]})}V();var JI=100,ZU=new Map,XI=new Map,Gp=e=>typeof e=="function"?e():e,ZI=(e,t)=>typeof t=="function"?t(e):t;function eK(e,t,n){let o=e.get(t);return o===void 0&&(o={values:new Map,limit:Math.max(1,n)},e.set(t,o)),o}function tK(e,t){let n=XI.get(e);return n===void 0&&(n={values:new Map,limit:Math.max(1,t)},XI.set(e,n)),n}function nK(e,t){if(!(e.values.size<=e.limit)){for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.committed||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}}}function rv(e,t,n){e.values.get(t)===n&&(e.values.delete(t),e.values.set(t,n))}function ew(e,t,n){let o=e.values.get(t);return o===void 0&&(o={value:Gp(n),subscribers:new Set,leases:0,alive:!0,committed:!1},e.values.set(t,o)),o}function Nc(e){queueMicrotask(()=>nK(e))}function xt(e,t,n,o=JI){let r=Math.max(1,o),a=eK(ZU,e,r),s=ew(a,t,n),i=M(p=>s.alive?(a.limit=r,s.committed=!0,rv(a,t,s),s.leases+=1,s.subscribers.add(p),Nc(a),()=>{s.subscribers.delete(p),s.leases=Math.max(0,s.leases-1),Nc(a)}):()=>{},[r,s,a,t]),l=M(()=>s.value,[s]),d=Ao(i,l,l),u=M(p=>{if(!s.alive||a.values.get(t)!==s)return;let f=s.value,m=ZI(f,p);if(!Object.is(m,f)){s.value=m,rv(a,t,s);for(let g of s.subscribers)g();Nc(a)}},[s,a,t]);return[d,u]}function tw(e,t){let n=A(null);(n.current===null||n.current.key!==e)&&(n.current={key:e,value:Gp(t)});let[,o]=ur(a=>a+1,0),r=M(a=>{let s=n.current;if(s===null||s.key!==e)return;let i=ZI(s.value,a);Object.is(i,s.value)||(s.value=i,o())},[e]);return[n.current.value,r]}function ut(e,t,n,o=JI){let r=Math.max(1,o),a=tK(e,r),s=ew(a,t,()=>({current:Gp(n)}));return $(()=>{if(!(!s.alive||a.values.get(t)!==s))return a.limit=r,s.committed=!0,rv(a,t,s),s.leases+=1,Nc(a),()=>{s.leases=Math.max(0,s.leases-1),Nc(a)}},[r,s,a,t]),s.value}function Fo(e,t){let n=A(null);return(n.current===null||n.current.key!==e)&&(n.current={key:e,ref:{current:Gp(t)}}),n.current.ref}V();var av="trajectory-summary-reveal";function nw({inputKey:e,rows:t,groupRows:n,paneVisible:o,resetFilter:r}){let[a,s]=xt("trajectory-turn-disclosure",e,{}),[i,l]=xt("trajectory-routine-disclosure",e,()=>new Set),[d,u]=xt("trajectory-expand-all",e,!1),[p,f]=xt(av,e,null),[m,g]=xt("trajectory-summary-highlight",e,null),h=ut("trajectory-default-open",e,()=>new Set),v=K(()=>n?.(t,d)??null,[n,t,d]),C=K(()=>{let k=new Map,P=new Map;if(v===null)return{rows:t,headers:k,routines:P};let T=v.findLast(D=>D.turnId!==null),R=new Set(v.map(D=>D.id));if(h.current.size>200)for(let D of h.current)R.has(D)||h.current.delete(D);o&&T&&h.current.add(T.id);let E=[];for(let D of v){let L=D.items[0],O=L?.kind==="step"?L.row:L?.rows[0];if(!O)continue;let U=d||(a[D.id]??(D.turnId===null||h.current.has(D.id)||D.summary?.state==="running"));if(k.set(D.id,{group:D,expanded:U}),E.push({...O,id:D.id,kind:"turn-header",turnId:D.turnId,createdAt:D.summary?.startedAt??O.createdAt}),!!U)for(let F of D.items){if(F.kind==="step"){E.push(F.row);continue}let _=i.has(F.id);P.set(F.id,{count:F.rows.length,expanded:_}),E.push({...F.rows[0],id:F.id,kind:"routine-header"}),_&&E.push(...F.rows)}}return{rows:E,headers:k,routines:P}},[v,t,o,h,d,a,i]),y=A(C.headers);y.current=C.headers;let x=M(k=>{u(!1),s(P=>({...P,[k]:!y.current.get(k)?.expanded}))},[u,s]),w=M(k=>l(P=>{let T=new Set(P);return T.has(k)?T.delete(k):T.add(k),T}),[l]),I=M(k=>f(P=>({rowId:k,nonce:(P?.nonce??0)+1})),[f]);fe(()=>{if(!o||p===null)return;r();let k=v?.find(T=>T.id===p.rowId||T.items.some(R=>R.kind==="step"?R.row.id===p.rowId:R.rows.some(E=>E.id===p.rowId)));if(!k||k.id===p.rowId)return;C.headers.get(k.id)?.expanded||s(T=>({...T,[k.id]:!0}));let P=k.items.find(T=>T.kind==="routine"&&T.rows.some(R=>R.id===p.rowId));P&&!i.has(P.id)&&l(T=>new Set([...T,P.id]))},[o,p,r,v,C.headers,i,s,l]);let S=M(k=>{g(k.rowId),f(P=>P===k?null:P)},[g,f]);return{...C,expandAll:d,setExpandAll:u,toggleTurn:x,toggleRoutine:w,locate:I,request:p,completeReveal:S,highlighted:m}}function fl(e){return e<1e3?String(Math.round(e)):e<1e6?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,"")}m`}function ow({rows:e,usageByTurnId:t,onSelect:n,summaries:o,actions:r}){let{t:a}=Q();return e.map(({item:s,ordinal:i})=>{let l=s.attachmentPreview,d=s.isSystemMessage?a("turnNavigator.systemWake"):l===void 0?s.userText:l.count===1?l.name:a("forkRelations.attachmentPreview",l),u=s.turnId===null?void 0:o.get(s.turnId),p=s.turnId===null?void 0:t.get(s.turnId);return b("div",{className:"rounded-md hover:bg-accent/50",children:[b("button",{type:"button","data-turn-navigator-row":s.sectionKey,onClick:()=>n(s),className:"flex w-full cursor-[var(--control-cursor)] items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[c("span",{className:"shrink-0 pt-px font-mono text-ui-2xs text-muted-foreground tabular-nums",children:i}),b("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[b("span",{className:"flex items-start gap-1",children:[c("span",{className:"line-clamp-2 min-w-0 flex-1 font-medium text-chat leading-snug",children:d}),u?c(Wp,{summary:u}):null]}),s.assistantText?c("span",{className:"line-clamp-1 text-ui-xs text-muted-foreground leading-snug",children:s.assistantText}):null,p?.outputTokens!==void 0?c("span",{className:"font-mono text-ui-2xs text-muted-foreground tabular-nums",children:fl(p.outputTokens)}):null]})]}),u&&r?c("div",{className:"pb-1 pl-7 pr-2",children:c(Vp,{summary:u,...r})}):null]},s.sectionKey)})}function oK({context:e,useSummaries:t,...n}){let o=t(e.target),r=K(()=>new Map(o.map(s=>[s.turnId,s])),[o]),[,a]=xt(av,e.threadKey,null);return c(ow,{...n,summaries:r,actions:{onLocate:s=>{a(i=>({rowId:s,nonce:(i?.nonce??0)+1})),n.onClose(),e.openTrajectory()},onOpenFileDiff:e.onOpenFileDiff}})}var rK=new Map;function rw(e){let t=e.summaryContext;return t?.data.useTurnSummaries?c(oK,{...e,context:t,useSummaries:t.data.useTurnSummaries}):c(ow,{...e,summaries:rK})}function aK({totals:e}){let{t}=Q();if(!e)return null;let n=qI(e),o=[e.outputTokens===void 0?null:{label:t("turnNavigator.usageOutput"),value:fl(e.outputTokens)},e.inputTokens===void 0?null:{label:t("turnNavigator.usageInput"),value:fl(e.inputTokens)},e.cachedInputTokens===void 0?null:{label:t("turnNavigator.usageCacheRead"),value:n===null?fl(e.cachedInputTokens):`${fl(e.cachedInputTokens)} (${n})`}].filter(r=>r!==null);return o.length===0?null:b("div",{className:"flex items-baseline gap-2 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-ui-2xs text-muted-foreground uppercase tracking-[0.14em]",children:t("turnNavigator.usage")}),o.map(r=>b("span",{className:"shrink-0 font-mono text-ui-2xs text-muted-foreground tabular-nums",children:[r.label," ",r.value]},r.label))]})}var sK=de(function({getText:t,size:n="xs",variant:o="outline",className:r}){let{t:a}=Q(),s=Tn().writeClipboard,[i,l]=W(!1),d=a("turnNavigator.copyMarkdown");return b(Ne,{children:[c(De,{render:c(Y,{"aria-label":d,disabled:i,onClick:()=>{s(t()).then(()=>{l(!0),window.setTimeout(()=>l(!1),1e3)})},type:"button",size:n,variant:o,className:G("text-muted-foreground hover:text-foreground",r)}),children:i?c(Zn,{className:"size-3 text-primary"}):c(Bs,{className:"size-3"})}),c(_e,{children:c("p",{children:d})})]})});function aw({items:e,totalTurnCount:t,bottomInset:n,usageByTurnId:o,onSelect:r,exportMarkdown:a,onDownload:s,placement:i="float",summaryContext:l}){let{t:d}=Q(),[u,p]=W(!1),f=K(()=>e.map((v,C)=>({item:v,ordinal:C+1})).reverse(),[e]),m=K(()=>VI(f.map(({item:v})=>v.turnId===null?void 0:o.get(v.turnId))),[f,o]);if(e.length===0)return null;let g=t??e.length,h=d("turnNavigator.open",{count:g});return b(fo,{onOpenChange:p,open:u,children:[b(go,{render:c(Y,{"aria-label":h,className:G("gap-1.5 rounded-full px-3",i==="float"&&"absolute right-3 z-40"),"data-testid":"turn-navigator-pill",size:"xs",style:i==="float"?{bottom:n+12}:void 0,title:h,variant:"glass"}),children:[c(mc,{"aria-hidden":!0}),c("span",{className:"font-mono font-semibold tabular-nums",children:g})]}),c(mo,{align:"end",className:"w-80 flex-col",side:"top",children:b("div",{className:"flex max-h-[min(60vh,26rem)] flex-col",children:[b("div",{className:"flex items-center gap-1.5 border-b px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-ui-2xs text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.title")}),c("span",{className:"font-mono text-ui-2xs text-muted-foreground tabular-nums",children:g})]}),c("div",{className:G("min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1"),children:c(rw,{rows:f,usageByTurnId:o,summaryContext:l,onSelect:v=>{p(!1),r(v)},onClose:()=>p(!1)})}),c(aK,{totals:m}),b("div",{className:"flex items-center gap-1 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-ui-2xs text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.export")}),c(sK,{size:"icon-xs",getText:a,variant:"ghost"}),c(Y,{"aria-label":d("turnNavigator.downloadMarkdown"),onClick:()=>s("md"),size:"xs",title:d("turnNavigator.downloadMarkdown"),variant:"ghost",children:c("span",{className:"font-mono",children:".md"})}),c(Y,{"aria-label":d("turnNavigator.downloadJson"),onClick:()=>s("json"),size:"xs",title:d("turnNavigator.downloadJson"),variant:"ghost",children:c("span",{className:"font-mono",children:".json"})})]})]})})]})}V();function _c(e){return e.replace(/\s+/g," ")}function iK(e,t){let n=e.slice(Math.max(0,e.length-t));return/^[\uDC00-\uDFFF]/.test(n)&&(n=n.slice(1)),n}function lK(e,t){let n=e.slice(0,t);return/[\uD800-\uDBFF]$/.test(n)&&(n=n.slice(0,-1)),n}function jp(e){let n=(e instanceof Element?e:e?.parentElement??null)?.closest("[data-assistant-quote-body]")??null;return n?.closest('[data-message-role="assistant"]')?n:null}function sw(e){if(!e||e.isCollapsed||e.rangeCount===0)return null;let t=e.getRangeAt(0),n=jp(t.startContainer);if(n===null||jp(t.endContainer)!==n)return null;let o=n.closest("[data-message-id]")?.dataset.messageId;if(!o)return null;let r=e.toString().trim();if(r.length===0)return null;let a=document.createRange();a.selectNodeContents(n),a.setEnd(t.startContainer,t.startOffset);let s=document.createRange();s.selectNodeContents(n),s.setStart(t.endContainer,t.endOffset);let i=_c(t.toString()),l=i.length>i.trimStart().length?" ":"",d=i.length>i.trimEnd().length?" ":"",u=_c(a.toString()+l),p=_c(d+s.toString()),f=u.length,m=f+i.trim().length,g=t.getClientRects(),h=g[0]??t.getBoundingClientRect(),v=g[g.length-1]??h;return{messageId:o,text:r,start:f,end:m,prefix:iK(u,32),suffix:lK(p,32),anchor:{x:v.right,top:h.top,bottom:v.bottom}}}var Qp="assistant-quote-inserter",Yp="assistant-quote-open-comment";var dK=300;function iw(e){let{data:t,target:n,threadKey:o,surfaceRef:r}=e,{t:a}=Q(),s=ut(Qp,o,null),[,i]=xt(Yp,o,null),[l,d]=W(null),u=A(null);if($(()=>{let h,v=()=>{let S=r.current,k=document.getSelection(),P=k&&k.rangeCount>0?k.getRangeAt(0):null;if(!S||!P||!S.contains(P.commonAncestorContainer)){d(null);return}let T=sw(k);if(T===null){d(null);return}let R=t.assistantQuotes.serialize({version:1,environmentId:n.environmentId,threadId:n.threadId,messageId:T.messageId,text:T.text,start:T.start,end:T.end,prefix:T.prefix,suffix:T.suffix});d({source:R,...T.anchor})},C=S=>{u.current?.contains(S.target)||(clearTimeout(h),h=setTimeout(v,dK))},y=S=>{u.current?.contains(S.target)||(clearTimeout(h),d(null))},x=()=>d(null),w=S=>{S.key==="Escape"&&d(null)},I=()=>{(document.getSelection()?.isCollapsed??!0)&&d(null)};return document.addEventListener("pointerup",C,!0),document.addEventListener("keyup",C,!0),document.addEventListener("pointerdown",y,!0),document.addEventListener("keydown",w,!0),document.addEventListener("selectionchange",I),window.addEventListener("scroll",x,!0),()=>{clearTimeout(h),document.removeEventListener("pointerup",C,!0),document.removeEventListener("keyup",C,!0),document.removeEventListener("pointerdown",y,!0),document.removeEventListener("keydown",w,!0),document.removeEventListener("selectionchange",I),window.removeEventListener("scroll",x,!0)}},[t,r,n.environmentId,n.threadId]),l===null)return null;let p=l.source,f=Math.max(8,Math.min(window.innerWidth-200,l.x-12)),m=l.bottom+6,g=m+40<=window.innerHeight?m:Math.max(8,l.top-40);return c("div",{ref:u,className:"fixed z-50 rounded-control-3 bg-background",style:{left:f,top:g},"data-assistant-quote-toolbar":"",children:b(Y,{size:"sm",variant:"outline",className:"shadow-md",disabled:p===null,title:p===null?a("timeline.quote.tooLong"):void 0,onMouseDown:h=>h.preventDefault(),onClick:()=>{p!==null&&s.current?.(p)===!0&&(i(p),document.getSelection()?.removeAllRanges(),d(null))},children:[c(ia,{"aria-hidden":"true"}),a("timeline.quote.cite")]})})}V();V();function lw(e){let t=e.map(o=>({key:o.key,turnId:o.turnId,firstRowIndex:o.firstRowIndex,endRowIndex:o.firstRowIndex+o.rowIds.length})),n=new Map;for(let o of e)for(let[r,a]of o.rowIds.entries())n.set(a,{turnId:o.turnId,index:o.firstRowIndex+r});return{sections:t,bySectionKey:new Map(t.map(o=>[o.key,o])),byRowId:n}}function Xp({index:e,visibleSectionKeys:t,protectedRowIds:n,selectionRows:o}){let r=t.flatMap(d=>{let u=e.bySectionKey.get(d)?.turnId;return u==null?[]:[u]}),a=n.flatMap(d=>{let u=e.byRowId.get(d)?.turnId;return u==null?[]:[u]}),s=o?e.byRowId.get(o.firstRowId)?.index:void 0,i=o?e.byRowId.get(o.lastRowId)?.index:void 0,l=s===void 0||i===void 0?[]:e.sections.flatMap(d=>d.turnId!==null&&d.endRowIndex>Math.min(s,i)&&d.firstRowIndex<=Math.max(s,i)?[d.turnId]:[]);return{firstTurnId:r[0]??null,lastTurnId:r.at(-1)??null,protectedTurnIds:[...new Set(a)],selectionTurnRange:l.length>0?{firstTurnId:l[0],lastTurnId:l.at(-1)}:null}}function dw(e,t,n,o){if(!o)return n;let r=e.findIndex(a=>t.has(a));return r<0?n:Math.max(n,e.length-r)}V();V();function sv(e,t){for(let n of e.querySelectorAll("[data-timeline-row-id]"))if(n.dataset.timelineRowId===t)return n;return null}function Ys(e,t){let n=0,o=e.length,r=-1;for(;n<o;){let a=Math.floor((n+o)/2),i=e[a].getBoundingClientRect();Math.max(i.bottom,i.top+1)>t?(r=a,o=a):n=a+1}return r}function cK(e){let t=e.getBoundingClientRect().top,n=e.querySelectorAll("[data-timeline-turn-section]"),o=a=>{let s=a.querySelectorAll("[data-timeline-row-id]"),i=Ys(s,t),l=i<0?void 0:s[i],d=l?.dataset.timelineRowId;return!l||d===void 0?null:{rowId:d,offsetPx:Math.round(t-l.getBoundingClientRect().top)}};if(n.length===0)return o(e);let r=Ys(n,t);if(r<0)return null;for(let a=r;a<n.length;a+=1){let s=o(n[a]);if(s)return s}return null}function cw(e,t){let n=0,o=e;for(;o&&o!==t;)n+=o.offsetTop,o=o.offsetParent;return n}var iv=class extends oa{getSnapshotBeforeUpdate(t){return t.inputKey!==this.props.inputKey&&t.onBeforeInputChange(),null}componentDidUpdate(){}componentWillUnmount(){this.props.onBeforeInputChange()}render(){return this.props.children}};function uw({inputKey:e,onBeforeInputChange:t,handleRef:n,onAttach:o,className:r,children:a,onScroll:s,onInteractionRowsChange:i}){let l=A(null),d=A({inputKey:e,store:Rc()});d.current.inputKey!==e&&(d.current={inputKey:e,store:Rc()});let u=A(i);u.current=i;let p=M(m=>{let g=d.current;return g.store.acquire(m,()=>{d.current===g&&u.current?.(g.store.rows())})},[]);fe(()=>{i?.(d.current.store.rows())},[e,i]),Xo(n,()=>({get node(){return l.current},measure:()=>{let m=l.current;return m?{scroll:m.scrollTop,scrollLength:m.clientHeight,contentLength:m.scrollHeight,topOf:g=>{let h=sv(m,g);return h===null?null:cw(h,m)},heightOf:g=>{let h=sv(m,g);return h===null?null:h.offsetHeight},rowAtScroll:()=>cK(m)}:null},scrollToEnd:m=>{let g=l.current;if(g){if(m?.animated){g.scrollTo({top:g.scrollHeight,behavior:"smooth"});return}g.scrollTop=g.scrollHeight-g.clientHeight}},scrollToRow:(m,g)=>{let h=l.current;if(!h)return!1;let v=sv(h,m);return v?(h.scrollTop=Math.max(0,cw(v,h)-(g?.viewOffset??0)),!0):!1},scrollToOffset:m=>{let g=l.current;g&&(g.scrollTop=Math.max(0,m))}}),[]);let f=M(m=>{l.current=m,o(m)},[o]);return c(iv,{inputKey:e,onBeforeInputChange:t,children:c(Pc,{value:p,children:c("div",{ref:f,className:r,style:{position:"relative"},onScroll:s,children:a})})})}function gl(e){if(!e)return!1;let t=e.tagName?.toLowerCase(),n=e.getAttribute?.("contenteditable");if(t==="textarea"||n==="true"||n===""||n==="plaintext-only"||"isContentEditable"in e&&e.isContentEditable===!0)return!0;if(t==="input"){let o=e.getAttribute?.("type")?.toLowerCase()??"text";if(!["button","submit","reset","image","checkbox","radio"].includes(o))return!0}return e.matches?.(":focus-visible")??!1}function ml(e,t){let o=(e?.nodeType===1?e:e?.parentElement)?.closest("[data-timeline-row-id]");return o&&t.contains(o)?o.dataset.timelineRowId??null:null}function Jp(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return null;let n=null,o=null;for(let d=0;d<t.rangeCount;d+=1){let u=t.getRangeAt(d);u.intersectsNode(e)&&(n??=u,o=u)}if(!n||!o)return null;let r=ml(n.startContainer,e),a=ml(o.endContainer,e);if(r&&a)return{firstRowId:r,lastRowId:a};let s=e.querySelectorAll("[data-timeline-row-id]"),i=s[0]?.dataset.timelineRowId,l=s[s.length-1]?.dataset.timelineRowId;return i&&l?{firstRowId:r??i,lastRowId:a??l}:null}function Dc(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return!1;for(let n=0;n<t.rangeCount;n+=1)if(t.getRangeAt(n).intersectsNode(e))return!0;return!1}V();function ts(e){let t=A(e);t.current=e;let n=A(!1),o=A(null),r=A(null),a=A(0),s=M(()=>{a.current+=1,r.current!==null&&cancelAnimationFrame(r.current),r.current=null},[]),i=M(()=>{if(!n.current||!t.current||r.current!==null||o.current===null)return;let u=++a.current;r.current=requestAnimationFrame(p=>{if(u!==a.current||(r.current=null,!n.current||!t.current))return;let f=o.current;o.current=null,f?.(p)})},[]),l=M(u=>{o.current=u,i()},[i]),d=M(()=>{o.current=null,s()},[s]);return fe(()=>(n.current=!0,i(),()=>{n.current=!1,s()}),[e,s,i]),K(()=>({request:l,cancel:d}),[l,d])}function pw({root:e,inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l}){let d=A({inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l});d.current={inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l};let u=ts(n),p=A(null),f=M(()=>{let g=d.current;if(!e||!g.visible||e.clientHeight<=0)return;let h=e.getBoundingClientRect();if(h.height<=0)return;let v=h.top+g.topInset,C=h.bottom-g.bottomInset,y=e.querySelectorAll("[data-timeline-turn-section]"),x=Ys(y,v),w=[];if(x>=0)for(let T=x;T<y.length;T+=1){let R=y[T];if(R.getBoundingClientRect().top>=C)break;R.dataset.timelineTurnSection!==void 0&&w.push(R.dataset.timelineTurnSection)}let I=[...g.interactionRows()],S=e.ownerDocument.activeElement;if(gl(S)){let T=ml(S,e);T&&I.push(T)}let k=Xp({index:g.index,visibleSectionKeys:w,protectedRowIds:I,selectionRows:Jp(e)}),P=`${g.inputKey}:${JSON.stringify(k)}`;P!==p.current&&(p.current=P,g.onRangeChange?.(k))},[e]),m=M(()=>u.request(f),[u,f]);return fe(()=>{if(p.current=null,!n||!e)return;let g=t,h=!0,v=()=>{!h||d.current.inputKey!==g||!d.current.visible||(d.current.onSelectionChange(Dc(e)),m())};e.addEventListener("scroll",v,{passive:!0}),e.addEventListener("focusin",v),e.addEventListener("focusout",v),e.ownerDocument.addEventListener("selectionchange",v);let C=typeof ResizeObserver>"u"?null:new ResizeObserver(v);return C?.observe(e),e.firstElementChild&&C?.observe(e.firstElementChild),v(),()=>{h=!1,u.cancel(),C?.disconnect(),e.removeEventListener("scroll",v),e.removeEventListener("focusin",v),e.removeEventListener("focusout",v),e.ownerDocument.removeEventListener("selectionchange",v),i?.(null)}},[u,t,i,m,e,n]),fe(()=>{n&&m()},[o,m,n]),m}V();var fw=de(function({sectionKey:t,rowKeyPrefix:n,rowIds:o,renderRow:r,sectionRef:a}){return c("div",{className:"session-turn","data-timeline-turn-section":t,ref:a,children:o.map(s=>c("div",{className:"transcript-col min-w-0 overflow-x-clip",children:r(s)},`${n}:${s}`))})});var uK=400;function mw({root:e,minimumCount:t,keepAbovePx:n=0,canCompact:o,onCompact:r}){let a=e.ownerDocument,s=new Set,i,l=!1,d=()=>e.scrollHeight-e.clientHeight-e.scrollTop<=2,u=()=>{if(i=void 0,a.hidden||s.size>0||!o()||e.clientHeight<=0||!d()||Dc(e))return;let w=e.querySelectorAll("[data-timeline-turn-section]"),I=e.getBoundingClientRect().top-32-n,S=0,k=Math.max(0,w.length-t);for(;S<k;){let T=Math.floor((S+k)/2),R=w[T].getBoundingClientRect().bottom;if(!Number.isFinite(R))return;R<=I?S=T+1:k=T}if(S===0)return;let P=a.activeElement;if(P&&gl(P)){for(let T=0;T<S;T+=1)if(w[T].contains(P))return}r(w.length-S)},p=!1,f=()=>{if(a.hidden||s.size>0||!o()||p){clearTimeout(i),i=void 0;return}i===void 0&&(i=setTimeout(u,uK))},m=()=>{clearTimeout(i),i=void 0,f()},g=()=>{let w=d();!w||!l?m():f(),l=w},h=w=>{s.add(w.pointerId),m()},v=w=>{s.delete(w.pointerId),m()},C=()=>{p=Dc(e),m()},y=()=>{s.clear(),m()},x=["wheel","keydown","focusin","focusout"];for(let w of x)e.addEventListener(w,m,{passive:!0});return e.addEventListener("scroll",g,{passive:!0}),e.addEventListener("pointerdown",h,!0),a.addEventListener("pointerup",v,!0),a.addEventListener("pointercancel",v,!0),a.addEventListener("selectionchange",C),a.addEventListener("visibilitychange",f),a.defaultView?.addEventListener("blur",y),f(),{schedule:f,disconnect:()=>{clearTimeout(i);for(let w of x)e.removeEventListener(w,m);e.removeEventListener("scroll",g),e.removeEventListener("pointerdown",h,!0),a.removeEventListener("pointerup",v,!0),a.removeEventListener("pointercancel",v,!0),a.removeEventListener("selectionchange",C),a.removeEventListener("visibilitychange",f),a.defaultView?.removeEventListener("blur",y)}}}V();function gw({root:e,topInsetPx:t,onActiveSectionChange:n,onActiveStartHiddenChange:o,active:r}){let a=A(r);a.current=r;let s=ts(r),i=A(new Map),l=A(null),d=A(null),u=A(n);u.current=n;let p=A(o);p.current=o;let f=A(null),m=A(null),g=M(()=>{if(!a.current||!e)return;let x=e.scrollTop+t,w=null,I=Number.NEGATIVE_INFINITY,S=null,k=Number.POSITIVE_INFINITY;for(let[E,D]of i.current){if(!D.isConnected)continue;let L=D.offsetTop;L<k&&(k=L,S=E),L<=x&&L>=I&&(I=L,w=E)}let P=w??S;P!==d.current&&(d.current=P,u.current(P));let T=P===null?null:i.current.get(P)?.firstElementChild??null,R=T!==null&&T.getBoundingClientRect().bottom<=e.getBoundingClientRect().top+1;R!==f.current&&(f.current=R,p.current?.(R))},[e,t]),h=M(()=>{a.current&&s.request(g)},[s,g]);$(()=>{if(!r||!e||typeof IntersectionObserver>"u")return;let x=!0,w=new IntersectionObserver(()=>{!x||!a.current||h()},{root:e,rootMargin:`-${t}px 0px 0px 0px`,threshold:0});l.current=w;for(let S of i.current.values())w.observe(S);let I=new IntersectionObserver(()=>{!x||!a.current||h()},{root:e,threshold:0});m.current=I;for(let S of i.current.values())S.firstElementChild&&I.observe(S.firstElementChild);return h(),()=>{x=!1,w.disconnect(),l.current=null,I.disconnect(),m.current=null,s.cancel()}},[r,s,h,e,t]);let v=A(new Map),C=M(x=>{let w=v.current.get(x);if(w)return w;let I=S=>{let k=i.current.get(x);k&&k!==S&&(l.current?.unobserve(k),k.firstElementChild&&m.current?.unobserve(k.firstElementChild),i.current.delete(x)),S?(i.current.set(x,S),l.current?.observe(S),S.firstElementChild&&m.current?.observe(S.firstElementChild)):v.current.get(x)===I&&v.current.delete(x)};return v.current.set(x,I),I},[]),y=M(()=>{a.current&&(d.current=null,f.current=null,h())},[h]);return K(()=>({observeSection:C,refresh:y}),[C,y])}function Zp(e,t){return e===t?!0:!e||!t?!1:e.identity===t.identity&&e.instanceId===t.instanceId&&e.driverKind===t.driverKind&&e.providerDisplayName===t.providerDisplayName&&e.accentColor===t.accentColor&&e.modelLabel===t.modelLabel&&e.effortLabel===t.effortLabel&&e.effortLevel===t.effortLevel}function hw(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function vw(e,t){return e.turnId===t.turnId&&e.createdAt===t.createdAt&&Zp(e.badge,t.badge)}function yw(e,t){if(e===t)return!0;if(e.kind!==t.kind||e.id!==t.id)return!1;switch(e.kind){case"turn-identity":return vw(e,t);case"turn-summary":{let n=t;return e.createdAt===n.createdAt&&e.copyText===n.copyText&&e.cardAnchor===n.cardAnchor&&e.footer===n.footer&&(e.identity===void 0?n.identity===void 0:n.identity!==void 0&&vw(e.identity,n.identity))}case"tool-group":{let n=t;return e.createdAt===n.createdAt&&e.groupId===n.groupId&&hw(e.entries,n.entries)}case"working":{let n=t;return e.createdAt===n.createdAt&&e.turnId===n.turnId&&e.compacting===n.compacting&&Zp(e.modelBadge,n.modelBadge)}case"model-switch":{let n=t;return e.createdAt===n.createdAt&&e.pending===n.pending&&Zp(e.badge,n.badge)}case"proposed-plan":return e.proposedPlan===t.proposedPlan;case"turn-plan":{let n=t;return e.createdAt===n.createdAt&&e.turnPlan.plan===n.turnPlan.plan}case"work":{let n=t;return e.isExpandedToolGroupEntry===n.isExpandedToolGroupEntry&&e.isLastExpandedToolGroupEntry===n.isLastExpandedToolGroupEntry&&hw(e.groupedEntries,n.groupedEntries)}case"message":{let n=t;return e.message===n.message&&e.presentation===n.presentation&&e.textTone===n.textTone&&e.durationStart===n.durationStart&&e.showAssistantMeta===n.showAssistantMeta&&e.showAssistantCopyButton===n.showAssistantCopyButton&&e.copyInFooter===n.copyInFooter&&e.assistantCopyStreaming===n.assistantCopyStreaming&&Zp(e.modelBadge,n.modelBadge)}}}function pK(e,t,n){for(let o=t;o<n;o+=1){let r=e[o];switch(r.kind){case"turn-identity":return r.turnId;case"working":if(r.turnId!=null)return r.turnId;break;case"message":if(r.message.role==="assistant")return r.message.turnId;break;case"tool-group":if(r.entries[0]?.turnId!=null)return r.entries[0].turnId;break;case"work":if(r.groupedEntries[0]?.turnId!=null)return r.groupedEntries[0].turnId;break;case"turn-plan":return r.turnPlan.turnId;case"proposed-plan":return r.proposedPlan.turnId;case"turn-summary":return r.footer.turnId}}return null}function Cw(e,t,n=[]){let o=new Map(n.map(a=>[a.key,a])),r=[];for(let a of t){if(a.end<=a.start)continue;let s=pK(e,a.start,a.end),i=o.get(a.key);if(i!==void 0&&i.turnId===s&&fK(i,e,a.start,a.end)){r.push(i);continue}r.push({key:a.key,turnId:s,firstRowIndex:a.start,rowIds:e.slice(a.start,a.end).map(l=>l.id)})}return r}function fK(e,t,n,o){if(e.firstRowIndex!==n||e.rowIds.length!==o-n)return!1;for(let r=0;r<e.rowIds.length;r+=1)if(e.rowIds[r]!==t[n+r].id)return!1;return!0}function xw(e,t){let n=Math.max(0,Math.min(t,e)),o=e-n;return{startIndex:o,hasHiddenOlder:o>0}}function Xs(e,t,n){let o=e.findIndex(r=>r.rowIds.includes(t));return o<0?n:Math.max(n,e.length-o)}function mK(e,t){let n=t.historyWindow,{status:o}=t,r={activities:t.activities,timelineEntries:t.timelineEntries,turnSummaries:t.turnSummaries,latestTurn:n?null:o.latestTurn,runningTurnId:n?null:o.runningTurnId,expandedTurnIds:t.expandedTurnIds,isWorking:!n&&o.isWorking,activeTurnStartedAt:n?null:o.activeTurnStartedAt,resolveModelBadge:t.resolveModelBadge,pendingModelSelection:n?null:o.pendingModelSelection},a=e.deriveGroups(r),s=o.latestTurn;if(n&&s&&s.completedAt!==null){let i=s.turnId;if(a.rows.some(d=>d.kind==="message"?d.message.role==="assistant"&&d.message.turnId===i:d.kind==="work"?d.groupedEntries.some(u=>u.turnId===i):d.kind==="tool-group"&&d.entries.some(u=>u.turnId===i)))return e.deriveGroups({...r,latestTurn:s})}return a}var gK=new Map,hK={markdown:()=>"",download(){}},vK=[],yK={latestTurn:null,latestAssistantMessageId:null,runningTurnId:null,isWorking:!1,workingStepLabel:null,stall:null,retry:null,activeTurnStartedAt:null,totalTurnCount:null,pendingModelSelection:null,scheduledWakes:vK},CK={inputs:null,structure:{rowIds:[],sections:[]},indexById:new Map,rows:[],meta:{status:yK,usageByTurnId:gK,exportApi:hK,finalAssistantMessageReceived:!1},version:0};function xK(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function bK(e,t,n,o){let r=mK(n,e),a=SK(t.structure.rowIds,r.rows),s=a?t.indexById:new Map(r.rows.map((g,h)=>[g.id,h])),i=r.rows.map((g,h)=>{let v=a?t.rows[h]:t.rows[t.indexById.get(g.id)??-1],C=v!==void 0&&yw(v,g)?v:g;return C!==v&&o.add(g.id),C});if(!a)for(let g of t.indexById.keys())s.has(g)||o.add(g);let l=Cw(i,r.turnGroups,t.structure.sections),d=a?t.structure.rowIds:i.map(g=>g.id),u=a&&xK(t.structure.sections,l)?t.structure:{rowIds:d,sections:l},p=e.derive.hasSettledAssistantMessage(e.timelineEntries,e.status.latestAssistantMessageId),f=t.meta.status===e.status&&t.meta.usageByTurnId===e.usageByTurnId&&t.meta.exportApi===e.exportApi&&t.meta.finalAssistantMessageReceived===p?t.meta:{status:e.status,usageByTurnId:e.usageByTurnId,exportApi:e.exportApi,finalAssistantMessageReceived:p},m=o.size>0||u!==t.structure||f!==t.meta;return{inputs:e,structure:u,indexById:s,rows:i,meta:f,version:m?t.version+1:t.version}}function SK(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n].id)return!1;return!0}function hl(e){return e.getStructure().rowIds.some(t=>e.getRow(t)?.kind==="message")}function bw(){let e=null,t=null,n=CK,o=new Set,r=0,a=new Set,s=new Map,i=()=>{if(e===null||n.inputs===e)return n;t??=e.derive.createRowsCache();let l=new Set;n=bK(e,n,t,l);for(let d of l)o.add(d);return n};return{setInputs(l){e=l},hasInputs:()=>e!==null,flush(){if(a.size===0&&s.size===0||e===null)return;let{version:l}=i();if(l===r&&o.size===0)return;r=l;let d=[...o];o.clear();for(let u of d){let p=s.get(u);if(p!==void 0)for(let f of Array.from(p))f()}for(let u of Array.from(a))u()},subscribe(l){return a.add(l),()=>{a.delete(l)}},subscribeRow(l,d){let u=s.get(l);return u===void 0&&(u=new Set,s.set(l,u)),u.add(d),()=>{u.delete(d),u.size===0&&s.get(l)===u&&s.delete(l)}},getStructure:()=>i().structure,getRow(l){let{indexById:d,rows:u}=i(),p=d.get(l);return p===void 0?void 0:u[p]},getRows:()=>i().rows,getMeta:()=>i().meta,getVersion:()=>i().version}}V();function ef(e){return Ao(e.subscribe,e.getStructure,e.getStructure)}function Sw(e,t){let n=M(r=>e.subscribeRow(t,r),[e,t]),o=M(()=>e.getRow(t),[e,t]);return Ao(n,o,o)}function On(e,t,n=Object.is){let o=A(null),r=M(()=>{let a=e.getVersion(),s=o.current;if(s!==null&&s.store===e&&s.select===t&&s.version===a)return s.value;let i=t(e),l=s!==null&&s.store===e&&n(s.value,i)?s.value:i;return o.current={store:e,select:t,version:a,value:l},l},[e,t,n]);return Ao(e.subscribe,r,r)}V();V();function Iw(e,t){return e.getFullYear()!==new Date(t).getFullYear()}function lv(e,t){return{month:e,day:"numeric",...t?{year:"numeric"}:{}}}function ww(e){let t=new Intl.DateTimeFormat(e,lv("numeric",!1)),n=new Intl.DateTimeFormat(e,lv("numeric",!0)),o=(r,a)=>(Iw(r,a)?n:t).format(r);return{ofDate:o,ofIso:(r,a)=>{let s=new Date(r);return Number.isNaN(s.getTime())?"":o(s,a)}}}function Tw(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?null:{date:n,formatParams:{date:lv("short",Iw(n,t))}}}function Pw(e,t){let n={hour:"numeric",minute:"2-digit",...t?{second:"2-digit"}:{}};return e==="locale"?n:{...n,hour12:e==="12-hour"}}function IK(e){let t=e?.trim();if(t)try{return Intl.DateTimeFormat.supportedLocalesOf([t]),t}catch{return}}function wK(){return typeof window>"u"?null:window.desktopBridge?.getSystemLocale?.()??null}var Rw=IK(wK()),kw=new Map;function Lw(e,t){let n=`${e}:${t?"seconds":"minutes"}`,o=kw.get(n);if(o)return o;let r=new Intl.DateTimeFormat(Rw,Pw(e,t));return kw.set(n,r),r}function dv(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function zr(e,t,n){let o=dv(e);return o?n("timeline.timestampTooltip",{date:o,formatParams:{date:{...Pw(t,!1),...t==="locale"?{hourCycle:Lw(t,!1).resolvedOptions().hourCycle}:{},year:"numeric",month:"long",day:"numeric"}}}):""}var Ew=ww(Rw);function ca(e,t,n,o=Date.now()){let r=dv(e);if(!r)return"";let a=Lw(t,!1).format(r),s=new Date(o),i=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),d=Math.round((i-l)/864e5);return d<=0?a:d===1?n("relativeTime.yesterdayAt",{time:a}):`${Ew.ofDate(r,o)} ${a}`}function Mw(e,t=Date.now()){return Ew.ofIso(e,t)}function Aw(e){let t=dv(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:""}V();var bt=pt(null),tf=pt(null);V();var vl=new Map,Nw=24,TK=4e3,kK=1024,_w=16384;function cv(e){let t=vl.get(e);if(t)return t;let n={values:new Map,listeners:new Set,stringLength:0};if(vl.set(e,n),vl.size>Nw){for(let[o,r]of vl)if(r.listeners.size===0&&o!==e&&(vl.delete(o),vl.size<=Nw))break}return n}function uv(e,t,n){return cv(e).values.get(t)??n}function Oc(e,t,n,o=!0){let r=cv(e);if(typeof n=="string"&&(n=n.slice(0,kK)),r.values.get(t)===n)return;let a=r.values.get(t);if(typeof a=="string"&&(r.stringLength-=a.length),r.values.delete(t),r.values.set(t,n),typeof n=="string"&&(r.stringLength+=n.length),r.stringLength>_w){for(let[s,i]of r.values)if(!(typeof i!="string"||s===t)&&(r.values.delete(s),r.stringLength-=i.length,r.stringLength<=_w))break}if(r.values.size>TK){let s=r.values.keys().next().value;if(s!==void 0){let i=r.values.get(s);typeof i=="string"&&(r.stringLength-=i.length),r.values.delete(s)}}o&&r.listeners.forEach(s=>s())}function kn(e,t,n){let o=M(i=>{let l=cv(e);return l.listeners.add(i),()=>l.listeners.delete(i)},[e]),r=M(()=>uv(e,t,n),[e,t,n]),a=Ao(o,r,r),s=M(i=>Oc(e,t,i),[e,t]);return[a,s]}function et(){let e=Tn().i18n.usePluginTranslation();return{t:(t,n)=>e(t,n)}}var Dw=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api"];if(!Dw)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{COMMUNICATION_RECORDS_READ_LIMIT:Eae,HOST_TEAM_VIEW_PREFIX:Mae,MAX_PLUGIN_SESSION_PROJECTION_BYTES:Aae,MAX_PLUGIN_SKILL_COMPANION_FILE_BYTES:Nae,MAX_PLUGIN_SKILL_COMPANION_TOTAL_BYTES:_ae,MAX_PLUGIN_STREAM_BUFFER:Dae,MAX_PLUGIN_TOOL_PRESENTATION_BYTES:Oae,MAX_PLUGIN_WORKSPACE_WRITE_BYTES:Fae,MEMBER_INSTRUCTIONS_MAX_BYTES:Bae,MEMBER_NAME_MAX:zae,MEMBER_RESPONSIBILITY_MAX:Hae,MEMBER_TITLE_MAX:Uae,MIN_PLUGIN_INTERVAL_MS:Kae,PLUGIN_API_MIN_VERSION:$ae,PLUGIN_API_VERSION:qae,PLUGIN_PROXY_DIRECT:Vae,REASONING_OPTION_LABEL:Wae,REQUEST_RESOLVED_TRIGGER_KIND:Gae,TEAM_VIEW_KEY_PATTERN:jae,THREAD_ACTIVITIES_LIST_LIMIT:Qae,THREAD_MESSAGES_LIST_LIMIT:Yae,TOOL_LIFECYCLE_ACTIVITY_KINDS:Xae,TURN_PROGRESS_TRIGGER_KIND:Jae,USER_INPUT_PENDING_TRIGGER_KIND:Zae,acceptPluginToolPresentation:ese,definePlugin:tse,defineTeamView:nse,effortText:Ow,isTeamViewKey:ose,isThreadNotFound:rse,knownEffortLevel:ase,mergeLaunchEnv:sse,modelCatalogNoticeOf:nf,modelOptionLabelKind:Fw,modelSelectionStringOption:ise,nearestEffortLevel:lse,parseRetryAfterMs:dse,pluginJsonByteLength:cse,projectOrNull:use,readRequestResolved:pse,readThreadFailed:fse,readTurnProgress:mse,readUserInputPending:gse,reasoningEffortLevel:Bw,reasoningEffortShortLabel:hse,relabelModelOptionDescriptors:zw,resolveModelChoice:vse,resolveModelOptions:yse,threadMessagesNewestFirst:Cse,threadOrNull:xse}=Dw;var Hw={effort:"traits.savedOption.effort",reasoningEffort:"traits.savedOption.reasoningEffort",variant:"traits.savedOption.variant",fastMode:"traits.savedOption.fastMode",agent:"traits.savedOption.agent",serviceTier:"traits.savedOption.serviceTier"},Uw=e=>`traits.optionValue.${e}`;function PK(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function of(e,t){if(t==="agent")return e("traits.savedOption.agent");let n=Fw(t);return n===void 0?PK(t):e(Hw[n])}function rf(e,t){return zw(t,{kind:n=>e(Hw[n]),level:n=>e(Uw(n)),standardTier:()=>e("traits.standardTier")})}function pv(e,t){return t.effortDisplayKind==="standard-tier"?e("traits.standardTier"):Ow(t,n=>e(Uw(n)))}function Kw(e){return e==="failed"?"failed":e==="running"?"running":"idle"}function $w(e){return e.includes("failed")?"failed":e.includes("running")?"running":"idle"}var af="chat-process-row flex w-full min-w-0 select-none items-center gap-1.5 px-2 text-left";function Fc({children:e}){return c("span",{"aria-hidden":!0,className:"flex size-4 shrink-0 items-center justify-center",children:e})}function Bc({status:e}){return c("span",{"aria-hidden":!0,className:"flex size-2 shrink-0 items-center justify-center",children:e===null?null:c("span",{className:G("block size-2 rounded-full",e==="failed"?"bg-destructive":e==="success"?"bg-success":"border border-muted-foreground/60")})})}function sf({state:e,variant:t="inline",className:n,children:o}){return b("div",{"data-process-state":e,"data-process-kind":t,className:G("chat-process-shell relative min-w-0 overflow-hidden",t==="tool"?"rounded-lg bg-card":"rounded-md",n),children:[e==="running"?c("span",{"aria-hidden":!0,className:"chat-process-shell-pulse animate-status-pulse"}):null,o]})}V();V();var yl=class extends Error{reason;constructor(t,n,o){super(n,o),this.reason=t}};function RK(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.fontSize="16px";let n=document.activeElement;document.body.appendChild(t);try{return t.focus({preventScroll:!0}),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{t.remove();let o=n?.focus;typeof o=="function"&&o.call(n)}}async function LK(e,t){let n=()=>new yl("unavailable",`Clipboard API is unavailable while copying ${t}.`);if(typeof window>"u")throw n();if(!e)return!1;if(typeof navigator>"u"||!navigator.clipboard?.writeText){if(RK(e))return!0;throw n()}try{return await navigator.clipboard.writeText(e),!0}catch(o){throw new yl("write-failed",`Failed to copy ${t} to the clipboard.`,{cause:o})}}function lf({timeout:e=2e3,target:t="text",onCopy:n,onError:o}={}){let[r,a]=W(!1),s=A(null),i=A(n),l=A(o),d=A(t),u=A(e);i.current=n,l.current=o,d.current=t,u.current=e;let p=M((f,m)=>{LK(f,d.current).then(g=>{g&&(s.current&&clearTimeout(s.current),a(!0),i.current?.(m),u.current!==0&&(s.current=setTimeout(()=>{a(!1),s.current=null},u.current)))},g=>{l.current?.(g instanceof Error?g:new Error(String(g)),m)})},[]);return $(()=>()=>{s.current&&clearTimeout(s.current)},[]),{copyToClipboard:p,isCopied:r}}var qw=1e3,EK={unavailable:"copyButton.clipboardUnavailable","write-failed":"copyButton.copyFailedDetail"},ns=de(function({text:t,size:n="xs",variant:o="outline",className:r,toastAnchor:a="above",label:s}){let{t:i}=et(),l=s??i("copyButton.copyToClipboard"),[d,u]=W(!1),[p,f]=W(null),m=A(null),g=(C,y)=>{m.current&&clearTimeout(m.current),f({title:C,description:y}),m.current=setTimeout(()=>{f(null),u(!1)},qw)};$(()=>()=>{m.current&&clearTimeout(m.current)},[]);let{copyToClipboard:h,isCopied:v}=lf({onCopy:()=>g(i("copyButton.copied")),onError:C=>g(i("copyButton.failedToCopy"),C instanceof yl?i(EK[C.reason]):C.message),timeout:qw});return b(Ne,{open:p!==null||d,onOpenChange:u,children:[c(De,{render:c(Y,{"aria-label":l,softDisabled:v,onClick:()=>h(t),type:"button",size:n,variant:o,className:G("text-muted-foreground hover:text-foreground",r)}),children:v?c(Zn,{className:"size-3 text-primary"}):c(Bs,{className:"size-3"})}),b(_e,{side:a==="above"?"top":"bottom",className:"max-w-72",role:p?"status":void 0,children:[c("span",{children:p?.title??l}),p?.description?c("span",{className:"block text-muted-foreground",children:p.description}):null]})]})});function df({text:e,label:t,children:n}){return b("span",{className:"group/hover-copy inline-flex min-w-0 items-center gap-0.5",children:[n,c("span",{className:"inline-flex opacity-0 transition-opacity duration-(--control-duration) pointer-events-none group-focus-within/hover-copy:pointer-events-auto group-focus-within/hover-copy:opacity-100 group-hover/hover-copy:pointer-events-auto group-hover/hover-copy:opacity-100 [@media(pointer:coarse)]:pointer-events-auto [@media(pointer:coarse)]:opacity-100",children:c(ns,{text:e,label:t,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"})})]})}V();var MK=[".m4v",".mov",".mp4",".ogv",".webm"],AK=[".aac",".flac",".m4a",".mp3",".oga",".ogg",".opus",".wav",".weba"];function Vw(e){let t=e.name.lastIndexOf(".");if(t<=0)return null;let n=e.name.slice(t).toLowerCase();return MK.includes(n)?"video":AK.includes(n)?"audio":null}var NK=["image/gif","image/jpeg","image/png","image/webp"],_K=new Set(NK);function DK(e){return _K.has(e.toLowerCase())}function OK(e){return DK(e)?"image":"file"}var FK=new Set(["application/json","application/xml","application/x-yaml","application/yaml"]),BK=[".doc",".docx",".odt",".ppt",".pptx",".odp",".xls",".xlsx",".ods"];function Hr(e){if(e.type==="image")return"image";let t=e.mimeType.toLowerCase();if(t==="image/svg+xml")return"svg";if(t==="application/pdf")return"pdf";let n=Vw(e);if(n)return n;let o=e.name.lastIndexOf(".");return o>0&&BK.includes(e.name.slice(o).toLowerCase())?"office":t.startsWith("text/")||FK.has(t)?"text":"file"}function ua(e){let t=Hr(e);return t==="image"||t==="svg"}function Cl(e){return!Number.isFinite(e)||e<=0?"0 KB":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function fv(e){let t={id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes};return OK(e.mimeType)==="image"?{type:"image",...t}:{type:"file",...t,...e.source?{source:e.source}:{}}}function cf(e,t){let n=e.flatMap(r=>r.previewUrl?[{...r,src:r.previewUrl}]:[]);if(n.length===0)return null;let o=n.findIndex(r=>r.id===t);return o<0?null:{images:n.map(r=>({src:r.src,name:r.name,attachmentId:r.id,...r.source===void 0?{}:{source:r.source},...r.type!==void 0&&r.mimeType!==void 0&&Hr({type:r.type,mimeType:r.mimeType,name:r.name})==="svg"?{svg:!0}:{}})),index:o}}function uf(e){switch(e){case"image":case"svg":return uc;case"video":return $a;case"audio":return pr;case"pdf":return nc;case"office":return oc;case"text":return tc;case"file":return _o}}function Jo(e){return e.source?._tag==="agent-artifact"?e.source:void 0}function mv({rowId:e,messageId:t,attachments:n}){let o=Je(bt),[r,a]=kn(o.threadKey,`attachments:${t}`,!1),{t:s}=et(),i=n.toSorted((d,u)=>+(Jo(u)?.delivered===!0)-+(Jo(d)?.delivered===!0)),l=r?i:i.slice(0,4);return n.length===0?null:b("div",{className:"mb-2 max-w-[420px]","data-assistant-attachments":"",children:[c("div",{className:"grid grid-cols-2 items-start gap-2",children:l.map(d=>c("div",{className:"min-w-0",children:ua(d)?c(zc,{images:[d],gallery:i.filter(ua)}):c(Hc,{attachment:d})},d.id))}),!r&&i.length>4?c(Y,{variant:"ghost",size:"xs",className:"mt-1","aria-expanded":!1,onClick:()=>{o.onProcessDisclosureChange?.(e),a(!0)},children:s("attachments.showMore")}):null]})}function zc({images:e,gallery:t}){let n=Je(bt),{t:o}=et();return e.length===0?null:c("div",{className:t?"grid":"mb-2 grid max-w-[420px] grid-cols-2 gap-2",children:e.map(r=>b("div",{className:"overflow-hidden rounded-lg border border-border/80 bg-background/70",children:[r.previewUrl?c("button",{type:"button",className:"w-full cursor-zoom-in","data-attachment-action":"preview","data-attachment-name":r.name,"aria-label":o("attachments.preview",{name:r.name}),onClick:()=>{let a=cf(t??e,r.id);a&&n.onImageExpand(a)},children:c("img",{src:r.previewUrl,alt:r.name,loading:"lazy",decoding:"async",className:Hr(r)==="svg"?"block h-auto max-h-[220px] w-full bg-white object-contain":"block h-auto max-h-[220px] w-full object-cover object-top"})}):c("div",{className:"flex min-h-[72px] items-center justify-center px-2 py-3 text-center text-secondary-label text-chat-dense",children:r.name}),Jo(r)?.delivered||Jo(r)?.title||Jo(r)?.note?b("div",{className:"px-2 py-1 text-chat-meta",children:[c("p",{className:"break-words font-medium",children:Jo(r)?.title||r.name}),Jo(r)?.note?c("p",{className:"whitespace-pre-wrap break-words text-secondary-label",children:Jo(r)?.note}):null]}):null]},r.id))})}function Hc(e){let{t}=et(),n=Je(bt).onAttachmentDocumentOpen,o=Hr(e.attachment),r=uf(o),a=t("attachments.open",{name:e.attachment.name}),s=b(Ce,{children:[c(r,{className:"size-4 shrink-0 text-secondary-label"}),b("span",{className:"min-w-0 flex-1",children:[c("span",{className:"block truncate font-medium text-foreground text-chat-row",children:Jo(e.attachment)?.title||e.attachment.name}),Jo(e.attachment)?.note?c("span",{className:"block whitespace-pre-wrap break-words text-secondary-label text-chat-meta",children:Jo(e.attachment)?.note}):null,c("span",{className:"block text-secondary-label text-chat-meta",children:Cl(e.attachment.sizeBytes)})]})]});return!Jo(e.attachment)?.delivered&&e.attachment.previewUrl&&(o==="video"||o==="audio")?b("div",{className:"flex max-w-sm flex-col gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:[c("a",{href:e.attachment.previewUrl,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 hover:underline",children:s}),c(HI,{kind:o,src:e.attachment.previewUrl,title:e.attachment.name})]}):n?c("button",{type:"button","data-attachment-action":"open","data-attachment-name":e.attachment.name,"aria-label":a,onClick:()=>n({attachmentId:e.attachment.id,name:e.attachment.name,mimeType:e.attachment.mimeType}),className:"flex w-full cursor-[var(--control-cursor)] items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 text-start hover:bg-background/90",children:s}):e.attachment.previewUrl?c("a",{href:e.attachment.previewUrl,download:e.attachment.name,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 hover:bg-background/90",children:s}):c("div",{className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:s})}V();V();var Uc=e=>e;function Ur(){return Tn().useThreadDisplayTitle?.()??Uc}V();var Ww=pt(null);function Gw({data:e,target:t,children:n}){let o=K(()=>({data:e,target:t}),[e,t]);return c(Ww,{value:o,children:n})}function pf(){return Je(Ww)}function jw({messageId:e}){let t=pf(),n=t?.data.useMessageForks;return!t||!n?null:c(zK,{read:n,target:t.target,messageId:e})}function zK({read:e,target:t,messageId:n}){let{t:o}=Q(),r=Ur(),[a,s]=W(!1),{threads:i,openThread:l}=e(t,n);return i.length===0?null:b(fo,{open:a,onOpenChange:s,children:[c(go,{render:c(Y,{variant:"ghost",size:"xs"}),children:o("forkRelations.count",{count:i.length})}),c(mo,{"aria-label":o("forkRelations.listTitle"),className:"max-h-72 max-w-80 overflow-y-auto p-1",children:i.map(d=>b(Y,{variant:"ghost",className:"h-auto w-full flex-col items-start gap-0.5 py-2",onClick:()=>{s(!1),l(d.threadId)},children:[c("span",{className:"max-w-full truncate",children:r(d.title)}),c("time",{className:"text-chat-dense text-muted-foreground",dateTime:d.createdAt,children:new Date(d.createdAt).toLocaleString()})]},d.threadId))})]})}V();function Qw({messageId:e,rowId:t}){let n=pf(),o=n?.data.useMessageMemory,r=n?.data.useMemoryExperience;return!n||!o||!r?null:c(HK,{readMemory:o,readExperience:r,target:n.target,messageId:e,rowId:t})}function HK({readMemory:e,readExperience:t,target:n,messageId:o,rowId:r}){let a=e(n,o);return a===null?null:c(UK,{experienceIds:a.experienceIds,readExperience:t,target:n,messageId:o,rowId:r})}function UK({experienceIds:e,readExperience:t,target:n,messageId:o,rowId:r}){let{t:a}=Q(),s=Je(bt),[i,l]=kn(s.threadKey,`memory-context:${o}`,!1),d=pn();return b("div",{className:"flex min-w-0 flex-col items-start gap-1.5 self-stretch","data-memory-context":"",children:[b(Y,{variant:"ghost-muted",size:"xs",className:"-ms-1 gap-1.5 [&_svg]:mx-0","aria-expanded":i,"aria-controls":i?d:void 0,onClick:()=>{s.onProcessDisclosureChange?.(r),l(!i)},children:[c(qt,{"aria-hidden":!0,className:G("size-icon-1",!i&&"-rotate-90")}),c(Qd,{"aria-hidden":!0,className:"size-icon-1"}),a("memoryContext.included",{count:e.length})]}),i?c("ul",{id:d,className:"m-0 w-full max-w-xl list-none divide-y divide-border overflow-hidden rounded-xl border border-border bg-card p-0",children:e.map(u=>c(KK,{readExperience:t,target:n,experienceId:u},u))}):null]})}function KK({readExperience:e,target:t,experienceId:n}){let o=e(t,n);return b("li",{className:"flex min-w-0 items-center gap-2.5 py-2 ps-3 pe-2","data-memory-experience-state":o.state,children:[c($K,{experience:o}),c(qK,{experience:o})]})}function $K({experience:e}){let{t}=Q();switch(e.state){case"loading":return b("div",{className:"min-w-0 flex-1","aria-busy":"true",children:[c("span",{className:"sr-only",children:t("memoryContext.loading")}),c(nv,{className:"h-4 w-3/4"}),c(nv,{className:"mt-1 h-3 w-1/2"})]});case"failed":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.loadFailed")});case"erased":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.erased")});case"active":case"forgotten":{let n=e.state==="forgotten",o=e.recordedAt===null?null:Tw(e.recordedAt,Date.now());return b("div",{className:"min-w-0 flex-1",children:[c("p",{className:G("m-0 line-clamp-2 text-ui-sm",e.title===null?"text-muted-foreground":"font-medium",n&&"text-muted-foreground line-through"),children:e.title??t("memoryContext.textUnavailable")}),o===null?null:c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.recordedBy",{author:e.authorLabel??"",...o})}),n?c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.forgottenNote")}):null]})}}}function qK({experience:e}){let{t}=Q();switch(e.state){case"loading":case"erased":return null;case"failed":return c(Y,{variant:"ghost",size:"xs",onClick:e.retry,children:t("memoryContext.retry")});case"active":case"forgotten":{let n=e.state==="forgotten";return b("div",{className:"flex shrink-0 items-center gap-1.5",children:[n?c(po,{variant:"muted",size:"sm",children:t("memoryContext.forgotten")}):null,b(Y,{variant:"ghost",size:"xs",disabled:e.pending,softDisabled:e.blockedReason!==null,title:e.blockedReason??void 0,onClick:n?e.restore:e.forget,children:[e.pending?c(Za,{}):null,t(n?"memoryContext.restore":"memoryContext.forget")]})]})}}}V();var VK=()=>null;function ff(e){let t=(e.useMachineLabel??VK)(e.reference.environmentId),n=Ur();return b(Ce,{children:[c("div",{className:"wrap-anywhere",children:n(e.reference.title)}),t===null?null:c("div",{className:"text-muted-foreground",children:t})]})}var WK=Object.freeze([]),GK=()=>WK;function Yw(e){return e.type==="file"&&e.source?._tag==="thread-reference"}function jK(e){return e.omitted===null?e.carried:b(Ce,{children:[c("span",{className:"inline-block max-w-full",children:e.carried})," ",c("span",{className:"inline-block max-w-full",children:e.omitted})]})}function Xw(e){let t=Je(bt),{t:n}=et(),r=(t.threadReferences?.useDeliveries??GK)(t.activeThreadEnvironmentId,e).filter(a=>a.status!=="unreadable");return r.length===0?null:c("ul",{"aria-label":n("threadReference.listLabel"),className:"flex min-w-0 max-w-[min(70%,40rem)] flex-col gap-0.5 text-chat-dense text-muted-foreground",children:r.map(a=>c(QK,{delivery:a},`${a.reference.environmentId}:${a.reference.threadId}`))})}function QK(e){let{delivery:t}=e,n=Je(bt),{t:o}=et(),r=Ur(),a=s=>{let i={reference:t.reference};s.dispatchEvent(new CustomEvent(Ji,{bubbles:!0,detail:i}))};return c("li",{"data-thread-reference-delivery":t.status,className:"flex min-w-0",children:b(Ne,{children:[b(De,{render:c("button",{type:"button",className:"relative flex min-w-0 flex-1 cursor-[var(--control-cursor)] items-start gap-1 rounded-sm text-left hover:text-foreground pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",onClick:s=>a(s.currentTarget)}),children:[c("span",{className:"flex h-lh shrink-0 items-center",children:c(sa,{"aria-hidden":"true",className:"size-3.5"})}),b("span",{className:"flex min-w-0 flex-1 flex-wrap gap-x-1",children:[c("span",{className:"max-w-max min-w-0 grow basis-24 truncate",children:o("threadReference.title",{title:r(t.reference.title)})}),c("span",{className:"max-w-full",children:t.status==="carried"?c(jK,{carried:o("threadReference.carried",{count:t.carriedMessages}),omitted:t.omittedMessages>0?o("threadReference.omitted",{count:t.omittedMessages}):null}):t.status==="missing"?o("threadReference.missing"):o("threadReference.loading")})]})]}),c(_e,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:c(ff,{reference:t.reference,useMachineLabel:n.threadReferences?.useMachineLabel})})]})})}V();function YK(e){let t=e.match(/:(\d+)$/);if(!t?.[1])return{path:e,line:void 0,column:void 0};let n=e.slice(0,-t[0].length),o=n.match(/:(\d+)$/);return o?.[1]?{path:n.slice(0,-o[0].length),line:o[1],column:t[1]}:{path:n,line:t[1],column:void 0}}function gv(e){return e.replaceAll("\\","/")}function hv(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function XK(e){return hv(gv(e.replace(/[\\/]+$/,"")))}function JK(e){return e.slice(e.lastIndexOf("/")+1)}function ZK(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function e$(e){return e.startsWith("\\\\")||/^[A-Za-z]:([/\\]|$)/.test(hv(gv(e)))}function mf(e,t){let{path:n,line:o,column:r}=YK(e),a=hv(gv(n)),s=a;if(t){let i=XK(t),l=JK(i),d=e$(t)?f=>f.toLowerCase():f=>f,u=d(a),p=d(i);if(u===p)s=l;else if(u.startsWith(`${p}/`))s=`${l}/${a.slice(i.length+1)}`;else if(!ZK(a)){let f=a.replace(/^\.\/+/,"").replace(/^\/+/,"");s=u.startsWith(`${d(l)}/`)?a:`${l}/${f}`}}return o?`${s}:${o}${r?`:${r}`:""}`:s}var t$=/<review_comment\b([^>]*)>\s*([\s\S]*?)<\/review_comment>/g,n$=/([a-zA-Z][a-zA-Z0-9_-]*)="([^"]*)"/g,o$=/(`{3,})([^\s`]*)[^\n]*\n([\s\S]*?)\n\1/g;function r$(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function a$(e){let t={};for(let n of e.matchAll(n$))t[n[1]]=r$(n[2]??"");return t}function Jw(e){return e===void 0||!/^\d+$/.test(e)?null:Number(e)}function s$(e){let n=Array.from(e.matchAll(o$)).at(-1),o=n?.index;return{text:e.slice(0,o??e.length).trim(),language:n?.[2]?.trim()||"diff",contents:n?.[3]??""}}function i$(e,t,n){let o=a$(e),r=Jw(o.startIndex),a=Jw(o.endIndex),s=o.filePath?.trim(),i=o.sectionId?.trim();if(!s||!i||r===null||a===null)return null;let l=s$(t);return{id:`review-comment:${n}:${i}:${s}:${r}:${a}`,sectionId:i,sectionTitle:o.sectionTitle?.trim()||null,filePath:s,startIndex:Math.min(r,a),endIndex:Math.max(r,a),rangeLabel:o.rangeLabel?.trim()||null,text:l.text,diff:l.contents,fenceLanguage:l.language}}function gf(e){let t=[],n=0,o=0;for(let a of e.matchAll(t$)){let s=a.index??0,i=e.slice(n,s);i.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:i});let l=i$(a[1]??"",a[2]??"",o);l?(t.push({kind:"review-comment",comment:l}),o+=1):t.push({kind:"text",id:`review-comment-invalid:${s}`,text:a[0]}),n=s+a[0].length}let r=e.slice(n);return r.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:r}),t}function Zw(e,t){let n=Math.max(0,...Array.from(t.matchAll(/`+/g),r=>r[0].length)),o="`".repeat(Math.max(3,n+1));return[`${o}${e}`,t.trimEnd(),o].join(`
3752
+ `;V();V();var HS=pt(null),Xi=HS.Provider,US=pt(""),Sp=US.Provider;function Ip(){return Dt(US)}function Tn(){let e=Dt(HS);if(e===null)throw new Error("Conversation UI has not been registered.");return e}var wp="ycodium:assistant-quote-open",Ji="ycodium:thread-reference-open";var Tp="conversation",Wh="conversation.prompt-preview";var kp="__ycodiumConversationBridge",Gh="ycodium.conversation.rebindable-bridge.v1",jh="conversation.pendingRequests";var Kd=18,KS=`ycodium.conversation.host-data.v${Kd}`,$S=80,ra="\uFFFC";V();function qS(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=qS(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function VS(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=qS(e))&&(o&&(o+=" "),o+=t);return o}var WS=VS;var zz=(e,t)=>{let n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},Hz=(e,t)=>({classGroupId:e,validator:t}),eI=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n});var GS=[],Uz="arbitrary..",Kz=e=>{let t=qz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return $z(s);let i=s.split("-"),l=i[0]===""&&i.length>1?1:0;return tI(i,l,t)},getConflictingClassGroupIds:(s,i)=>{if(i){let l=o[s],d=n[s];return l?d?zz(d,l):l:d||GS}return n[s]||GS}}},tI=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let d=tI(e,t+1,a);if(d)return d}let s=n.validators;if(s===null)return;let i=t===0?e.join("-"):e.slice(t).join("-"),l=s.length;for(let d=0;d<l;d++){let u=s[d];if(u.validator(i))return u.classGroupId}},$z=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?Uz+o:void 0})(),qz=e=>{let{theme:t,classGroups:n}=e;return Vz(n,t)},Vz=(e,t)=>{let n=eI();for(let o in e){let r=e[o];Xh(r,n,o,t)}return n},Xh=(e,t,n,o)=>{let r=e.length;for(let a=0;a<r;a++){let s=e[a];Wz(s,t,n,o)}},Wz=(e,t,n,o)=>{if(typeof e=="string"){Gz(e,t,n);return}if(typeof e=="function"){jz(e,t,n,o);return}Qz(e,t,n,o)},Gz=(e,t,n)=>{let o=e===""?t:nI(t,e);o.classGroupId=n},jz=(e,t,n,o)=>{if(Yz(e)){Xh(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Hz(n,e))},Qz=(e,t,n,o)=>{let r=Object.entries(e),a=r.length;for(let s=0;s<a;s++){let[i,l]=r[s];Xh(l,nI(t,i),n,o)}},nI=(e,t)=>{let n=e,o=t.split("-"),r=o.length;for(let a=0;a<r;a++){let s=o[a],i=n.nextPart.get(s);i||(i=eI(),n.nextPart.set(s,i)),n=i}return n},Yz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Xz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null),r=(a,s)=>{n[a]=s,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=o[a])!==void 0)return r(a,s),s},set(a,s){a in n?n[a]=s:r(a,s)}}};var Jz=[],jS=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),Zz=e=>{let{prefix:t,experimentalParseClassName:n}=e,o=r=>{let a=[],s=0,i=0,l=0,d,u=r.length;for(let h=0;h<u;h++){let v=r[h];if(s===0&&i===0){if(v===":"){a.push(r.slice(l,h)),l=h+1;continue}if(v==="/"){d=h;continue}}v==="["?s++:v==="]"?s--:v==="("?i++:v===")"&&i--}let p=a.length===0?r:r.slice(l),f=p,m=!1;p.endsWith("!")?(f=p.slice(0,-1),m=!0):p.startsWith("!")&&(f=p.slice(1),m=!0);let g=d&&d>l?d-l:void 0;return jS(a,m,f,g)};if(t){let r=t+":",a=o;o=s=>s.startsWith(r)?a(s.slice(r.length)):jS(Jz,!1,s,void 0,!0)}if(n){let r=o;o=a=>n({className:a,parseClassName:r})}return o},eH=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{let o=[],r=[];for(let a=0;a<n.length;a++){let s=n[a],i=s[0]==="[",l=t.has(s);i||l?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(s)):r.push(s)}return r.length>0&&(r.sort(),o.push(...r)),o}},tH=e=>({cache:Xz(e.cacheSize),parseClassName:Zz(e),sortModifiers:eH(e),postfixLookupClassGroupIds:nH(e),...Kz(e)}),nH=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let o=0;o<n.length;o++)t[n[o]]=!0;return t},oH=/\s+/,rH=(e,t)=>{let{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a,postfixLookupClassGroupIds:s}=t,i=[],l=e.trim().split(oH),d="";for(let u=l.length-1;u>=0;u-=1){let p=l[u],{isExternal:f,modifiers:m,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:v}=n(p);if(f){d=p+(d.length>0?" "+d:d);continue}let C=!!v,y;if(C){let k=h.substring(0,v);y=o(k);let P=y&&s[y]?o(h):void 0;P&&P!==y&&(y=P,C=!1)}else y=o(h);if(!y){if(!C){d=p+(d.length>0?" "+d:d);continue}if(y=o(h),!y){d=p+(d.length>0?" "+d:d);continue}C=!1}let x=m.length===0?"":m.length===1?m[0]:a(m).join(":"),w=g?x+"!":x,I=w+y;if(i.indexOf(I)>-1)continue;i.push(I);let S=r(y,C);for(let k=0;k<S.length;++k){let P=S[k];i.push(w+P)}d=p+(d.length>0?" "+d:d)}return d},aH=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=oI(n))&&(r&&(r+=" "),r+=o);return r},oI=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=oI(e[o]))&&(n&&(n+=" "),n+=t);return n},QS=(e,...t)=>{let n,o,r,a,s=l=>{let d=t.reduce((u,p)=>p(u),e());return n=tH(d),o=n.cache.get,r=n.cache.set,a=i,i(l)},i=l=>{let d=o(l);if(d)return d;let u=rH(l,n);return r(l,u),u};return a=s,(...l)=>a(aH(...l))},sH=[],vn=e=>{let t=n=>n[e]||sH;return t.isThemeGetter=!0,t},rI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dH=/\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$/,cH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ua=e=>iH.test(e),Ct=e=>!!e&&!Number.isNaN(Number(e)),Dr=e=>!!e&&Number.isInteger(Number(e)),Qh=e=>e.endsWith("%")&&Ct(e.slice(0,-1)),aa=e=>lH.test(e),sI=()=>!0,fH=e=>dH.test(e)&&!cH.test(e),Jh=()=>!1,mH=e=>uH.test(e),gH=e=>pH.test(e),hH=e=>!ze(e)&&!He(e),vH=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),yH=e=>Ka(e,dI,Jh),ze=e=>rI.test(e),Ns=e=>Ka(e,cI,fH),YS=e=>Ka(e,kH,Ct),CH=e=>Ka(e,pI,sI),xH=e=>Ka(e,uI,Jh),XS=e=>Ka(e,iI,Jh),bH=e=>Ka(e,lI,gH),Pp=e=>Ka(e,fI,mH),He=e=>aI.test(e),$d=e=>_s(e,cI),SH=e=>_s(e,uI),JS=e=>_s(e,iI),IH=e=>_s(e,dI),wH=e=>_s(e,lI),Rp=e=>_s(e,fI,!0),TH=e=>_s(e,pI,!0),Ka=(e,t,n)=>{let o=rI.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},_s=(e,t,n=!1)=>{let o=aI.exec(e);return o?o[1]?t(o[1]):n:!1},iI=e=>e==="position"||e==="percentage",lI=e=>e==="image"||e==="url",dI=e=>e==="length"||e==="size"||e==="bg-size",cI=e=>e==="length",kH=e=>e==="number",uI=e=>e==="family-name",pI=e=>e==="number"||e==="weight",fI=e=>e==="shadow";var ZS=()=>{let e=vn("color"),t=vn("font"),n=vn("text"),o=vn("font-weight"),r=vn("tracking"),a=vn("leading"),s=vn("breakpoint"),i=vn("container"),l=vn("spacing"),d=vn("radius"),u=vn("shadow"),p=vn("inset-shadow"),f=vn("text-shadow"),m=vn("drop-shadow"),g=vn("blur"),h=vn("perspective"),v=vn("aspect"),C=vn("ease"),y=vn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...w(),He,ze],S=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],P=()=>[He,ze,l],T=()=>[Ua,"full","auto",...P()],R=()=>[Dr,"none","subgrid",He,ze],E=()=>["auto",{span:["full",Dr,He,ze]},Dr,He,ze],D=()=>[Dr,"auto",He,ze],L=()=>["auto","min","max","fr",He,ze],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...P()],_=()=>[Ua,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],j=()=>[Ua,"screen","full","dvw","lvw","svw","min","max","fit",...P()],N=()=>[Ua,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],z=()=>[e,He,ze],re=()=>[...w(),JS,XS,{position:[He,ze]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",IH,yH,{size:[He,ze]}],q=()=>[Qh,$d,Ns],J=()=>["","none","full",d,He,ze],X=()=>["",Ct,$d,Ns],se=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[Ct,Qh,JS,XS],ne=()=>["","none",g,He,ze],ke=()=>["none",Ct,He,ze],xe=()=>["none",Ct,He,ze],be=()=>[Ct,He,ze],le=()=>[Ua,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[aa],breakpoint:[aa],color:[sI],container:[aa],"drop-shadow":[aa],ease:["in","out","in-out"],font:[hH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[aa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[aa],shadow:[aa],spacing:["px",Ct],text:[aa],"text-shadow":[aa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ua,ze,He,v]}],container:["container"],"container-type":[{"@container":["","normal","size",He,ze]}],"container-named":[vH],columns:[{columns:[Ct,ze,He,i]}],"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:I()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Dr,"auto",He,ze]}],basis:[{basis:[Ua,"full","auto",i,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ct,Ua,"auto","initial","none",ze]}],grow:[{grow:["",Ct,He,ze]}],shrink:[{shrink:["",Ct,He,ze]}],order:[{order:[Dr,"first","last","none",He,ze]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...N()]}],"min-block-size":[{"min-block":["auto",...N()]}],"max-block-size":[{"max-block":["none",...N()]}],w:[{w:[i,"screen",..._()]}],"min-w":[{"min-w":[i,"screen","none",..._()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",n,$d,Ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,TH,CH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qh,ze]}],"font-family":[{font:[SH,xH,t]}],"font-features":[{"font-features":[ze]}],"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:[r,He,ze]}],"line-clamp":[{"line-clamp":[Ct,"none",He,YS]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",He,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ct,"from-font","auto",He,Ns]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ct,"auto",He,ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[Dr,He,ze]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,ze]}],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",He,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dr,He,ze],radial:["",He,ze],conic:[Dr,He,ze]},wH,bH]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ct,He,ze]}],"outline-w":[{outline:["",Ct,$d,Ns]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,Rp,Pp]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,Rp,Pp]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ct,Ns]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,Rp,Pp]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ct,He,ze]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[Ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[He,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[Ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,ze]}],filter:[{filter:["","none",He,ze]}],blur:[{blur:ne()}],brightness:[{brightness:[Ct,He,ze]}],contrast:[{contrast:[Ct,He,ze]}],"drop-shadow":[{"drop-shadow":["","none",m,Rp,Pp]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ct,He,ze]}],"hue-rotate":[{"hue-rotate":[Ct,He,ze]}],invert:[{invert:["",Ct,He,ze]}],saturate:[{saturate:[Ct,He,ze]}],sepia:[{sepia:["",Ct,He,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",He,ze]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[Ct,He,ze]}],"backdrop-contrast":[{"backdrop-contrast":[Ct,He,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ct,He,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ct,He,ze]}],"backdrop-invert":[{"backdrop-invert":["",Ct,He,ze]}],"backdrop-opacity":[{"backdrop-opacity":[Ct,He,ze]}],"backdrop-saturate":[{"backdrop-saturate":[Ct,He,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",Ct,He,ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ct,"initial",He,ze]}],ease:[{ease:["linear","initial",C,He,ze]}],delay:[{delay:[Ct,He,ze]}],animate:[{animate:["none",y,He,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,He,ze]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[He,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"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:[Dr,He,ze]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",He,ze]}],"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":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",He,ze]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ct,$d,Ns,YS]}],stroke:[{stroke:["none",...z()]}],"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"]}},PH=(e,{cacheSize:t,prefix:n,experimentalParseClassName:o,extend:r={},override:a={}})=>(Zi(e,"cacheSize",t),Zi(e,"prefix",n),Zi(e,"experimentalParseClassName",o),Lp(e.theme,a.theme),Lp(e.classGroups,a.classGroups),Lp(e.conflictingClassGroups,a.conflictingClassGroups),Lp(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Zi(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Zi(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),Ep(e.theme,r.theme),Ep(e.classGroups,r.classGroups),Ep(e.conflictingClassGroups,r.conflictingClassGroups),Ep(e.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),Yh(e,r,"postfixLookupClassGroups"),Yh(e,r,"orderSensitiveModifiers"),e),Zi=(e,t,n)=>{n!==void 0&&(e[t]=n)},Lp=(e,t)=>{if(t)for(let n in t)Zi(e,n,t[n])},Ep=(e,t)=>{if(t)for(let n in t)Yh(e,t,n)},Yh=(e,t,n)=>{let o=t[n];o!==void 0&&(e[n]=e[n]?e[n].concat(o):o)},mI=(e,...t)=>typeof e=="function"?QS(ZS,e,...t):QS(()=>PH(ZS(),e),...t);var RH=mI({extend:{classGroups:{"font-size":[{text:["chat","chat-row","chat-code","chat-dense","chat-meta","control-1","control-2","control-3","control-4","control-5"]}]}}});function G(...e){return RH(WS(e))}V();var Mp=pt(!0);function gI(){return Je(Mp)}var Zh=pt(void 0);function No(){let e=Je(Mp);return Je(Zh)??e}V();var Ap=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();var hI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var vI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase());var ev=e=>{let t=vI(e);return t.charAt(0).toUpperCase()+t.slice(1)};V();var yI={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"};var CI=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var xI=wn(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:s,...i},l)=>Be("svg",{ref:l,...yI,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Ap("lucide",r),...!a&&!CI(i)&&{"aria-hidden":"true"},...i},[...s.map(([d,u])=>Be(d,u)),...Array.isArray(a)?a:[a]]));var Z=(e,t)=>{let n=wn(({className:o,...r},a)=>Be(xI,{ref:a,iconNode:t,className:Ap(`lucide-${hI(ev(e))}`,`lucide-${e}`,o),...r}));return n.displayName=ev(e),n};var LH=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ds=Z("archive",LH);var EH=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],qd=Z("arrow-down",EH);var MH=[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]],Vd=Z("arrow-up-to-line",MH);var AH=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Wd=Z("arrow-up-right",AH);var NH=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Gd=Z("arrow-up",NH);var _H=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],jd=Z("blocks",_H);var DH=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Qd=Z("book-open",DH);var OH=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],el=Z("bookmark",OH);var FH=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Os=Z("bot",FH);var BH=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zn=Z("check",BH);var zH=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qt=Z("chevron-down",zH);var HH=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Fs=Z("chevron-left",HH);var UH=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yn=Z("chevron-right",UH);var KH=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Yd=Z("chevrons-left",KH);var $H=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Xd=Z("chevrons-right",$H);var qH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Jt=Z("circle-alert",qH);var VH=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Jd=Z("clock",VH);var WH=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bs=Z("copy",WH);var GH=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],co=Z("ellipsis",GH);var jH=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Zd=Z("eye-off",jH);var QH=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ec=Z("eye",QH);var YH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],tc=Z("file-code",YH);var XH=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],pr=Z("file-headphone",XH);var JH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],$a=Z("file-play",JH);var ZH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],nc=Z("file-text",ZH);var eU=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],oc=Z("file-type",eU);var tU=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],rc=Z("file",tU);var nU=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],qa=Z("folder",nU);var oU=[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]],ac=Z("frame",oU);var rU=[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]],sc=Z("git-branch-plus",rU);var aU=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],ic=Z("git-branch",aU);var sU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],lc=Z("globe",sU);var iU=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],dc=Z("grip-vertical",iU);var lU=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],cc=Z("hammer",lU);var dU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],uc=Z("image",dU);var cU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],pc=Z("info",cU);var uU=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Va=Z("layers",uU);var pU=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],fc=Z("list-ordered",pU);var fU=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],zs=Z("list-todo",fU);var mU=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],mc=Z("list",mU);var gU=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wa=Z("loader-circle",gU);var hU=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],Ga=Z("lock-open",hU);var vU=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],gc=Z("lock",vU);var yU=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],tl=Z("maximize",yU);var CU=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ja=Z("message-circle-question-mark",CU);var xU=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Hs=Z("message-circle",xU);var bU=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Us=Z("message-square",bU);var SU=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],sa=Z("messages-square",SU);var IU=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],hc=Z("minimize-2",IU);var wU=[["path",{d:"M5 12h14",key:"1ays0h"}]],vc=Z("minus",wU);var TU=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Or=Z("mouse-pointer-click",TU);var kU=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],yc=Z("package",kU);var PU=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],Ks=Z("paintbrush",PU);var RU=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],_o=Z("paperclip",RU);var LU=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Fr=Z("pen-line",LU);var EU=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Cc=Z("pencil-ruler",EU);var MU=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],xc=Z("pencil",MU);var AU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bc=Z("plus",AU);var NU=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],$s=Z("puzzle",NU);var _U=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],qs=Z("rotate-ccw",_U);var DU=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Vs=Z("search",DU);var OU=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Sc=Z("send",OU);var FU=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ic=Z("settings",FU);var BU=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],nl=Z("skip-forward",BU);var zU=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ol=Z("sliders-horizontal",zU);var HU=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Qa=Z("sparkles",HU);var UU=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],uo=Z("square-pen",UU);var KU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],wc=Z("square",KU);var $U=[["path",{d:"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152",key:"19ctli"}],["path",{d:"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099",key:"ptqqvy"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Tc=Z("star-off",$U);var qU=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ws=Z("star",qU);var VU=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Do=Z("terminal",VU);var WU=[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]],ia=Z("text-quote",WU);var GU=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],la=Z("user-round",GU);var jU=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],kc=Z("wrench",jU);var QU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ut=Z("x",QU);var YU=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Gs=Z("zap",YU);V();function Q(){return{t:Tn().i18n.usePluginTranslation()}}V();V();var Ya=pt(null),Pc=pt(null);function rl(e,t){let n=Je(Pc);fe(()=>{if(!(!t||e===null||n===null))return n(e)},[n,t,e])}function Rc(){let e=new Map;return{rows:()=>[...e.keys()],acquire:(t,n)=>{e.set(t,(e.get(t)??0)+1),n();let o=!0;return()=>{if(!o)return;o=!1;let r=e.get(t)??0;r>1?e.set(t,r-1):e.delete(t),n()}}}}var bI=new Set(["Select","AlertDialog","Dialog","Menu","Popover","Tooltip","Combobox"]);function Se(e){let t=bI.has(e),n=o=>{let r=Tn(),a=Ip(),s=No(),i=r.ui[e],l={};if(t){let d=Je(Ya),[u,p]=W(o.defaultOpen===!0),f=typeof o.open=="boolean"?o.open:u;rl(d,s&&f),fe(()=>{s||p(!1)},[s]),l={open:s&&f,onOpenChange:(m,...g)=>{p(m),typeof o.onOpenChange=="function"&&o.onOpenChange(m,...g)}}}return Be(i,{...o,...l,...bI.has(e)&&!s?{open:!1}:{},className:`${a} ${typeof o.className=="string"?o.className:""}`})};return n.displayName=e,n}var coe=Se("useLinkContextMenu"),fr=Se("ProviderInstanceIcon"),SI=Se("UserAvatar"),po=Se("Badge"),uoe=Se("InlineTag"),tv=Se("Meter"),Y=Se("Button"),Np=Se("Label"),Xa=Se("Input"),II=Se("SearchInput"),Ja=Se("EmptyInline"),wI=Se("Textarea"),_p=Se("Switch"),poe=Se("Separator"),nv=Se("Skeleton"),Za=Se("Spinner"),foe=Se("ScrollArea"),moe=Se("Card"),goe=Se("CardAction"),hoe=Se("CardPanel"),voe=Se("CardDescription"),yoe=Se("CardFooter"),Coe=Se("CardHeader"),xoe=Se("CardTitle"),boe=Se("Empty"),Soe=Se("EmptyContent"),Ioe=Se("EmptyDescription"),woe=Se("EmptyHeader"),Toe=Se("EmptyMedia"),koe=Se("EmptyTitle"),Poe=Se("InputGroup"),Roe=Se("InputGroupAddon"),Loe=Se("InputGroupInput"),Eoe=Se("DocumentPanel"),Moe=Se("MasterDetail"),al=Se("Select"),js=Se("SelectItem"),sl=Se("SelectPopup"),Dp=Se("SelectTrigger"),Op=Se("SelectValue"),Lc=Se("Toggle"),TI=Se("ToggleGroup"),il=Se("Dialog"),Aoe=Se("DialogClose"),ll=Se("DialogDescription"),Fp=Se("DialogFooter"),Bp=Se("DialogHeader"),dl=Se("DialogPopup"),kI=Se("DialogPanel"),cl=Se("DialogTitle"),Noe=Se("DialogTrigger"),Kn=Se("Menu"),ul=Se("MenuGroup"),PI=Se("MenuGroupLabel"),$n=Se("MenuItem"),qn=Se("MenuPopup"),mr=Se("MenuRadioGroup"),Oo=Se("MenuRadioItem"),da=Se("MenuSeparator"),Vn=Se("MenuTrigger"),fo=Se("Popover"),mo=Se("PopoverPopup"),go=Se("PopoverTrigger"),RI=Se("Table"),LI=Se("TableBody"),gr=Se("TableCell"),Qs=Se("TableHead"),EI=Se("TableHeader"),es=Se("TableRow"),Ne=Se("Tooltip"),_e=Se("TooltipPopup"),De=Se("TooltipTrigger"),Ec=Se("Alert"),Mc=Se("AlertAction"),zp=Se("AlertDescription"),ov=Se("AlertTitle"),pl=Se("Kbd"),Hp=Se("DecisionCard"),MI=Se("ChoiceList"),Up=Se("Command"),Kp=Se("CommandGroup"),$p=Se("CommandItem"),qp=Se("CommandList"),AI=Se("Combobox"),NI=Se("ComboboxEmpty"),_I=Se("ComboboxInput"),Br=Se("ComboboxItem"),DI=Se("ComboboxListVirtualized"),OI=Se("TooltipProvider"),FI=Se("StyledDiffCodeView"),BI=Se("DevBackdropArt"),eo=Se("Markdown"),zI=Se("DiffView"),HI=Se("MediaPlayer");var{jsx:c,jsxs:b,Fragment:Ce}=window.__ycodiumPluginHost.jsxRuntime;var XU="sr-only @min-[30rem]/composer-first-row:not-sr-only";function KI({mode:e,onModeChange:t}){let{t:n}=Q();return c("div",{className:"flex shrink-0 items-center gap-1",children:b(TI,{className:"shrink-0","data-view-mode-toggle":!0,size:"xs","aria-label":n("trajectory.toggleLabel"),variant:"segmented",value:[e],onValueChange:o=>{let r=o[0];(r==="chat"||r==="trajectory")&&t(r)},children:[c(UI,{value:"chat",label:n("trajectory.toggleChat"),icon:c(Us,{"aria-hidden":!0})}),c(UI,{value:"trajectory",label:n("trajectory.toggleTrajectory"),icon:c(fc,{"aria-hidden":!0})})]})})}function UI({value:e,label:t,icon:n}){return b(Ne,{children:[b(De,{render:c(Lc,{value:e,"aria-label":t}),children:[n,c("span",{className:XU,children:t})]}),c(_e,{side:"top",children:t})]})}function $I({mode:e,visible:t,chat:n,trajectory:o}){return c("div",{className:"relative flex min-h-0 flex-1 flex-col","aria-hidden":t?void 0:!0,inert:t?void 0:!0,"data-chat-view-pane":e,"data-pane-visible":t?"true":"false",children:c(Zh,{value:t,children:e==="chat"?n:o})})}V();function qI(e){if(e.cacheDisjoint!==!0)return null;let t=e.cachedInputTokens,n=e.inputTokens;if(t===void 0||n===void 0)return null;let o=t+n;if(o<=0)return null;if(t>=o)return"100%";let r=t/o*100;for(let a=0;a<=3;a+=1){let s=r.toFixed(a);if(Number.parseFloat(s)<100)return`${s}%`}return"99.9%"}function VI(e){let t,n,o,r=!0,a=!1;for(let s of e)s!==void 0&&(a=!0,s.cacheDisjoint!==!0&&(r=!1),s.outputTokens!==void 0&&(t=(t??0)+s.outputTokens),s.inputTokens!==void 0&&(n=(n??0)+s.inputTokens),s.cachedInputTokens!==void 0&&(o=(o??0)+s.cachedInputTokens));if(!(t===void 0&&n===void 0&&o===void 0))return{...a&&r?{cacheDisjoint:!0}:{},...t!==void 0?{outputTokens:t}:{},...n!==void 0?{inputTokens:n}:{},...o!==void 0?{cachedInputTokens:o}:{}}}V();V();var WI=pt(null);function GI({data:e,target:t,children:n}){let o=M(r=>e.readTurnChanges(t,r),[e,t.environmentId,t.threadId]);return c(WI,{value:e.readTurnChanges?o:null,children:n})}function jI({turnId:e,filePath:t,onClose:n}){let o=Je(WI),r=A(o),a=A(n);a.current=n;let{t:s}=Q(),[i,l]=W(0),[d,u]=W(0),[p,f]=W(null),[m,g]=W("loading");return $(()=>{if(o!==r.current){a.current();return}let h=!0;if(g("loading"),!o){g("ready");return}return o({turnId:e,filePath:t,textOffset:i}).then(v=>{h&&(f(C=>({...v,text:i===0?v.text:(C?.text??"")+v.text})),g("ready"))},()=>{h&&g("failed")}),()=>{h=!1}},[o,e,t,i,d]),c(il,{open:!0,onOpenChange:h=>{h||n()},children:b(dl,{className:"flex max-h-[80vh] w-[min(90vw,60rem)] flex-col gap-3",children:[c(cl,{children:s("turnOverview.recordedChanges")}),c(ll,{children:t}),c("p",{className:"text-xs text-muted-foreground",children:p||m==="ready"?s(p?.machineUpdateRequired?"turnOverview.changesUpgradeMachine":`turnOverview.changesSource.${p?.source??"unavailable"}`):null}),m==="loading"?c("p",{role:"status",children:s("turnOverview.changesLoading")}):null,m==="failed"?c(Y,{onClick:()=>u(h=>h+1),children:s("turnOverview.changesRetry")}):null,p?.text?c("pre",{className:"min-h-0 overflow-auto whitespace-pre-wrap break-all text-xs",tabIndex:0,children:p.text}):null,p?.truncated?c("p",{children:s("turnOverview.changesTruncated")}):null,p?.textWindow?.nextOffset!=null?c(Y,{disabled:m==="loading",onClick:()=>l(p.textWindow.nextOffset),children:s("turnOverview.changesMore")}):null,c(Y,{onClick:n,children:s("turnOverview.changesClose")})]})})}V();V();function Ac(e,t){if(!Number.isFinite(e)||e<0)return t.milliseconds("0");if(e<1e3)return t.milliseconds(String(Math.max(1,Math.round(e))));if(e<1e4){let i=Math.round(e/100)/10;return t.seconds(i>=10?"10":i.toFixed(1))}if(e<6e4)return t.seconds(String(Math.round(e/1e3)));let n=Math.round(e/1e3),o=Math.floor(n/3600),r=Math.floor(n%3600/60),a=n%60,s=[];return o>0&&s.push(t.hours(String(o))),r>0&&s.push(t.minutes(String(r))),a>0&&s.push(t.seconds(String(a))),s.reduce((i,l)=>t.pair(i,l))}function QI(e,t){return!Number.isFinite(e)||e<=0?t.seconds("0"):Ac(e,t)}function ho(){let{t:e}=Q();return K(()=>{let t={milliseconds:n=>e("duration.milliseconds",{value:n}),seconds:n=>e("duration.seconds",{value:n}),minutes:n=>e("duration.minutes",{value:n}),hours:n=>e("duration.hours",{value:n}),pair:(n,o)=>e("duration.pair",{left:n,right:o})};return{units:t,formatDuration:n=>Ac(n,t),formatCountedDuration:n=>QI(n,t)}},[e])}function JU({fact:e,ownerId:t,onLocate:n,turnId:o}){let{t:r}=Q(),{formatDuration:a}=ho(),[s,i]=W(!1),[l,d]=W(null);rl(t,s||l!==null);let u=r(`turnOverview.${e.kind}`,{count:e.value,duration:a(e.value)}),p=e.targets[0];return e.targets.length===1&&p?.filePath===void 0?c(Y,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs",title:r("turnOverview.locate"),onClick:()=>p&&n(p.rowId),disabled:!p,children:u}):b(Ce,{children:[b(fo,{open:s,onOpenChange:i,children:[c(go,{render:c(Y,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs"}),children:u}),b(mo,{className:"flex max-h-72 w-80 flex-col gap-1 overflow-auto p-2",children:[e.partial?c("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:r("turnOverview.loadedFacts")}):null,e.targets.map((f,m)=>b("div",{className:"flex min-w-0 items-center gap-1",children:[f.filePath?c(Y,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start whitespace-normal break-all text-left",title:r("turnOverview.recordedChanges"),onClick:()=>{i(!1),d(f.filePath)},children:f.filePath}):c("span",{className:"min-w-0 flex-1 px-2 text-xs",children:r("turnOverview.step",{index:m+1})}),c(Y,{size:"xs",variant:"outline",onClick:()=>{i(!1),n(f.rowId)},children:r("turnOverview.locate")})]},`${f.rowId}:${f.filePath??m}`))]})]}),l!==null?c(jI,{turnId:o,filePath:l,onClose:()=>d(null)},`${o}:${l}`):null]})}function Vp({summary:e,...t}){let{t:n}=Q();return b("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5 text-muted-foreground","data-turn-facts":e.turnId,children:[e.facts.map(o=>c(JU,{fact:o,turnId:e.turnId,ownerId:`turn:${e.turnId}`,...t},o.kind)),e.facts.some(o=>o.partial)?c(YI,{className:"px-1 text-ui-2xs",detail:n("turnOverview.loadedFacts"),children:n("turnOverview.loaded")}):null]})}function Wp({summary:e}){let{t}=Q();return e.hasCompaction?b(YI,{className:"inline-flex shrink-0 items-center text-muted-foreground",detail:t("turnOverview.compaction"),children:[c(Ds,{className:"size-3","aria-hidden":!0}),c("span",{className:"sr-only",children:t("turnOverview.compaction")})]}):null}function YI({children:e,detail:t,className:n}){return b(Ne,{children:[c(De,{render:c("span",{className:n}),children:e}),c(_e,{children:t})]})}V();var JI=100,ZU=new Map,XI=new Map,Gp=e=>typeof e=="function"?e():e,ZI=(e,t)=>typeof t=="function"?t(e):t;function eK(e,t,n){let o=e.get(t);return o===void 0&&(o={values:new Map,limit:Math.max(1,n)},e.set(t,o)),o}function tK(e,t){let n=XI.get(e);return n===void 0&&(n={values:new Map,limit:Math.max(1,t)},XI.set(e,n)),n}function nK(e,t){if(!(e.values.size<=e.limit)){for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.committed||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}}}function rv(e,t,n){e.values.get(t)===n&&(e.values.delete(t),e.values.set(t,n))}function ew(e,t,n){let o=e.values.get(t);return o===void 0&&(o={value:Gp(n),subscribers:new Set,leases:0,alive:!0,committed:!1},e.values.set(t,o)),o}function Nc(e){queueMicrotask(()=>nK(e))}function xt(e,t,n,o=JI){let r=Math.max(1,o),a=eK(ZU,e,r),s=ew(a,t,n),i=M(p=>s.alive?(a.limit=r,s.committed=!0,rv(a,t,s),s.leases+=1,s.subscribers.add(p),Nc(a),()=>{s.subscribers.delete(p),s.leases=Math.max(0,s.leases-1),Nc(a)}):()=>{},[r,s,a,t]),l=M(()=>s.value,[s]),d=Ao(i,l,l),u=M(p=>{if(!s.alive||a.values.get(t)!==s)return;let f=s.value,m=ZI(f,p);if(!Object.is(m,f)){s.value=m,rv(a,t,s);for(let g of s.subscribers)g();Nc(a)}},[s,a,t]);return[d,u]}function tw(e,t){let n=A(null);(n.current===null||n.current.key!==e)&&(n.current={key:e,value:Gp(t)});let[,o]=ur(a=>a+1,0),r=M(a=>{let s=n.current;if(s===null||s.key!==e)return;let i=ZI(s.value,a);Object.is(i,s.value)||(s.value=i,o())},[e]);return[n.current.value,r]}function ut(e,t,n,o=JI){let r=Math.max(1,o),a=tK(e,r),s=ew(a,t,()=>({current:Gp(n)}));return $(()=>{if(!(!s.alive||a.values.get(t)!==s))return a.limit=r,s.committed=!0,rv(a,t,s),s.leases+=1,Nc(a),()=>{s.leases=Math.max(0,s.leases-1),Nc(a)}},[r,s,a,t]),s.value}function Fo(e,t){let n=A(null);return(n.current===null||n.current.key!==e)&&(n.current={key:e,ref:{current:Gp(t)}}),n.current.ref}V();var av="trajectory-summary-reveal";function nw({inputKey:e,rows:t,groupRows:n,paneVisible:o,resetFilter:r}){let[a,s]=xt("trajectory-turn-disclosure",e,{}),[i,l]=xt("trajectory-routine-disclosure",e,()=>new Set),[d,u]=xt("trajectory-expand-all",e,!1),[p,f]=xt(av,e,null),[m,g]=xt("trajectory-summary-highlight",e,null),h=ut("trajectory-default-open",e,()=>new Set),v=K(()=>n?.(t,d)??null,[n,t,d]),C=K(()=>{let k=new Map,P=new Map;if(v===null)return{rows:t,headers:k,routines:P};let T=v.findLast(D=>D.turnId!==null),R=new Set(v.map(D=>D.id));if(h.current.size>200)for(let D of h.current)R.has(D)||h.current.delete(D);o&&T&&h.current.add(T.id);let E=[];for(let D of v){let L=D.items[0],O=L?.kind==="step"?L.row:L?.rows[0];if(!O)continue;let U=d||(a[D.id]??(D.turnId===null||h.current.has(D.id)||D.summary?.state==="running"));if(k.set(D.id,{group:D,expanded:U}),E.push({...O,id:D.id,kind:"turn-header",turnId:D.turnId,createdAt:D.summary?.startedAt??O.createdAt}),!!U)for(let F of D.items){if(F.kind==="step"){E.push(F.row);continue}let _=i.has(F.id);P.set(F.id,{count:F.rows.length,expanded:_}),E.push({...F.rows[0],id:F.id,kind:"routine-header"}),_&&E.push(...F.rows)}}return{rows:E,headers:k,routines:P}},[v,t,o,h,d,a,i]),y=A(C.headers);y.current=C.headers;let x=M(k=>{u(!1),s(P=>({...P,[k]:!y.current.get(k)?.expanded}))},[u,s]),w=M(k=>l(P=>{let T=new Set(P);return T.has(k)?T.delete(k):T.add(k),T}),[l]),I=M(k=>f(P=>({rowId:k,nonce:(P?.nonce??0)+1})),[f]);fe(()=>{if(!o||p===null)return;r();let k=v?.find(T=>T.id===p.rowId||T.items.some(R=>R.kind==="step"?R.row.id===p.rowId:R.rows.some(E=>E.id===p.rowId)));if(!k||k.id===p.rowId)return;C.headers.get(k.id)?.expanded||s(T=>({...T,[k.id]:!0}));let P=k.items.find(T=>T.kind==="routine"&&T.rows.some(R=>R.id===p.rowId));P&&!i.has(P.id)&&l(T=>new Set([...T,P.id]))},[o,p,r,v,C.headers,i,s,l]);let S=M(k=>{g(k.rowId),f(P=>P===k?null:P)},[g,f]);return{...C,expandAll:d,setExpandAll:u,toggleTurn:x,toggleRoutine:w,locate:I,request:p,completeReveal:S,highlighted:m}}function fl(e){return e<1e3?String(Math.round(e)):e<1e6?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,"")}m`}function ow({rows:e,usageByTurnId:t,onSelect:n,summaries:o,actions:r}){let{t:a}=Q();return e.map(({item:s,ordinal:i})=>{let l=s.attachmentPreview,d=s.isSystemMessage?a("turnNavigator.systemWake"):l===void 0?s.userText:l.count===1?l.name:a("forkRelations.attachmentPreview",l),u=s.turnId===null?void 0:o.get(s.turnId),p=s.turnId===null?void 0:t.get(s.turnId);return b("div",{className:"rounded-md hover:bg-accent/50",children:[b("button",{type:"button","data-turn-navigator-row":s.sectionKey,onClick:()=>n(s),className:"flex w-full cursor-[var(--control-cursor)] items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[c("span",{className:"shrink-0 pt-px font-mono text-ui-2xs text-muted-foreground tabular-nums",children:i}),b("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[b("span",{className:"flex items-start gap-1",children:[c("span",{className:"line-clamp-2 min-w-0 flex-1 font-medium text-chat leading-snug",children:d}),u?c(Wp,{summary:u}):null]}),s.assistantText?c("span",{className:"line-clamp-1 text-ui-xs text-muted-foreground leading-snug",children:s.assistantText}):null,p?.outputTokens!==void 0?c("span",{className:"font-mono text-ui-2xs text-muted-foreground tabular-nums",children:fl(p.outputTokens)}):null]})]}),u&&r?c("div",{className:"pb-1 pl-7 pr-2",children:c(Vp,{summary:u,...r})}):null]},s.sectionKey)})}function oK({context:e,useSummaries:t,...n}){let o=t(e.target),r=K(()=>new Map(o.map(s=>[s.turnId,s])),[o]),[,a]=xt(av,e.threadKey,null);return c(ow,{...n,summaries:r,actions:{onLocate:s=>{a(i=>({rowId:s,nonce:(i?.nonce??0)+1})),n.onClose(),e.openTrajectory()},onOpenFileDiff:e.onOpenFileDiff}})}var rK=new Map;function rw(e){let t=e.summaryContext;return t?.data.useTurnSummaries?c(oK,{...e,context:t,useSummaries:t.data.useTurnSummaries}):c(ow,{...e,summaries:rK})}function aK({totals:e}){let{t}=Q();if(!e)return null;let n=qI(e),o=[e.outputTokens===void 0?null:{label:t("turnNavigator.usageOutput"),value:fl(e.outputTokens)},e.inputTokens===void 0?null:{label:t("turnNavigator.usageInput"),value:fl(e.inputTokens)},e.cachedInputTokens===void 0?null:{label:t("turnNavigator.usageCacheRead"),value:n===null?fl(e.cachedInputTokens):`${fl(e.cachedInputTokens)} (${n})`}].filter(r=>r!==null);return o.length===0?null:b("div",{className:"flex items-baseline gap-2 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-ui-2xs text-muted-foreground uppercase tracking-[0.14em]",children:t("turnNavigator.usage")}),o.map(r=>b("span",{className:"shrink-0 font-mono text-ui-2xs text-muted-foreground tabular-nums",children:[r.label," ",r.value]},r.label))]})}var sK=de(function({getText:t,size:n="xs",variant:o="outline",className:r}){let{t:a}=Q(),s=Tn().writeClipboard,[i,l]=W(!1),d=a("turnNavigator.copyMarkdown");return b(Ne,{children:[c(De,{render:c(Y,{"aria-label":d,disabled:i,onClick:()=>{s(t()).then(()=>{l(!0),window.setTimeout(()=>l(!1),1e3)})},type:"button",size:n,variant:o,className:G("text-muted-foreground hover:text-foreground",r)}),children:i?c(Zn,{className:"size-3 text-primary"}):c(Bs,{className:"size-3"})}),c(_e,{children:c("p",{children:d})})]})});function aw({items:e,totalTurnCount:t,bottomInset:n,usageByTurnId:o,onSelect:r,exportMarkdown:a,onDownload:s,placement:i="float",summaryContext:l}){let{t:d}=Q(),[u,p]=W(!1),f=K(()=>e.map((v,C)=>({item:v,ordinal:C+1})).reverse(),[e]),m=K(()=>VI(f.map(({item:v})=>v.turnId===null?void 0:o.get(v.turnId))),[f,o]);if(e.length===0)return null;let g=t??e.length,h=d("turnNavigator.open",{count:g});return b(fo,{onOpenChange:p,open:u,children:[b(go,{render:c(Y,{"aria-label":h,className:G("gap-1.5 rounded-full px-3",i==="float"&&"absolute right-3 z-40"),"data-testid":"turn-navigator-pill",size:"xs",style:i==="float"?{bottom:n+12}:void 0,title:h,variant:"glass"}),children:[c(mc,{"aria-hidden":!0}),c("span",{className:"font-mono font-semibold tabular-nums",children:g})]}),c(mo,{align:"end",className:"w-80 flex-col",side:"top",children:b("div",{className:"flex max-h-[min(60vh,26rem)] flex-col",children:[b("div",{className:"flex items-center gap-1.5 border-b px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-ui-2xs text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.title")}),c("span",{className:"font-mono text-ui-2xs text-muted-foreground tabular-nums",children:g})]}),c("div",{className:G("min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1"),children:c(rw,{rows:f,usageByTurnId:o,summaryContext:l,onSelect:v=>{p(!1),r(v)},onClose:()=>p(!1)})}),c(aK,{totals:m}),b("div",{className:"flex items-center gap-1 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-ui-2xs text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.export")}),c(sK,{size:"icon-xs",getText:a,variant:"ghost"}),c(Y,{"aria-label":d("turnNavigator.downloadMarkdown"),onClick:()=>s("md"),size:"xs",title:d("turnNavigator.downloadMarkdown"),variant:"ghost",children:c("span",{className:"font-mono",children:".md"})}),c(Y,{"aria-label":d("turnNavigator.downloadJson"),onClick:()=>s("json"),size:"xs",title:d("turnNavigator.downloadJson"),variant:"ghost",children:c("span",{className:"font-mono",children:".json"})})]})]})})]})}V();function _c(e){return e.replace(/\s+/g," ")}function iK(e,t){let n=e.slice(Math.max(0,e.length-t));return/^[\uDC00-\uDFFF]/.test(n)&&(n=n.slice(1)),n}function lK(e,t){let n=e.slice(0,t);return/[\uD800-\uDBFF]$/.test(n)&&(n=n.slice(0,-1)),n}function jp(e){let n=(e instanceof Element?e:e?.parentElement??null)?.closest("[data-assistant-quote-body]")??null;return n?.closest('[data-message-role="assistant"]')?n:null}function sw(e){if(!e||e.isCollapsed||e.rangeCount===0)return null;let t=e.getRangeAt(0),n=jp(t.startContainer);if(n===null||jp(t.endContainer)!==n)return null;let o=n.closest("[data-message-id]")?.dataset.messageId;if(!o)return null;let r=e.toString().trim();if(r.length===0)return null;let a=document.createRange();a.selectNodeContents(n),a.setEnd(t.startContainer,t.startOffset);let s=document.createRange();s.selectNodeContents(n),s.setStart(t.endContainer,t.endOffset);let i=_c(t.toString()),l=i.length>i.trimStart().length?" ":"",d=i.length>i.trimEnd().length?" ":"",u=_c(a.toString()+l),p=_c(d+s.toString()),f=u.length,m=f+i.trim().length,g=t.getClientRects(),h=g[0]??t.getBoundingClientRect(),v=g[g.length-1]??h;return{messageId:o,text:r,start:f,end:m,prefix:iK(u,32),suffix:lK(p,32),anchor:{x:v.right,top:h.top,bottom:v.bottom}}}var Qp="assistant-quote-inserter",Yp="assistant-quote-open-comment";var dK=300;function iw(e){let{data:t,target:n,threadKey:o,surfaceRef:r}=e,{t:a}=Q(),s=ut(Qp,o,null),[,i]=xt(Yp,o,null),[l,d]=W(null),u=A(null);if($(()=>{let h,v=()=>{let S=r.current,k=document.getSelection(),P=k&&k.rangeCount>0?k.getRangeAt(0):null;if(!S||!P||!S.contains(P.commonAncestorContainer)){d(null);return}let T=sw(k);if(T===null){d(null);return}let R=t.assistantQuotes.serialize({version:1,environmentId:n.environmentId,threadId:n.threadId,messageId:T.messageId,text:T.text,start:T.start,end:T.end,prefix:T.prefix,suffix:T.suffix});d({source:R,...T.anchor})},C=S=>{u.current?.contains(S.target)||(clearTimeout(h),h=setTimeout(v,dK))},y=S=>{u.current?.contains(S.target)||(clearTimeout(h),d(null))},x=()=>d(null),w=S=>{S.key==="Escape"&&d(null)},I=()=>{(document.getSelection()?.isCollapsed??!0)&&d(null)};return document.addEventListener("pointerup",C,!0),document.addEventListener("keyup",C,!0),document.addEventListener("pointerdown",y,!0),document.addEventListener("keydown",w,!0),document.addEventListener("selectionchange",I),window.addEventListener("scroll",x,!0),()=>{clearTimeout(h),document.removeEventListener("pointerup",C,!0),document.removeEventListener("keyup",C,!0),document.removeEventListener("pointerdown",y,!0),document.removeEventListener("keydown",w,!0),document.removeEventListener("selectionchange",I),window.removeEventListener("scroll",x,!0)}},[t,r,n.environmentId,n.threadId]),l===null)return null;let p=l.source,f=Math.max(8,Math.min(window.innerWidth-200,l.x-12)),m=l.bottom+6,g=m+40<=window.innerHeight?m:Math.max(8,l.top-40);return c("div",{ref:u,className:"fixed z-50 rounded-control-3 bg-background",style:{left:f,top:g},"data-assistant-quote-toolbar":"",children:b(Y,{size:"sm",variant:"outline",className:"shadow-md",disabled:p===null,title:p===null?a("timeline.quote.tooLong"):void 0,onMouseDown:h=>h.preventDefault(),onClick:()=>{p!==null&&s.current?.(p)===!0&&(i(p),document.getSelection()?.removeAllRanges(),d(null))},children:[c(ia,{"aria-hidden":"true"}),a("timeline.quote.cite")]})})}V();V();function lw(e){let t=e.map(o=>({key:o.key,turnId:o.turnId,firstRowIndex:o.firstRowIndex,endRowIndex:o.firstRowIndex+o.rowIds.length})),n=new Map;for(let o of e)for(let[r,a]of o.rowIds.entries())n.set(a,{turnId:o.turnId,index:o.firstRowIndex+r});return{sections:t,bySectionKey:new Map(t.map(o=>[o.key,o])),byRowId:n}}function Xp({index:e,visibleSectionKeys:t,protectedRowIds:n,selectionRows:o}){let r=t.flatMap(d=>{let u=e.bySectionKey.get(d)?.turnId;return u==null?[]:[u]}),a=n.flatMap(d=>{let u=e.byRowId.get(d)?.turnId;return u==null?[]:[u]}),s=o?e.byRowId.get(o.firstRowId)?.index:void 0,i=o?e.byRowId.get(o.lastRowId)?.index:void 0,l=s===void 0||i===void 0?[]:e.sections.flatMap(d=>d.turnId!==null&&d.endRowIndex>Math.min(s,i)&&d.firstRowIndex<=Math.max(s,i)?[d.turnId]:[]);return{firstTurnId:r[0]??null,lastTurnId:r.at(-1)??null,protectedTurnIds:[...new Set(a)],selectionTurnRange:l.length>0?{firstTurnId:l[0],lastTurnId:l.at(-1)}:null}}function dw(e,t,n,o){if(!o)return n;let r=e.findIndex(a=>t.has(a));return r<0?n:Math.max(n,e.length-r)}V();V();function sv(e,t){for(let n of e.querySelectorAll("[data-timeline-row-id]"))if(n.dataset.timelineRowId===t)return n;return null}function Ys(e,t){let n=0,o=e.length,r=-1;for(;n<o;){let a=Math.floor((n+o)/2),i=e[a].getBoundingClientRect();Math.max(i.bottom,i.top+1)>t?(r=a,o=a):n=a+1}return r}function cK(e){let t=e.getBoundingClientRect().top,n=e.querySelectorAll("[data-timeline-turn-section]"),o=a=>{let s=a.querySelectorAll("[data-timeline-row-id]"),i=Ys(s,t),l=i<0?void 0:s[i],d=l?.dataset.timelineRowId;return!l||d===void 0?null:{rowId:d,offsetPx:Math.round(t-l.getBoundingClientRect().top)}};if(n.length===0)return o(e);let r=Ys(n,t);if(r<0)return null;for(let a=r;a<n.length;a+=1){let s=o(n[a]);if(s)return s}return null}function cw(e,t){let n=0,o=e;for(;o&&o!==t;)n+=o.offsetTop,o=o.offsetParent;return n}var iv=class extends oa{getSnapshotBeforeUpdate(t){return t.inputKey!==this.props.inputKey&&t.onBeforeInputChange(),null}componentDidUpdate(){}componentWillUnmount(){this.props.onBeforeInputChange()}render(){return this.props.children}};function uw({inputKey:e,onBeforeInputChange:t,handleRef:n,onAttach:o,className:r,children:a,onScroll:s,onInteractionRowsChange:i}){let l=A(null),d=A({inputKey:e,store:Rc()});d.current.inputKey!==e&&(d.current={inputKey:e,store:Rc()});let u=A(i);u.current=i;let p=M(m=>{let g=d.current;return g.store.acquire(m,()=>{d.current===g&&u.current?.(g.store.rows())})},[]);fe(()=>{i?.(d.current.store.rows())},[e,i]),Xo(n,()=>({get node(){return l.current},measure:()=>{let m=l.current;return m?{scroll:m.scrollTop,scrollLength:m.clientHeight,contentLength:m.scrollHeight,topOf:g=>{let h=sv(m,g);return h===null?null:cw(h,m)},heightOf:g=>{let h=sv(m,g);return h===null?null:h.offsetHeight},rowAtScroll:()=>cK(m)}:null},scrollToEnd:m=>{let g=l.current;if(g){if(m?.animated){g.scrollTo({top:g.scrollHeight,behavior:"smooth"});return}g.scrollTop=g.scrollHeight-g.clientHeight}},scrollToRow:(m,g)=>{let h=l.current;if(!h)return!1;let v=sv(h,m);return v?(h.scrollTop=Math.max(0,cw(v,h)-(g?.viewOffset??0)),!0):!1},scrollToOffset:m=>{let g=l.current;g&&(g.scrollTop=Math.max(0,m))}}),[]);let f=M(m=>{l.current=m,o(m)},[o]);return c(iv,{inputKey:e,onBeforeInputChange:t,children:c(Pc,{value:p,children:c("div",{ref:f,className:r,style:{position:"relative"},onScroll:s,children:a})})})}function gl(e){if(!e)return!1;let t=e.tagName?.toLowerCase(),n=e.getAttribute?.("contenteditable");if(t==="textarea"||n==="true"||n===""||n==="plaintext-only"||"isContentEditable"in e&&e.isContentEditable===!0)return!0;if(t==="input"){let o=e.getAttribute?.("type")?.toLowerCase()??"text";if(!["button","submit","reset","image","checkbox","radio"].includes(o))return!0}return e.matches?.(":focus-visible")??!1}function ml(e,t){let o=(e?.nodeType===1?e:e?.parentElement)?.closest("[data-timeline-row-id]");return o&&t.contains(o)?o.dataset.timelineRowId??null:null}function Jp(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return null;let n=null,o=null;for(let d=0;d<t.rangeCount;d+=1){let u=t.getRangeAt(d);u.intersectsNode(e)&&(n??=u,o=u)}if(!n||!o)return null;let r=ml(n.startContainer,e),a=ml(o.endContainer,e);if(r&&a)return{firstRowId:r,lastRowId:a};let s=e.querySelectorAll("[data-timeline-row-id]"),i=s[0]?.dataset.timelineRowId,l=s[s.length-1]?.dataset.timelineRowId;return i&&l?{firstRowId:r??i,lastRowId:a??l}:null}function Dc(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return!1;for(let n=0;n<t.rangeCount;n+=1)if(t.getRangeAt(n).intersectsNode(e))return!0;return!1}V();function ts(e){let t=A(e);t.current=e;let n=A(!1),o=A(null),r=A(null),a=A(0),s=M(()=>{a.current+=1,r.current!==null&&cancelAnimationFrame(r.current),r.current=null},[]),i=M(()=>{if(!n.current||!t.current||r.current!==null||o.current===null)return;let u=++a.current;r.current=requestAnimationFrame(p=>{if(u!==a.current||(r.current=null,!n.current||!t.current))return;let f=o.current;o.current=null,f?.(p)})},[]),l=M(u=>{o.current=u,i()},[i]),d=M(()=>{o.current=null,s()},[s]);return fe(()=>(n.current=!0,i(),()=>{n.current=!1,s()}),[e,s,i]),K(()=>({request:l,cancel:d}),[l,d])}function pw({root:e,inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l}){let d=A({inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l});d.current={inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l};let u=ts(n),p=A(null),f=M(()=>{let g=d.current;if(!e||!g.visible||e.clientHeight<=0)return;let h=e.getBoundingClientRect();if(h.height<=0)return;let v=h.top+g.topInset,C=h.bottom-g.bottomInset,y=e.querySelectorAll("[data-timeline-turn-section]"),x=Ys(y,v),w=[];if(x>=0)for(let T=x;T<y.length;T+=1){let R=y[T];if(R.getBoundingClientRect().top>=C)break;R.dataset.timelineTurnSection!==void 0&&w.push(R.dataset.timelineTurnSection)}let I=[...g.interactionRows()],S=e.ownerDocument.activeElement;if(gl(S)){let T=ml(S,e);T&&I.push(T)}let k=Xp({index:g.index,visibleSectionKeys:w,protectedRowIds:I,selectionRows:Jp(e)}),P=`${g.inputKey}:${JSON.stringify(k)}`;P!==p.current&&(p.current=P,g.onRangeChange?.(k))},[e]),m=M(()=>u.request(f),[u,f]);return fe(()=>{if(p.current=null,!n||!e)return;let g=t,h=!0,v=()=>{!h||d.current.inputKey!==g||!d.current.visible||(d.current.onSelectionChange(Dc(e)),m())};e.addEventListener("scroll",v,{passive:!0}),e.addEventListener("focusin",v),e.addEventListener("focusout",v),e.ownerDocument.addEventListener("selectionchange",v);let C=typeof ResizeObserver>"u"?null:new ResizeObserver(v);return C?.observe(e),e.firstElementChild&&C?.observe(e.firstElementChild),v(),()=>{h=!1,u.cancel(),C?.disconnect(),e.removeEventListener("scroll",v),e.removeEventListener("focusin",v),e.removeEventListener("focusout",v),e.ownerDocument.removeEventListener("selectionchange",v),i?.(null)}},[u,t,i,m,e,n]),fe(()=>{n&&m()},[o,m,n]),m}V();var fw=de(function({sectionKey:t,rowKeyPrefix:n,rowIds:o,renderRow:r,sectionRef:a}){return c("div",{className:"session-turn","data-timeline-turn-section":t,ref:a,children:o.map(s=>c("div",{className:"transcript-col min-w-0 overflow-x-clip",children:r(s)},`${n}:${s}`))})});var uK=400;function mw({root:e,minimumCount:t,keepAbovePx:n=0,canCompact:o,onCompact:r}){let a=e.ownerDocument,s=new Set,i,l=!1,d=()=>e.scrollHeight-e.clientHeight-e.scrollTop<=2,u=()=>{if(i=void 0,a.hidden||s.size>0||!o()||e.clientHeight<=0||!d()||Dc(e))return;let w=e.querySelectorAll("[data-timeline-turn-section]"),I=e.getBoundingClientRect().top-32-n,S=0,k=Math.max(0,w.length-t);for(;S<k;){let T=Math.floor((S+k)/2),R=w[T].getBoundingClientRect().bottom;if(!Number.isFinite(R))return;R<=I?S=T+1:k=T}if(S===0)return;let P=a.activeElement;if(P&&gl(P)){for(let T=0;T<S;T+=1)if(w[T].contains(P))return}r(w.length-S)},p=!1,f=()=>{if(a.hidden||s.size>0||!o()||p){clearTimeout(i),i=void 0;return}i===void 0&&(i=setTimeout(u,uK))},m=()=>{clearTimeout(i),i=void 0,f()},g=()=>{let w=d();!w||!l?m():f(),l=w},h=w=>{s.add(w.pointerId),m()},v=w=>{s.delete(w.pointerId),m()},C=()=>{p=Dc(e),m()},y=()=>{s.clear(),m()},x=["wheel","keydown","focusin","focusout"];for(let w of x)e.addEventListener(w,m,{passive:!0});return e.addEventListener("scroll",g,{passive:!0}),e.addEventListener("pointerdown",h,!0),a.addEventListener("pointerup",v,!0),a.addEventListener("pointercancel",v,!0),a.addEventListener("selectionchange",C),a.addEventListener("visibilitychange",f),a.defaultView?.addEventListener("blur",y),f(),{schedule:f,disconnect:()=>{clearTimeout(i);for(let w of x)e.removeEventListener(w,m);e.removeEventListener("scroll",g),e.removeEventListener("pointerdown",h,!0),a.removeEventListener("pointerup",v,!0),a.removeEventListener("pointercancel",v,!0),a.removeEventListener("selectionchange",C),a.removeEventListener("visibilitychange",f),a.defaultView?.removeEventListener("blur",y)}}}V();function gw({root:e,topInsetPx:t,onActiveSectionChange:n,onActiveStartHiddenChange:o,active:r}){let a=A(r);a.current=r;let s=ts(r),i=A(new Map),l=A(null),d=A(null),u=A(n);u.current=n;let p=A(o);p.current=o;let f=A(null),m=A(null),g=M(()=>{if(!a.current||!e)return;let x=e.scrollTop+t,w=null,I=Number.NEGATIVE_INFINITY,S=null,k=Number.POSITIVE_INFINITY;for(let[E,D]of i.current){if(!D.isConnected)continue;let L=D.offsetTop;L<k&&(k=L,S=E),L<=x&&L>=I&&(I=L,w=E)}let P=w??S;P!==d.current&&(d.current=P,u.current(P));let T=P===null?null:i.current.get(P)?.firstElementChild??null,R=T!==null&&T.getBoundingClientRect().bottom<=e.getBoundingClientRect().top+1;R!==f.current&&(f.current=R,p.current?.(R))},[e,t]),h=M(()=>{a.current&&s.request(g)},[s,g]);$(()=>{if(!r||!e||typeof IntersectionObserver>"u")return;let x=!0,w=new IntersectionObserver(()=>{!x||!a.current||h()},{root:e,rootMargin:`-${t}px 0px 0px 0px`,threshold:0});l.current=w;for(let S of i.current.values())w.observe(S);let I=new IntersectionObserver(()=>{!x||!a.current||h()},{root:e,threshold:0});m.current=I;for(let S of i.current.values())S.firstElementChild&&I.observe(S.firstElementChild);return h(),()=>{x=!1,w.disconnect(),l.current=null,I.disconnect(),m.current=null,s.cancel()}},[r,s,h,e,t]);let v=A(new Map),C=M(x=>{let w=v.current.get(x);if(w)return w;let I=S=>{let k=i.current.get(x);k&&k!==S&&(l.current?.unobserve(k),k.firstElementChild&&m.current?.unobserve(k.firstElementChild),i.current.delete(x)),S?(i.current.set(x,S),l.current?.observe(S),S.firstElementChild&&m.current?.observe(S.firstElementChild)):v.current.get(x)===I&&v.current.delete(x)};return v.current.set(x,I),I},[]),y=M(()=>{a.current&&(d.current=null,f.current=null,h())},[h]);return K(()=>({observeSection:C,refresh:y}),[C,y])}function Zp(e,t){return e===t?!0:!e||!t?!1:e.identity===t.identity&&e.instanceId===t.instanceId&&e.driverKind===t.driverKind&&e.providerDisplayName===t.providerDisplayName&&e.accentColor===t.accentColor&&e.modelLabel===t.modelLabel&&e.effortLabel===t.effortLabel&&e.effortLevel===t.effortLevel}function hw(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function vw(e,t){return e.turnId===t.turnId&&e.createdAt===t.createdAt&&Zp(e.badge,t.badge)}function yw(e,t){if(e===t)return!0;if(e.kind!==t.kind||e.id!==t.id)return!1;switch(e.kind){case"turn-identity":return vw(e,t);case"turn-summary":{let n=t;return e.createdAt===n.createdAt&&e.copyText===n.copyText&&e.cardAnchor===n.cardAnchor&&e.footer===n.footer&&(e.identity===void 0?n.identity===void 0:n.identity!==void 0&&vw(e.identity,n.identity))}case"tool-group":{let n=t;return e.createdAt===n.createdAt&&e.groupId===n.groupId&&hw(e.entries,n.entries)}case"working":{let n=t;return e.createdAt===n.createdAt&&e.turnId===n.turnId&&e.compacting===n.compacting&&Zp(e.modelBadge,n.modelBadge)}case"model-switch":{let n=t;return e.createdAt===n.createdAt&&e.pending===n.pending&&Zp(e.badge,n.badge)}case"proposed-plan":return e.proposedPlan===t.proposedPlan;case"turn-plan":{let n=t;return e.createdAt===n.createdAt&&e.turnPlan.plan===n.turnPlan.plan}case"work":{let n=t;return e.isExpandedToolGroupEntry===n.isExpandedToolGroupEntry&&e.isLastExpandedToolGroupEntry===n.isLastExpandedToolGroupEntry&&hw(e.groupedEntries,n.groupedEntries)}case"message":{let n=t;return e.message===n.message&&e.presentation===n.presentation&&e.textTone===n.textTone&&e.durationStart===n.durationStart&&e.showAssistantMeta===n.showAssistantMeta&&e.showAssistantCopyButton===n.showAssistantCopyButton&&e.copyInFooter===n.copyInFooter&&e.assistantCopyStreaming===n.assistantCopyStreaming&&Zp(e.modelBadge,n.modelBadge)}}}function pK(e,t,n){for(let o=t;o<n;o+=1){let r=e[o];switch(r.kind){case"turn-identity":return r.turnId;case"working":if(r.turnId!=null)return r.turnId;break;case"message":if(r.message.role==="assistant")return r.message.turnId;break;case"tool-group":if(r.entries[0]?.turnId!=null)return r.entries[0].turnId;break;case"work":if(r.groupedEntries[0]?.turnId!=null)return r.groupedEntries[0].turnId;break;case"turn-plan":return r.turnPlan.turnId;case"proposed-plan":return r.proposedPlan.turnId;case"turn-summary":return r.footer.turnId}}return null}function Cw(e,t,n=[]){let o=new Map(n.map(a=>[a.key,a])),r=[];for(let a of t){if(a.end<=a.start)continue;let s=pK(e,a.start,a.end),i=o.get(a.key);if(i!==void 0&&i.turnId===s&&fK(i,e,a.start,a.end)){r.push(i);continue}r.push({key:a.key,turnId:s,firstRowIndex:a.start,rowIds:e.slice(a.start,a.end).map(l=>l.id)})}return r}function fK(e,t,n,o){if(e.firstRowIndex!==n||e.rowIds.length!==o-n)return!1;for(let r=0;r<e.rowIds.length;r+=1)if(e.rowIds[r]!==t[n+r].id)return!1;return!0}function xw(e,t){let n=Math.max(0,Math.min(t,e)),o=e-n;return{startIndex:o,hasHiddenOlder:o>0}}function Xs(e,t,n){let o=e.findIndex(r=>r.rowIds.includes(t));return o<0?n:Math.max(n,e.length-o)}function mK(e,t){let n=t.historyWindow,{status:o}=t,r={activities:t.activities,timelineEntries:t.timelineEntries,turnSummaries:t.turnSummaries,latestTurn:n?null:o.latestTurn,runningTurnId:n?null:o.runningTurnId,expandedTurnIds:t.expandedTurnIds,isWorking:!n&&o.isWorking,activeTurnStartedAt:n?null:o.activeTurnStartedAt,resolveModelBadge:t.resolveModelBadge,pendingModelSelection:n?null:o.pendingModelSelection},a=e.deriveGroups(r),s=o.latestTurn;if(n&&s&&s.completedAt!==null){let i=s.turnId;if(a.rows.some(d=>d.kind==="message"?d.message.role==="assistant"&&d.message.turnId===i:d.kind==="work"?d.groupedEntries.some(u=>u.turnId===i):d.kind==="tool-group"&&d.entries.some(u=>u.turnId===i)))return e.deriveGroups({...r,latestTurn:s})}return a}var gK=new Map,hK={markdown:()=>"",download(){}},vK=[],yK={latestTurn:null,latestAssistantMessageId:null,runningTurnId:null,isWorking:!1,workingStepLabel:null,stall:null,retry:null,activeTurnStartedAt:null,totalTurnCount:null,pendingModelSelection:null,scheduledWakes:vK},CK={inputs:null,structure:{rowIds:[],sections:[]},indexById:new Map,rows:[],meta:{status:yK,usageByTurnId:gK,exportApi:hK,finalAssistantMessageReceived:!1},version:0};function xK(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function bK(e,t,n,o){let r=mK(n,e),a=SK(t.structure.rowIds,r.rows),s=a?t.indexById:new Map(r.rows.map((g,h)=>[g.id,h])),i=r.rows.map((g,h)=>{let v=a?t.rows[h]:t.rows[t.indexById.get(g.id)??-1],C=v!==void 0&&yw(v,g)?v:g;return C!==v&&o.add(g.id),C});if(!a)for(let g of t.indexById.keys())s.has(g)||o.add(g);let l=Cw(i,r.turnGroups,t.structure.sections),d=a?t.structure.rowIds:i.map(g=>g.id),u=a&&xK(t.structure.sections,l)?t.structure:{rowIds:d,sections:l},p=e.derive.hasSettledAssistantMessage(e.timelineEntries,e.status.latestAssistantMessageId),f=t.meta.status===e.status&&t.meta.usageByTurnId===e.usageByTurnId&&t.meta.exportApi===e.exportApi&&t.meta.finalAssistantMessageReceived===p?t.meta:{status:e.status,usageByTurnId:e.usageByTurnId,exportApi:e.exportApi,finalAssistantMessageReceived:p},m=o.size>0||u!==t.structure||f!==t.meta;return{inputs:e,structure:u,indexById:s,rows:i,meta:f,version:m?t.version+1:t.version}}function SK(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n].id)return!1;return!0}function hl(e){return e.getStructure().rowIds.some(t=>e.getRow(t)?.kind==="message")}function bw(){let e=null,t=null,n=CK,o=new Set,r=0,a=new Set,s=new Map,i=()=>{if(e===null||n.inputs===e)return n;t??=e.derive.createRowsCache();let l=new Set;n=bK(e,n,t,l);for(let d of l)o.add(d);return n};return{setInputs(l){e=l},hasInputs:()=>e!==null,flush(){if(a.size===0&&s.size===0||e===null)return;let{version:l}=i();if(l===r&&o.size===0)return;r=l;let d=[...o];o.clear();for(let u of d){let p=s.get(u);if(p!==void 0)for(let f of Array.from(p))f()}for(let u of Array.from(a))u()},subscribe(l){return a.add(l),()=>{a.delete(l)}},subscribeRow(l,d){let u=s.get(l);return u===void 0&&(u=new Set,s.set(l,u)),u.add(d),()=>{u.delete(d),u.size===0&&s.get(l)===u&&s.delete(l)}},getStructure:()=>i().structure,getRow(l){let{indexById:d,rows:u}=i(),p=d.get(l);return p===void 0?void 0:u[p]},getRows:()=>i().rows,getMeta:()=>i().meta,getVersion:()=>i().version}}V();function ef(e){return Ao(e.subscribe,e.getStructure,e.getStructure)}function Sw(e,t){let n=M(r=>e.subscribeRow(t,r),[e,t]),o=M(()=>e.getRow(t),[e,t]);return Ao(n,o,o)}function On(e,t,n=Object.is){let o=A(null),r=M(()=>{let a=e.getVersion(),s=o.current;if(s!==null&&s.store===e&&s.select===t&&s.version===a)return s.value;let i=t(e),l=s!==null&&s.store===e&&n(s.value,i)?s.value:i;return o.current={store:e,select:t,version:a,value:l},l},[e,t,n]);return Ao(e.subscribe,r,r)}V();V();function Iw(e,t){return e.getFullYear()!==new Date(t).getFullYear()}function lv(e,t){return{month:e,day:"numeric",...t?{year:"numeric"}:{}}}function ww(e){let t=new Intl.DateTimeFormat(e,lv("numeric",!1)),n=new Intl.DateTimeFormat(e,lv("numeric",!0)),o=(r,a)=>(Iw(r,a)?n:t).format(r);return{ofDate:o,ofIso:(r,a)=>{let s=new Date(r);return Number.isNaN(s.getTime())?"":o(s,a)}}}function Tw(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?null:{date:n,formatParams:{date:lv("short",Iw(n,t))}}}function Pw(e,t){let n={hour:"numeric",minute:"2-digit",...t?{second:"2-digit"}:{}};return e==="locale"?n:{...n,hour12:e==="12-hour"}}function IK(e){let t=e?.trim();if(t)try{return Intl.DateTimeFormat.supportedLocalesOf([t]),t}catch{return}}function wK(){return typeof window>"u"?null:window.desktopBridge?.getSystemLocale?.()??null}var Rw=IK(wK()),kw=new Map;function Lw(e,t){let n=`${e}:${t?"seconds":"minutes"}`,o=kw.get(n);if(o)return o;let r=new Intl.DateTimeFormat(Rw,Pw(e,t));return kw.set(n,r),r}function dv(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function zr(e,t,n){let o=dv(e);return o?n("timeline.timestampTooltip",{date:o,formatParams:{date:{...Pw(t,!1),...t==="locale"?{hourCycle:Lw(t,!1).resolvedOptions().hourCycle}:{},year:"numeric",month:"long",day:"numeric"}}}):""}var Ew=ww(Rw);function ca(e,t,n,o=Date.now()){let r=dv(e);if(!r)return"";let a=Lw(t,!1).format(r),s=new Date(o),i=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),d=Math.round((i-l)/864e5);return d<=0?a:d===1?n("relativeTime.yesterdayAt",{time:a}):`${Ew.ofDate(r,o)} ${a}`}function Mw(e,t=Date.now()){return Ew.ofIso(e,t)}function Aw(e){let t=dv(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:""}V();var bt=pt(null),tf=pt(null);V();var vl=new Map,Nw=24,TK=4e3,kK=1024,_w=16384;function cv(e){let t=vl.get(e);if(t)return t;let n={values:new Map,listeners:new Set,stringLength:0};if(vl.set(e,n),vl.size>Nw){for(let[o,r]of vl)if(r.listeners.size===0&&o!==e&&(vl.delete(o),vl.size<=Nw))break}return n}function uv(e,t,n){return cv(e).values.get(t)??n}function Oc(e,t,n,o=!0){let r=cv(e);if(typeof n=="string"&&(n=n.slice(0,kK)),r.values.get(t)===n)return;let a=r.values.get(t);if(typeof a=="string"&&(r.stringLength-=a.length),r.values.delete(t),r.values.set(t,n),typeof n=="string"&&(r.stringLength+=n.length),r.stringLength>_w){for(let[s,i]of r.values)if(!(typeof i!="string"||s===t)&&(r.values.delete(s),r.stringLength-=i.length,r.stringLength<=_w))break}if(r.values.size>TK){let s=r.values.keys().next().value;if(s!==void 0){let i=r.values.get(s);typeof i=="string"&&(r.stringLength-=i.length),r.values.delete(s)}}o&&r.listeners.forEach(s=>s())}function kn(e,t,n){let o=M(i=>{let l=cv(e);return l.listeners.add(i),()=>l.listeners.delete(i)},[e]),r=M(()=>uv(e,t,n),[e,t,n]),a=Ao(o,r,r),s=M(i=>Oc(e,t,i),[e,t]);return[a,s]}function et(){let e=Tn().i18n.usePluginTranslation();return{t:(t,n)=>e(t,n)}}var Dw=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api"];if(!Dw)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{COMMUNICATION_RECORDS_READ_LIMIT:Eae,HOST_TEAM_VIEW_PREFIX:Mae,MAX_PLUGIN_SESSION_PROJECTION_BYTES:Aae,MAX_PLUGIN_SKILL_COMPANION_FILE_BYTES:Nae,MAX_PLUGIN_SKILL_COMPANION_TOTAL_BYTES:_ae,MAX_PLUGIN_STREAM_BUFFER:Dae,MAX_PLUGIN_TOOL_PRESENTATION_BYTES:Oae,MAX_PLUGIN_WORKSPACE_WRITE_BYTES:Fae,MEMBER_INSTRUCTIONS_MAX_BYTES:Bae,MEMBER_NAME_MAX:zae,MEMBER_RESPONSIBILITY_MAX:Hae,MEMBER_TITLE_MAX:Uae,MIN_PLUGIN_INTERVAL_MS:Kae,PLUGIN_API_MIN_VERSION:$ae,PLUGIN_API_VERSION:qae,PLUGIN_PROXY_DIRECT:Vae,REASONING_OPTION_LABEL:Wae,REQUEST_RESOLVED_TRIGGER_KIND:Gae,TEAM_VIEW_KEY_PATTERN:jae,THREAD_ACTIVITIES_LIST_LIMIT:Qae,THREAD_MESSAGES_LIST_LIMIT:Yae,TOOL_LIFECYCLE_ACTIVITY_KINDS:Xae,TURN_PROGRESS_TRIGGER_KIND:Jae,USER_INPUT_PENDING_TRIGGER_KIND:Zae,acceptPluginToolPresentation:ese,definePlugin:tse,defineTeamView:nse,effortText:Ow,findReasoningEffortDescriptor:ose,isReasoningEffortOptionId:rse,isTeamViewKey:ase,isThreadNotFound:sse,knownEffortLevel:ise,mergeLaunchEnv:lse,modelCatalogNoticeOf:nf,modelOptionLabelKind:Fw,modelSelectionStringOption:dse,nearestEffortLevel:cse,parseRetryAfterMs:use,pluginJsonByteLength:pse,projectOrNull:fse,readRequestResolved:mse,readThreadFailed:gse,readTurnProgress:hse,readUserInputPending:vse,reasoningEffortLevel:Bw,reasoningEffortShortLabel:yse,relabelModelOptionDescriptors:zw,resolveModelChoice:Cse,resolveModelOptions:xse,threadMessagesNewestFirst:bse,threadOrNull:Sse}=Dw;var Hw={effort:"traits.savedOption.effort",reasoningEffort:"traits.savedOption.reasoningEffort",variant:"traits.savedOption.variant",fastMode:"traits.savedOption.fastMode",agent:"traits.savedOption.agent",serviceTier:"traits.savedOption.serviceTier"},Uw=e=>`traits.optionValue.${e}`;function PK(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function of(e,t){if(t==="agent")return e("traits.savedOption.agent");let n=Fw(t);return n===void 0?PK(t):e(Hw[n])}function rf(e,t){return zw(t,{kind:n=>e(Hw[n]),level:n=>e(Uw(n)),standardTier:()=>e("traits.standardTier")})}function pv(e,t){return t.effortDisplayKind==="standard-tier"?e("traits.standardTier"):Ow(t,n=>e(Uw(n)))}function Kw(e){return e==="failed"?"failed":e==="running"?"running":"idle"}function $w(e){return e.includes("failed")?"failed":e.includes("running")?"running":"idle"}var af="chat-process-row flex w-full min-w-0 select-none items-center gap-1.5 px-2 text-left";function Fc({children:e}){return c("span",{"aria-hidden":!0,className:"flex size-4 shrink-0 items-center justify-center",children:e})}function Bc({status:e}){return c("span",{"aria-hidden":!0,className:"flex size-2 shrink-0 items-center justify-center",children:e===null?null:c("span",{className:G("block size-2 rounded-full",e==="failed"?"bg-destructive":e==="success"?"bg-success":"border border-muted-foreground/60")})})}function sf({state:e,variant:t="inline",className:n,children:o}){return b("div",{"data-process-state":e,"data-process-kind":t,className:G("chat-process-shell relative min-w-0 overflow-hidden",t==="tool"?"rounded-lg bg-card":"rounded-md",n),children:[e==="running"?c("span",{"aria-hidden":!0,className:"chat-process-shell-pulse animate-status-pulse"}):null,o]})}V();V();var yl=class extends Error{reason;constructor(t,n,o){super(n,o),this.reason=t}};function RK(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.fontSize="16px";let n=document.activeElement;document.body.appendChild(t);try{return t.focus({preventScroll:!0}),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{t.remove();let o=n?.focus;typeof o=="function"&&o.call(n)}}async function LK(e,t){let n=()=>new yl("unavailable",`Clipboard API is unavailable while copying ${t}.`);if(typeof window>"u")throw n();if(!e)return!1;if(typeof navigator>"u"||!navigator.clipboard?.writeText){if(RK(e))return!0;throw n()}try{return await navigator.clipboard.writeText(e),!0}catch(o){throw new yl("write-failed",`Failed to copy ${t} to the clipboard.`,{cause:o})}}function lf({timeout:e=2e3,target:t="text",onCopy:n,onError:o}={}){let[r,a]=W(!1),s=A(null),i=A(n),l=A(o),d=A(t),u=A(e);i.current=n,l.current=o,d.current=t,u.current=e;let p=M((f,m)=>{LK(f,d.current).then(g=>{g&&(s.current&&clearTimeout(s.current),a(!0),i.current?.(m),u.current!==0&&(s.current=setTimeout(()=>{a(!1),s.current=null},u.current)))},g=>{l.current?.(g instanceof Error?g:new Error(String(g)),m)})},[]);return $(()=>()=>{s.current&&clearTimeout(s.current)},[]),{copyToClipboard:p,isCopied:r}}var qw=1e3,EK={unavailable:"copyButton.clipboardUnavailable","write-failed":"copyButton.copyFailedDetail"},ns=de(function({text:t,size:n="xs",variant:o="outline",className:r,toastAnchor:a="above",label:s}){let{t:i}=et(),l=s??i("copyButton.copyToClipboard"),[d,u]=W(!1),[p,f]=W(null),m=A(null),g=(C,y)=>{m.current&&clearTimeout(m.current),f({title:C,description:y}),m.current=setTimeout(()=>{f(null),u(!1)},qw)};$(()=>()=>{m.current&&clearTimeout(m.current)},[]);let{copyToClipboard:h,isCopied:v}=lf({onCopy:()=>g(i("copyButton.copied")),onError:C=>g(i("copyButton.failedToCopy"),C instanceof yl?i(EK[C.reason]):C.message),timeout:qw});return b(Ne,{open:p!==null||d,onOpenChange:u,children:[c(De,{render:c(Y,{"aria-label":l,softDisabled:v,onClick:()=>h(t),type:"button",size:n,variant:o,className:G("text-muted-foreground hover:text-foreground",r)}),children:v?c(Zn,{className:"size-3 text-primary"}):c(Bs,{className:"size-3"})}),b(_e,{side:a==="above"?"top":"bottom",className:"max-w-72",role:p?"status":void 0,children:[c("span",{children:p?.title??l}),p?.description?c("span",{className:"block text-muted-foreground",children:p.description}):null]})]})});function df({text:e,label:t,children:n}){return b("span",{className:"group/hover-copy inline-flex min-w-0 items-center gap-0.5",children:[n,c("span",{className:"inline-flex opacity-0 transition-opacity duration-(--control-duration) pointer-events-none group-focus-within/hover-copy:pointer-events-auto group-focus-within/hover-copy:opacity-100 group-hover/hover-copy:pointer-events-auto group-hover/hover-copy:opacity-100 [@media(pointer:coarse)]:pointer-events-auto [@media(pointer:coarse)]:opacity-100",children:c(ns,{text:e,label:t,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"})})]})}V();var MK=[".m4v",".mov",".mp4",".ogv",".webm"],AK=[".aac",".flac",".m4a",".mp3",".oga",".ogg",".opus",".wav",".weba"];function Vw(e){let t=e.name.lastIndexOf(".");if(t<=0)return null;let n=e.name.slice(t).toLowerCase();return MK.includes(n)?"video":AK.includes(n)?"audio":null}var NK=["image/gif","image/jpeg","image/png","image/webp"],_K=new Set(NK);function DK(e){return _K.has(e.toLowerCase())}function OK(e){return DK(e)?"image":"file"}var FK=new Set(["application/json","application/xml","application/x-yaml","application/yaml"]),BK=[".doc",".docx",".odt",".ppt",".pptx",".odp",".xls",".xlsx",".ods"];function Hr(e){if(e.type==="image")return"image";let t=e.mimeType.toLowerCase();if(t==="image/svg+xml")return"svg";if(t==="application/pdf")return"pdf";let n=Vw(e);if(n)return n;let o=e.name.lastIndexOf(".");return o>0&&BK.includes(e.name.slice(o).toLowerCase())?"office":t.startsWith("text/")||FK.has(t)?"text":"file"}function ua(e){let t=Hr(e);return t==="image"||t==="svg"}function Cl(e){return!Number.isFinite(e)||e<=0?"0 KB":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function fv(e){let t={id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes};return OK(e.mimeType)==="image"?{type:"image",...t}:{type:"file",...t,...e.source?{source:e.source}:{}}}function cf(e,t){let n=e.flatMap(r=>r.previewUrl?[{...r,src:r.previewUrl}]:[]);if(n.length===0)return null;let o=n.findIndex(r=>r.id===t);return o<0?null:{images:n.map(r=>({src:r.src,name:r.name,attachmentId:r.id,...r.source===void 0?{}:{source:r.source},...r.type!==void 0&&r.mimeType!==void 0&&Hr({type:r.type,mimeType:r.mimeType,name:r.name})==="svg"?{svg:!0}:{}})),index:o}}function uf(e){switch(e){case"image":case"svg":return uc;case"video":return $a;case"audio":return pr;case"pdf":return nc;case"office":return oc;case"text":return tc;case"file":return _o}}function Jo(e){return e.source?._tag==="agent-artifact"?e.source:void 0}function mv({rowId:e,messageId:t,attachments:n}){let o=Je(bt),[r,a]=kn(o.threadKey,`attachments:${t}`,!1),{t:s}=et(),i=n.toSorted((d,u)=>+(Jo(u)?.delivered===!0)-+(Jo(d)?.delivered===!0)),l=r?i:i.slice(0,4);return n.length===0?null:b("div",{className:"mb-2 max-w-[420px]","data-assistant-attachments":"",children:[c("div",{className:"grid grid-cols-2 items-start gap-2",children:l.map(d=>c("div",{className:"min-w-0",children:ua(d)?c(zc,{images:[d],gallery:i.filter(ua)}):c(Hc,{attachment:d})},d.id))}),!r&&i.length>4?c(Y,{variant:"ghost",size:"xs",className:"mt-1","aria-expanded":!1,onClick:()=>{o.onProcessDisclosureChange?.(e),a(!0)},children:s("attachments.showMore")}):null]})}function zc({images:e,gallery:t}){let n=Je(bt),{t:o}=et();return e.length===0?null:c("div",{className:t?"grid":"mb-2 grid max-w-[420px] grid-cols-2 gap-2",children:e.map(r=>b("div",{className:"overflow-hidden rounded-lg border border-border/80 bg-background/70",children:[r.previewUrl?c("button",{type:"button",className:"w-full cursor-zoom-in","data-attachment-action":"preview","data-attachment-name":r.name,"aria-label":o("attachments.preview",{name:r.name}),onClick:()=>{let a=cf(t??e,r.id);a&&n.onImageExpand(a)},children:c("img",{src:r.previewUrl,alt:r.name,loading:"lazy",decoding:"async",className:Hr(r)==="svg"?"block h-auto max-h-[220px] w-full bg-white object-contain":"block h-auto max-h-[220px] w-full object-cover object-top"})}):c("div",{className:"flex min-h-[72px] items-center justify-center px-2 py-3 text-center text-secondary-label text-chat-dense",children:r.name}),Jo(r)?.delivered||Jo(r)?.title||Jo(r)?.note?b("div",{className:"px-2 py-1 text-chat-meta",children:[c("p",{className:"break-words font-medium",children:Jo(r)?.title||r.name}),Jo(r)?.note?c("p",{className:"whitespace-pre-wrap break-words text-secondary-label",children:Jo(r)?.note}):null]}):null]},r.id))})}function Hc(e){let{t}=et(),n=Je(bt).onAttachmentDocumentOpen,o=Hr(e.attachment),r=uf(o),a=t("attachments.open",{name:e.attachment.name}),s=b(Ce,{children:[c(r,{className:"size-4 shrink-0 text-secondary-label"}),b("span",{className:"min-w-0 flex-1",children:[c("span",{className:"block truncate font-medium text-foreground text-chat-row",children:Jo(e.attachment)?.title||e.attachment.name}),Jo(e.attachment)?.note?c("span",{className:"block whitespace-pre-wrap break-words text-secondary-label text-chat-meta",children:Jo(e.attachment)?.note}):null,c("span",{className:"block text-secondary-label text-chat-meta",children:Cl(e.attachment.sizeBytes)})]})]});return!Jo(e.attachment)?.delivered&&e.attachment.previewUrl&&(o==="video"||o==="audio")?b("div",{className:"flex max-w-sm flex-col gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:[c("a",{href:e.attachment.previewUrl,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 hover:underline",children:s}),c(HI,{kind:o,src:e.attachment.previewUrl,title:e.attachment.name})]}):n?c("button",{type:"button","data-attachment-action":"open","data-attachment-name":e.attachment.name,"aria-label":a,onClick:()=>n({attachmentId:e.attachment.id,name:e.attachment.name,mimeType:e.attachment.mimeType}),className:"flex w-full cursor-[var(--control-cursor)] items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 text-start hover:bg-background/90",children:s}):e.attachment.previewUrl?c("a",{href:e.attachment.previewUrl,download:e.attachment.name,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 hover:bg-background/90",children:s}):c("div",{className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:s})}V();V();var Uc=e=>e;function Ur(){return Tn().useThreadDisplayTitle?.()??Uc}V();var Ww=pt(null);function Gw({data:e,target:t,children:n}){let o=K(()=>({data:e,target:t}),[e,t]);return c(Ww,{value:o,children:n})}function pf(){return Je(Ww)}function jw({messageId:e}){let t=pf(),n=t?.data.useMessageForks;return!t||!n?null:c(zK,{read:n,target:t.target,messageId:e})}function zK({read:e,target:t,messageId:n}){let{t:o}=Q(),r=Ur(),[a,s]=W(!1),{threads:i,openThread:l}=e(t,n);return i.length===0?null:b(fo,{open:a,onOpenChange:s,children:[c(go,{render:c(Y,{variant:"ghost",size:"xs"}),children:o("forkRelations.count",{count:i.length})}),c(mo,{"aria-label":o("forkRelations.listTitle"),className:"max-h-72 max-w-80 overflow-y-auto p-1",children:i.map(d=>b(Y,{variant:"ghost",className:"h-auto w-full flex-col items-start gap-0.5 py-2",onClick:()=>{s(!1),l(d.threadId)},children:[c("span",{className:"max-w-full truncate",children:r(d.title)}),c("time",{className:"text-chat-dense text-muted-foreground",dateTime:d.createdAt,children:new Date(d.createdAt).toLocaleString()})]},d.threadId))})]})}V();function Qw({messageId:e,rowId:t}){let n=pf(),o=n?.data.useMessageMemory,r=n?.data.useMemoryExperience;return!n||!o||!r?null:c(HK,{readMemory:o,readExperience:r,target:n.target,messageId:e,rowId:t})}function HK({readMemory:e,readExperience:t,target:n,messageId:o,rowId:r}){let a=e(n,o);return a===null?null:c(UK,{experienceIds:a.experienceIds,readExperience:t,target:n,messageId:o,rowId:r})}function UK({experienceIds:e,readExperience:t,target:n,messageId:o,rowId:r}){let{t:a}=Q(),s=Je(bt),[i,l]=kn(s.threadKey,`memory-context:${o}`,!1),d=pn();return b("div",{className:"flex min-w-0 flex-col items-start gap-1.5 self-stretch","data-memory-context":"",children:[b(Y,{variant:"ghost-muted",size:"xs",className:"-ms-1 gap-1.5 [&_svg]:mx-0","aria-expanded":i,"aria-controls":i?d:void 0,onClick:()=>{s.onProcessDisclosureChange?.(r),l(!i)},children:[c(qt,{"aria-hidden":!0,className:G("size-icon-1",!i&&"-rotate-90")}),c(Qd,{"aria-hidden":!0,className:"size-icon-1"}),a("memoryContext.included",{count:e.length})]}),i?c("ul",{id:d,className:"m-0 w-full max-w-xl list-none divide-y divide-border overflow-hidden rounded-xl border border-border bg-card p-0",children:e.map(u=>c(KK,{readExperience:t,target:n,experienceId:u},u))}):null]})}function KK({readExperience:e,target:t,experienceId:n}){let o=e(t,n);return b("li",{className:"flex min-w-0 items-center gap-2.5 py-2 ps-3 pe-2","data-memory-experience-state":o.state,children:[c($K,{experience:o}),c(qK,{experience:o})]})}function $K({experience:e}){let{t}=Q();switch(e.state){case"loading":return b("div",{className:"min-w-0 flex-1","aria-busy":"true",children:[c("span",{className:"sr-only",children:t("memoryContext.loading")}),c(nv,{className:"h-4 w-3/4"}),c(nv,{className:"mt-1 h-3 w-1/2"})]});case"failed":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.loadFailed")});case"erased":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.erased")});case"active":case"forgotten":{let n=e.state==="forgotten",o=e.recordedAt===null?null:Tw(e.recordedAt,Date.now());return b("div",{className:"min-w-0 flex-1",children:[c("p",{className:G("m-0 line-clamp-2 text-ui-sm",e.title===null?"text-muted-foreground":"font-medium",n&&"text-muted-foreground line-through"),children:e.title??t("memoryContext.textUnavailable")}),o===null?null:c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.recordedBy",{author:e.authorLabel??"",...o})}),n?c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.forgottenNote")}):null]})}}}function qK({experience:e}){let{t}=Q();switch(e.state){case"loading":case"erased":return null;case"failed":return c(Y,{variant:"ghost",size:"xs",onClick:e.retry,children:t("memoryContext.retry")});case"active":case"forgotten":{let n=e.state==="forgotten";return b("div",{className:"flex shrink-0 items-center gap-1.5",children:[n?c(po,{variant:"muted",size:"sm",children:t("memoryContext.forgotten")}):null,b(Y,{variant:"ghost",size:"xs",disabled:e.pending,softDisabled:e.blockedReason!==null,title:e.blockedReason??void 0,onClick:n?e.restore:e.forget,children:[e.pending?c(Za,{}):null,t(n?"memoryContext.restore":"memoryContext.forget")]})]})}}}V();var VK=()=>null;function ff(e){let t=(e.useMachineLabel??VK)(e.reference.environmentId),n=Ur();return b(Ce,{children:[c("div",{className:"wrap-anywhere",children:n(e.reference.title)}),t===null?null:c("div",{className:"text-muted-foreground",children:t})]})}var WK=Object.freeze([]),GK=()=>WK;function Yw(e){return e.type==="file"&&e.source?._tag==="thread-reference"}function jK(e){return e.omitted===null?e.carried:b(Ce,{children:[c("span",{className:"inline-block max-w-full",children:e.carried})," ",c("span",{className:"inline-block max-w-full",children:e.omitted})]})}function Xw(e){let t=Je(bt),{t:n}=et(),r=(t.threadReferences?.useDeliveries??GK)(t.activeThreadEnvironmentId,e).filter(a=>a.status!=="unreadable");return r.length===0?null:c("ul",{"aria-label":n("threadReference.listLabel"),className:"flex min-w-0 max-w-[min(70%,40rem)] flex-col gap-0.5 text-chat-dense text-muted-foreground",children:r.map(a=>c(QK,{delivery:a},`${a.reference.environmentId}:${a.reference.threadId}`))})}function QK(e){let{delivery:t}=e,n=Je(bt),{t:o}=et(),r=Ur(),a=s=>{let i={reference:t.reference};s.dispatchEvent(new CustomEvent(Ji,{bubbles:!0,detail:i}))};return c("li",{"data-thread-reference-delivery":t.status,className:"flex min-w-0",children:b(Ne,{children:[b(De,{render:c("button",{type:"button",className:"relative flex min-w-0 flex-1 cursor-[var(--control-cursor)] items-start gap-1 rounded-sm text-left hover:text-foreground pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",onClick:s=>a(s.currentTarget)}),children:[c("span",{className:"flex h-lh shrink-0 items-center",children:c(sa,{"aria-hidden":"true",className:"size-3.5"})}),b("span",{className:"flex min-w-0 flex-1 flex-wrap gap-x-1",children:[c("span",{className:"max-w-max min-w-0 grow basis-24 truncate",children:o("threadReference.title",{title:r(t.reference.title)})}),c("span",{className:"max-w-full",children:t.status==="carried"?c(jK,{carried:o("threadReference.carried",{count:t.carriedMessages}),omitted:t.omittedMessages>0?o("threadReference.omitted",{count:t.omittedMessages}):null}):t.status==="missing"?o("threadReference.missing"):o("threadReference.loading")})]})]}),c(_e,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:c(ff,{reference:t.reference,useMachineLabel:n.threadReferences?.useMachineLabel})})]})})}V();function YK(e){let t=e.match(/:(\d+)$/);if(!t?.[1])return{path:e,line:void 0,column:void 0};let n=e.slice(0,-t[0].length),o=n.match(/:(\d+)$/);return o?.[1]?{path:n.slice(0,-o[0].length),line:o[1],column:t[1]}:{path:n,line:t[1],column:void 0}}function gv(e){return e.replaceAll("\\","/")}function hv(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function XK(e){return hv(gv(e.replace(/[\\/]+$/,"")))}function JK(e){return e.slice(e.lastIndexOf("/")+1)}function ZK(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function e$(e){return e.startsWith("\\\\")||/^[A-Za-z]:([/\\]|$)/.test(hv(gv(e)))}function mf(e,t){let{path:n,line:o,column:r}=YK(e),a=hv(gv(n)),s=a;if(t){let i=XK(t),l=JK(i),d=e$(t)?f=>f.toLowerCase():f=>f,u=d(a),p=d(i);if(u===p)s=l;else if(u.startsWith(`${p}/`))s=`${l}/${a.slice(i.length+1)}`;else if(!ZK(a)){let f=a.replace(/^\.\/+/,"").replace(/^\/+/,"");s=u.startsWith(`${d(l)}/`)?a:`${l}/${f}`}}return o?`${s}:${o}${r?`:${r}`:""}`:s}var t$=/<review_comment\b([^>]*)>\s*([\s\S]*?)<\/review_comment>/g,n$=/([a-zA-Z][a-zA-Z0-9_-]*)="([^"]*)"/g,o$=/(`{3,})([^\s`]*)[^\n]*\n([\s\S]*?)\n\1/g;function r$(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function a$(e){let t={};for(let n of e.matchAll(n$))t[n[1]]=r$(n[2]??"");return t}function Jw(e){return e===void 0||!/^\d+$/.test(e)?null:Number(e)}function s$(e){let n=Array.from(e.matchAll(o$)).at(-1),o=n?.index;return{text:e.slice(0,o??e.length).trim(),language:n?.[2]?.trim()||"diff",contents:n?.[3]??""}}function i$(e,t,n){let o=a$(e),r=Jw(o.startIndex),a=Jw(o.endIndex),s=o.filePath?.trim(),i=o.sectionId?.trim();if(!s||!i||r===null||a===null)return null;let l=s$(t);return{id:`review-comment:${n}:${i}:${s}:${r}:${a}`,sectionId:i,sectionTitle:o.sectionTitle?.trim()||null,filePath:s,startIndex:Math.min(r,a),endIndex:Math.max(r,a),rangeLabel:o.rangeLabel?.trim()||null,text:l.text,diff:l.contents,fenceLanguage:l.language}}function gf(e){let t=[],n=0,o=0;for(let a of e.matchAll(t$)){let s=a.index??0,i=e.slice(n,s);i.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:i});let l=i$(a[1]??"",a[2]??"",o);l?(t.push({kind:"review-comment",comment:l}),o+=1):t.push({kind:"text",id:`review-comment-invalid:${s}`,text:a[0]}),n=s+a[0].length}let r=e.slice(n);return r.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:r}),t}function Zw(e,t){let n=Math.max(0,...Array.from(t.matchAll(/`+/g),r=>r[0].length)),o="`".repeat(Math.max(3,n+1));return[`${o}${e}`,t.trimEnd(),o].join(`
3753
3753
  `)}function eT(e){if((e.fenceLanguage??"diff")!=="diff")return"";let t=e.diff.trim();if(t.length===0)return"";if(t.startsWith("diff --git "))return t;let n=e.filePath.replaceAll("\\","/");return[`diff --git a/${n} b/${n}`,`--- a/${n}`,`+++ b/${n}`,t].join(`
3754
3754
  `)}var Kc="[a-zA-Z][a-zA-Z0-9:_-]*";function xl(e){return e===" "||e===`
3755
- `||e===" "||e==="\r"}function bl(e){return e.enabled&&e.userInvocable!==!1}var nT="ycodium",tT=`${nT}:`,l$=new RegExp(String.raw`(^|\s)([$/])(${Kc})(?=\s|$)`,"g");function vv(e){return[...e.matchAll(l$)].map(t=>{let n=(t.index??0)+(t[1]?.length??0),o=t[3]??"";return{sigil:t[2],name:o,start:n,end:n+o.length+1}})}var zie=new RegExp(String.raw`([$/])(${Kc})(?=\s|$)`,"y");function oT(e,t){let n=t.get(e);if(n!==void 0)return n;if(!e.startsWith(tT))return;let o=t.get(e.slice(tT.length));return o?.scope===nT?o:void 0}function rT(e,t,n,o=xl){if(t.length!==e.length+1)return null;let r=0;for(;r<e.length&&e[r]===t[r];)r+=1;let a=t.charAt(r);if(!xl(a)||r<e.length&&o(e.charAt(r))||t.slice(r+1)!==e.slice(r))return null;let s=r;for(;s>0&&!o(t.charAt(s-1));)s-=1;let l=d$.exec(t.slice(s,r))?.[1];return l===void 0||oT(l,n)===void 0?null:{start:s,end:r+1,replacement:`$${l}${a}`}}var d$=new RegExp(String.raw`^/(${Kc})$`);function hf(e){return new Map(e.map(t=>[t.name,t]))}function aT(e,t){return t.size===0?[]:vv(e).flatMap(n=>{let o=oT(n.name,t);return o===void 0?[]:[{...n,skill:o}]})}var c$="inline-flex h-[1.41em] max-w-full items-center gap-[0.33em] rounded-[0.5em] px-[0.5em] font-medium align-middle",u$=`${c$} border border-border/70 bg-accent/40 text-foreground`,vf=`${u$} text-control-1`,yf="block size-[1.17em] shrink-0 self-center opacity-85 [&>svg]:block",Cf="truncate",sT='<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>';var iT="inline-flex h-[1.41em] max-w-full items-center gap-[0.33em] rounded-[0.5em] px-[0.5em] font-medium align-middle",lT=`${iT} border border-border/70 bg-accent/40 text-foreground`,p$=`${lT} text-control-1`,Zo=`${lT} text-[0.86em] leading-none select-none`,hr="relative inline-flex align-[-0.125em] leading-none data-[composer-chip-selected]:after:pointer-events-none data-[composer-chip-selected]:after:absolute data-[composer-chip-selected]:after:inset-0 data-[composer-chip-selected]:after:rounded-[6px] data-[composer-chip-selected]:after:bg-[Highlight] data-[composer-chip-selected]:after:opacity-30 data-[composer-chip-selected]:after:content-['']",vo="block size-[1.17em] shrink-0 self-center opacity-85 [&>svg]:block",dT="truncate",yo="block self-center truncate leading-tight select-none",yv="border-skill-chip-border bg-skill-chip text-skill-chip-foreground",cT=`${iT} select-none border ${yv} text-[0.86em] leading-none`,uT='<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>',xf="ml-[0.17em] inline-flex size-[1.17em] shrink-0 cursor-[var(--control-cursor)] items-center justify-center rounded-sm text-muted-foreground/72 transition-colors hover:bg-foreground/10 hover:text-foreground";function f$(e){return e.split(/[\s_-]+/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function m$(e){let t=e.displayName?.trim();return t||f$(e.name)}function pT(e){let t=[],n=0;for(let o of aT(e.text,e.index))o.start>n&&t.push(e.text.slice(n,o.start)),t.push(c(g$,{skill:o.skill,rawText:e.text.slice(o.start,o.end)},`${o.start}:${o.name}`)),n=o.end;return n===0?c(Ce,{children:e.text}):(n<e.text.length&&t.push(e.text.slice(n)),c(Ce,{children:t}))}function g$(e){return c("span",{className:"inline-flex align-middle leading-none","data-markdown-copy":e.rawText,children:b("span",{className:G(vf,yv),children:[c("span",{"aria-hidden":"true",className:yf,dangerouslySetInnerHTML:{__html:sT}}),c("span",{className:Cf,children:m$(e.skill)})]})})}function fT(e){let{label:t,tooltipText:n,expired:o=!1}=e;return b(Ne,{children:[b(De,{render:c("span",{className:G(vf,o&&"border-destructive/35 bg-destructive/8 text-destructive-foreground"),"data-terminal-context-expired":o?"true":void 0}),children:[c(Do,{className:G(yf,"size-icon-1",o&&"opacity-100")}),c("span",{className:Cf,children:t})]}),c(_e,{side:"top",className:"max-w-80 whitespace-pre-wrap leading-tight",children:n})]})}var h$=/\n*<element_context>\n([\s\S]*?)\n<\/element_context>\s*$/;function Sl(e){let t=h$.exec(e);if(!t)return{promptText:e,contextCount:0,contexts:[]};let n=e.slice(0,t.index).replace(/\n+$/,""),o=v$(t[1]??"");return{promptText:n,contextCount:o.length,contexts:o}}function v$(e){let t=[],n=null,o=()=>{n&&(t.push({header:n.header,body:n.bodyLines.join(`
3755
+ `||e===" "||e==="\r"}function bl(e){return e.enabled&&e.userInvocable!==!1}var nT="ycodium",tT=`${nT}:`,l$=new RegExp(String.raw`(^|\s)([$/])(${Kc})(?=\s|$)`,"g");function vv(e){return[...e.matchAll(l$)].map(t=>{let n=(t.index??0)+(t[1]?.length??0),o=t[3]??"";return{sigil:t[2],name:o,start:n,end:n+o.length+1}})}var Uie=new RegExp(String.raw`([$/])(${Kc})(?=\s|$)`,"y");function oT(e,t){let n=t.get(e);if(n!==void 0)return n;if(!e.startsWith(tT))return;let o=t.get(e.slice(tT.length));return o?.scope===nT?o:void 0}function rT(e,t,n,o=xl){if(t.length!==e.length+1)return null;let r=0;for(;r<e.length&&e[r]===t[r];)r+=1;let a=t.charAt(r);if(!xl(a)||r<e.length&&o(e.charAt(r))||t.slice(r+1)!==e.slice(r))return null;let s=r;for(;s>0&&!o(t.charAt(s-1));)s-=1;let l=d$.exec(t.slice(s,r))?.[1];return l===void 0||oT(l,n)===void 0?null:{start:s,end:r+1,replacement:`$${l}${a}`}}var d$=new RegExp(String.raw`^/(${Kc})$`);function hf(e){return new Map(e.map(t=>[t.name,t]))}function aT(e,t){return t.size===0?[]:vv(e).flatMap(n=>{let o=oT(n.name,t);return o===void 0?[]:[{...n,skill:o}]})}var c$="inline-flex h-[1.41em] max-w-full items-center gap-[0.33em] rounded-[0.5em] px-[0.5em] font-medium align-middle",u$=`${c$} border border-border/70 bg-accent/40 text-foreground`,vf=`${u$} text-control-1`,yf="block size-[1.17em] shrink-0 self-center opacity-85 [&>svg]:block",Cf="truncate",sT='<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>';var iT="inline-flex h-[1.41em] max-w-full items-center gap-[0.33em] rounded-[0.5em] px-[0.5em] font-medium align-middle",lT=`${iT} border border-border/70 bg-accent/40 text-foreground`,p$=`${lT} text-control-1`,Zo=`${lT} text-[0.86em] leading-none select-none`,hr="relative inline-flex align-[-0.125em] leading-none data-[composer-chip-selected]:after:pointer-events-none data-[composer-chip-selected]:after:absolute data-[composer-chip-selected]:after:inset-0 data-[composer-chip-selected]:after:rounded-[6px] data-[composer-chip-selected]:after:bg-[Highlight] data-[composer-chip-selected]:after:opacity-30 data-[composer-chip-selected]:after:content-['']",vo="block size-[1.17em] shrink-0 self-center opacity-85 [&>svg]:block",dT="truncate",yo="block self-center truncate leading-tight select-none",yv="border-skill-chip-border bg-skill-chip text-skill-chip-foreground",cT=`${iT} select-none border ${yv} text-[0.86em] leading-none`,uT='<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>',xf="ml-[0.17em] inline-flex size-[1.17em] shrink-0 cursor-[var(--control-cursor)] items-center justify-center rounded-sm text-muted-foreground/72 transition-colors hover:bg-foreground/10 hover:text-foreground";function f$(e){return e.split(/[\s_-]+/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function m$(e){let t=e.displayName?.trim();return t||f$(e.name)}function pT(e){let t=[],n=0;for(let o of aT(e.text,e.index))o.start>n&&t.push(e.text.slice(n,o.start)),t.push(c(g$,{skill:o.skill,rawText:e.text.slice(o.start,o.end)},`${o.start}:${o.name}`)),n=o.end;return n===0?c(Ce,{children:e.text}):(n<e.text.length&&t.push(e.text.slice(n)),c(Ce,{children:t}))}function g$(e){return c("span",{className:"inline-flex align-middle leading-none","data-markdown-copy":e.rawText,children:b("span",{className:G(vf,yv),children:[c("span",{"aria-hidden":"true",className:yf,dangerouslySetInnerHTML:{__html:sT}}),c("span",{className:Cf,children:m$(e.skill)})]})})}function fT(e){let{label:t,tooltipText:n,expired:o=!1}=e;return b(Ne,{children:[b(De,{render:c("span",{className:G(vf,o&&"border-destructive/35 bg-destructive/8 text-destructive-foreground"),"data-terminal-context-expired":o?"true":void 0}),children:[c(Do,{className:G(yf,"size-icon-1",o&&"opacity-100")}),c("span",{className:Cf,children:t})]}),c(_e,{side:"top",className:"max-w-80 whitespace-pre-wrap leading-tight",children:n})]})}var h$=/\n*<element_context>\n([\s\S]*?)\n<\/element_context>\s*$/;function Sl(e){let t=h$.exec(e);if(!t)return{promptText:e,contextCount:0,contexts:[]};let n=e.slice(0,t.index).replace(/\n+$/,""),o=v$(t[1]??"");return{promptText:n,contextCount:o.length,contexts:o}}function v$(e){let t=[],n=null,o=()=>{n&&(t.push({header:n.header,body:n.bodyLines.join(`
3756
3756
  `).trimEnd()}),n=null)};for(let r of e.split(`
3757
3757
  `)){let a=/^- (.+):$/.exec(r);if(a){o(),n={header:a[1],bodyLines:[]};continue}n&&(r.startsWith(" ")?n.bodyLines.push(r.slice(2)):r.length===0&&n.bodyLines.push(""))}return o(),t}var y$=/\n*<terminal_context>\n([\s\S]*?)\n<\/terminal_context>\s*$/;function C$(e){let t=[],n=null,o=()=>{n&&(t.push({header:n.header,body:n.bodyLines.join(`
3758
3758
  `).trimEnd()}),n=null)};for(let r of e.split(`
@@ -3791,12 +3791,12 @@ ${IT}`,z$=new RegExp(`^${Tf}\\n<preset-prefix id="([^"]*)">\\n([\\s\\S]*?)\\n</p
3791
3791
  `?r.push(zl()):i===" "?r.push(Am()):i!==""&&r.push(Rn(i))}return{node:r}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let o=t,r=!0;for(;o!==null&&(o=rR(o,!1))!==null;){let a=o.textContent||"";if(a.length>0){/[ \t\n]$/.test(a)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let o=t,r=!0;for(;o!==null&&(o=rR(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Rn(n)}}function rR(e,t){let n=e;for(;;){let o;for(;(o=t?n.nextSibling:n.previousSibling)===null;){let a=n.parentElement;if(a===null)return null;n=a}if(n=o,ro(n)){let a=n.style.display;if(a===""&&!nE(n)||a!==""&&!a.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(qr(n))return n;if(n.nodeName==="BR")return null}}var $V={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function fa(e){let t=$V[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:nC(e.style,t),node:null}}function Rn(e=""){return Pu(new mi(e))}function We(e){return e instanceof mi}function nC(e,t){let n=e.fontWeight,o=e.textDecoration.split(" "),r=n==="700"||n==="bold",a=o.includes("line-through"),s=e.fontStyle==="italic",i=o.includes("underline"),l=e.verticalAlign;return d=>(We(d)&&(r&&!d.hasFormat("bold")&&d.toggleFormat("bold"),a&&!d.hasFormat("strikethrough")&&d.toggleFormat("strikethrough"),s&&!d.hasFormat("italic")&&d.toggleFormat("italic"),i&&!d.hasFormat("underline")&&d.toggleFormat("underline"),l!=="sub"||d.hasFormat("subscript")||d.toggleFormat("subscript"),l!=="super"||d.hasFormat("superscript")||d.toggleFormat("superscript"),t&&!d.hasFormat(t)&&d.toggleFormat(t)),d)}var Hl=class e extends mi{static getType(){return"tab"}static clone(t){return new e(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){let n=super.createDOM(t),o=Fl(t.theme,"tab");return o!==void 0&&n.classList.add(...o),n}static importJSON(t){return Am().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&MR(126),super.setTextContent(" ")}spliceText(t,n,o,r){return o===""&&n===0||o===" "&&n===1||ve(286),this}setDetail(t){return t!==2&&ve(127),this}setMode(t){return t!=="normal"&&ve(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Am(){return Pu(new Hl)}function oC(e){return e instanceof Hl}var My=class{key;offset;type;_selection;constructor(t,n,o){this._selection=null,this.key=t,this.offset=n,this.type=o}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:TC(Cr(vs(this,"next")),Cr(vs(t,"next")))<0}getNode(){let t=bn(this.key);return t===null&&ve(20),t}set(t,n,o,r){let a=this._selection,s=this.key;r&&this.key===t&&this.offset===n&&this.type===o||(this.key=t,this.offset=n,this.type=o,Ql()||(ds()===s&&En(t),a!==null&&(a.setCachedNodes(null),a.dirty=!0)))}};function Ir(e,t,n){return new My(e,t,n)}function ry(e,t){let n=t.__key,o=e.offset,r="element";if(We(t)){r="text";let a=t.getTextContentSize();o>a&&(o=a)}else if(!me(t)){let a=t.getNextSibling();if(We(a))n=a.__key,o=0,r="text";else{let s=t.getParent();s&&(n=s.__key,o=t.getIndexWithinParent()+1)}}e.set(n,o,r)}function aR(e,t){if(me(t)){let n=t.getLastDescendant();me(n)||We(n)?ry(e,n):ry(e,t)}else ry(e,t)}var bm=class e{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Iu(t))return!1;let n=this._nodes,o=t._nodes;return n.size===o.size&&Array.from(n).every(r=>o.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){let n=this.getNodes(),o=n.length,r=n[o-1],a;if(We(r))a=r.select();else{let s=r.getIndexWithinParent()+1;a=r.getParentOrThrow().select(s,s)}a.insertNodes(t);for(let s=0;s<o;s++)n[s].remove()}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=this._nodes,o=[];for(let r of n){let a=bn(r);a!==null&&o.push(a)}return Ql()||(this._cachedNodes=o),o}getTextContent(){let t=this.getNodes(),n="";for(let o=0;o<t.length;o++)n+=t[o].getTextContent();return n}deleteNodes(){let t=this.getNodes();if((Mt()||yi())===this&&t[0]){let n=Nn(t[0],"next");iE(hs(n,n))}for(let n of t)n.remove()}};function tt(e){return e instanceof gi}var gi=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,o,r){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=o,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!tt(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=(function(o){let r=[],[a,s]=o.getTextSlices();a&&r.push(a.caret.origin);let i=new Set,l=new Set;for(let d of o)if(br(d)){let{origin:u}=d;r.length===0?i.add(u):(l.add(u),r.push(u))}else{let{origin:u}=d;me(u)&&l.has(u)||r.push(u)}if(s&&r.push(s.caret.origin),vi(o.focus)&&me(o.focus.origin)&&o.focus.getNodeAtCaret()===null)for(let d=xa(o.focus.origin,"previous");br(d)&&i.has(d.origin)&&!d.origin.isEmpty()&&d.origin.is(r[r.length-1]);d=Gl(d))i.delete(d.origin),r.pop();for(;r.length>1;){let d=r[r.length-1];if(!me(d)||l.has(d)||d.isEmpty()||i.has(d))break;r.pop()}if(r.length===0&&o.isCollapsed()){let d=Cr(o.anchor),u=Cr(o.anchor.getFlipped()),p=m=>Ca(m)?m.origin:m.getNodeAtCaret(),f=p(d)||p(u)||(o.anchor.getNodeAtCaret()?d.origin:u.origin);r.push(f)}return r})(PC(Hy(this),"next"));return Ql()||(this._cachedNodes=n),n}setTextNodeRange(t,n,o,r){this.anchor.set(t.__key,n,"text"),this.focus.set(o.__key,r,"text")}getTextContent(){let t=this.getNodes();if(t.length===0)return"";let n=t[0],o=t[t.length-1],r=this.anchor,a=this.focus,s=r.isBefore(a),[i,l]=Ay(this),d="",u=!0;for(let p=0;p<t.length;p++){let f=t[p];if(me(f)&&!f.isInline())u||(d+=`
3792
3792
  `),u=!f.isEmpty();else if(u=!1,We(f)){let m=f.getTextContent();f===n?f===o?r.type==="element"&&a.type==="element"&&a.offset!==r.offset||(m=i<l?m.slice(i,l):m.slice(l,i)):m=s?m.slice(i):m.slice(l):f===o&&(m=s?m.slice(0,l):m.slice(0,i)),d+=m}else!Qt(f)&&!ui(f)||f===o&&this.isCollapsed()||(d+=f.getTextContent())}return d}applyDOMRange(t){let n=Vt(),o=n.getEditorState()._selection,r=PL(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,o);if(r===null)return;let[a,s]=r;this.anchor.set(a.key,a.offset,a.type,!0),this.focus.set(s.key,s.offset,s.type,!0),pm(this)}clone(){let t=this.anchor,n=this.focus;return new e(Ir(t.key,t.offset,t.type),Ir(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=xu(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){let n=Wn[t];return(this.format&n)!==0}insertRawText(t){let n=t.split(/(\r?\n|\t)/),o=[],r=n.length;for(let a=0;a<r;a++){let s=n[a];s===`
3793
3793
  `||s===`\r
3794
- `?o.push(zl()):s===" "?o.push(Am()):o.push(Rn(s))}this.insertNodes(o)}insertText(t){let n=this.anchor,o=this.focus,r=this.format,a=this.style,s=n,i=o;!this.isCollapsed()&&o.isBefore(n)&&(s=o,i=n),s.type==="element"&&(function(v,C,y,x){let w=v.getNode(),I=w.getChildAtIndex(v.offset),S=Rn();if(S.setFormat(y),S.setStyle(x),OL(I))I.splice(0,0,[S]);else{let k=Fn(w)?ya().append(S):S;I===null?w.append(k):I.insertBefore(k)}v.is(C)&&C.set(S.__key,0,"text"),v.set(S.__key,0,"text")})(s,i,r,a),i.type==="element"&&jl(i,Cr(vs(i,"next")));let l=s.offset,d=i.offset,u=this.getNodes(),p=u.length,f=u[0];We(f)||ve(26);let m=f.getTextContent().length,g=f.getParentOrThrow(),h=u[p-1];if(p===1&&i.type==="element"&&(d=m,i.set(s.key,d,"text")),this.isCollapsed()&&l===m&&(ga(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let v=f.getNextSibling();if(We(v)&&v.canInsertTextBefore()&&!ga(v)||(v=Rn(),v.setFormat(r),v.setStyle(a),g.canInsertTextAfter()?f.insertAfter(v):g.insertAfter(v)),v.select(0,0),f=v,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(ga(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let v=f.getPreviousSibling();if(We(v)&&!ga(v)||(v=Rn(),v.setFormat(r),g.canInsertTextBefore()?f.insertBefore(v):g.insertBefore(v)),v.select(),f=v,t!=="")return void this.insertText(t)}else if(f.isSegmented()&&l!==m){let v=Rn(f.getTextContent());v.setFormat(r),f.replace(v),f=v}else if(!this.isCollapsed()&&t!==""){let v=h.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||me(v)&&(!v.canInsertTextBefore()||!v.canInsertTextAfter()))return this.insertText(""),kL(this.anchor,this.focus),void this.insertText(t)}if(p===1){if(cs(f)){let x=Rn(t);return x.select(),void f.replace(x)}let v=f.getFormat(),C=f.getStyle();if(l!==d||v===r&&C===a){if(oC(f)){let x=Rn(t);return x.setFormat(r),x.setStyle(a),x.select(),void f.replace(x)}}else{if(f.getTextContent()!==""){let x=Rn(t);if(x.setFormat(r),x.setStyle(a),x.select(),l===0)f.insertBefore(x,!1);else{let[w]=f.splitText(l);w.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}f.setFormat(r),f.setStyle(a)}let y=d-l;f=f.spliceText(l,y,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=v,this.style=C,f.isComposing()&&(this.anchor.offset-=t.length))}else{let v=new Set([...f.getParentKeys(),...h.getParentKeys()]),C=me(f)?f:f.getParentOrThrow(),y=me(h)?h:h.getParentOrThrow(),x=h;if(!C.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(i.type==="text"&&(d!==0||h.getTextContent()==="")||i.type==="element"&&h.getIndexWithinParent()<d)if(We(h)&&!cs(h)&&d!==h.getTextContentSize()){if(h.isSegmented()){let P=Rn(h.getTextContent());h.replace(P),h=P}Fn(i.getNode())||i.type!=="text"||(h=h.spliceText(0,d,"")),v.add(h.__key)}else{let P=h.getParentOrThrow();P.canBeEmpty()||P.getChildrenSize()!==1?h.remove():P.remove()}else v.add(h.__key);let w=y.getChildren(),I=new Set(u),S=C.is(y),k=C.isInline()&&f.getNextSibling()===null?C:f;for(let P=w.length-1;P>=0;P--){let T=w[P];if(T.is(f)||me(T)&&T.isParentOf(f))break;T.isAttached()&&(!I.has(T)||T.is(x)?S||k.insertAfter(T,!1):T.remove())}if(!S){let P=y,T=null;for(;P!==null;){let R=P.getChildren(),E=R.length;(E===0||R[E-1].is(T))&&(v.delete(P.__key),T=P),P=P.getParent()}}if(cs(f))if(l===m)f.select();else{let P=Rn(t);P.select(),f.replace(P)}else f=f.spliceText(l,m-l,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=f.getFormat(),this.style=f.getStyle(),f.isComposing()&&(this.anchor.offset-=t.length));for(let P=1;P<p;P++){let T=u[P],R=T.__key;v.has(R)||T.remove()}}}removeText(){let t=Mt()===this;cu(this,lE(Hy(this))),t&&Mt()!==this&&bo(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void En(null);let o=this.getNodes(),r=[];for(let w of o)We(w)&&r.push(w);let a=w=>{o.forEach(I=>{if(me(I)){let S=I.getFormatFlags(t,w);I.setTextFormat(S)}})},s=r.length;if(s===0)return this.toggleFormat(t),En(null),void a(n);let i=this.anchor,l=this.focus,d=this.isBackward(),u=d?l:i,p=d?i:l,f=0,m=r[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===m.getTextContentSize()&&(f=1,m=r[1],g=0),m==null)return;let h=m.getFormatFlags(t,n);a(h);let v=s-1,C=r[v],y=p.type==="text"?p.offset:C.getTextContentSize();if(m.is(C)){if(g===y)return;if(ga(m)||g===0&&y===m.getTextContentSize())m.setFormat(h);else{let w=m.splitText(g,y),I=g===0?w[0]:w[1];I.setFormat(h),u.type==="text"&&u.set(I.__key,0,"text"),p.type==="text"&&p.set(I.__key,y-g,"text")}return void(this.format=h)}g===0||ga(m)||([,m]=m.splitText(g),g=0),m.setFormat(h);let x=C.getFormatFlags(t,h);y>0&&(y===C.getTextContentSize()||ga(C)||([C]=C.splitText(y)),C.setFormat(x));for(let w=f+1;w<v;w++){let I=r[w],S=I.getFormatFlags(t,x);I.setFormat(S)}u.type==="text"&&u.set(m.__key,g,"text"),p.type==="text"&&p.set(C.__key,y,"text"),this.format=h|x}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let g=Mt();return tt(g)||ve(134),g.insertNodes(t)}let n=(this.isBackward()?this.focus:this.anchor).getNode(),o=lu(n,va),r=t[t.length-1];if(me(o)&&"__language"in o){if("__language"in t[0])this.insertText(t[0].getTextContent());else{let g=ay(this);o.splice(g,0,t),r.selectEnd()}return}if(!t.some(g=>(me(g)||Qt(g))&&!g.isInline())){me(o)||ve(211,n.constructor.name,n.getType());let g=ay(this);return o.splice(g,0,t),void r.selectEnd()}let a=(function(g){let h=ya(),v=null;for(let C=0;C<g.length;C++){let y=g[C],x=ui(y);if(x||Qt(y)&&y.isInline()||me(y)&&y.isInline()||We(y)||y.isParentRequired()){if(v===null&&(v=y.createParentElementNode(),h.append(v),x))continue;v!==null&&v.append(y)}else h.append(y),v=null}return h})(t),s=a.getLastDescendant(),i=a.getChildren(),l=!me(o)||!o.isEmpty()?this.insertParagraph():null,d=i[i.length-1],u=i[0];var p;me(p=u)&&va(p)&&!p.isEmpty()&&me(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(me(o)||ve(211,n.constructor.name,n.getType()),o.append(...u.getChildren()),u=i[1]),u&&(o===null&&ve(212,n.constructor.name,n.getType()),(function(g,h){let v=h.getParentOrThrow().getLastChild(),C=h,y=[h];for(;C!==v;)C.getNextSibling()||ve(140),C=C.getNextSibling(),y.push(C);let x=g;for(let w of y)x=x.insertAfter(w)})(o,u));let f=lu(s,va);l&&me(f)&&(l.canMergeWhenEmpty()||va(d))&&(f.append(...l.getChildren()),l.remove()),me(o)&&o.isEmpty()&&o.remove(),s.selectEnd();let m=me(o)?o.getLastChild():null;ui(m)&&f!==o&&m.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=ya();return zo().splice(this.anchor.offset,0,[s]),s.select(),s}let t=ay(this),n=lu(this.anchor.getNode(),va);me(n)||ve(213);let o=n.getChildAtIndex(t),r=o?[o,...o.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...r),a.selectStart(),a):null}insertLineBreak(t){let n=zl();if(this.insertNodes([n]),t){let o=n.getParentOrThrow(),r=n.getIndexWithinParent();o.select(r,r)}}extract(){let t=[...this.getNodes()],n=t.length,o=t[0],r=t[n-1],[a,s]=Ay(this),i=this.isBackward(),[l,d]=i?[this.focus,this.anchor]:[this.anchor,this.focus],[u,p]=i?[s,a]:[a,s];if(n===0)return[];if(n===1){if(We(o)&&!this.isCollapsed()){let f=o.splitText(u,p),m=u===0?f[0]:f[1];return m?(l.set(m.getKey(),0,"text"),d.set(m.getKey(),m.getTextContentSize(),"text"),[m]):[]}return[o]}if(We(o)&&(u===o.getTextContentSize()?t.shift():u!==0&&([,o]=o.splitText(u),t[0]=o,l.set(o.getKey(),0,"text"))),We(r)){let f=r.getTextContent().length;p===0?t.pop():p!==f&&([r]=r.splitText(p),t[t.length-1]=r,d.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,n,o){if(mR(this,t,n,o))return;let r=t==="move",a=Vt(),s=Tr(Ho(a));if(!s)return;let i=a._blockCursorElement,l=a._rootElement,d=this.focus.getNode();if(l===null||i===null||!me(d)||d.isInline()||d.canBeEmpty()||Dy(i,a,l),this.dirty){let u=$l(a,this.anchor.key),p=$l(a,this.focus.key);this.anchor.type==="text"&&(u=hi(u)),this.focus.type==="text"&&(p=hi(p)),u&&p&&EL(s,u,this.anchor.offset,p,this.focus.offset)}if((function(u,p,f,m){u.modify(p,f,m)})(s,t,n?"backward":"forward",o),s.rangeCount>0){let u=s.getRangeAt(0),p=this.anchor.getNode(),f=Fn(p)?p:JL(p);if(this.applyDOMRange(u),this.dirty=!0,!r){let m=this.getNodes(),g=[],h=!1;for(let v=0;v<m.length;v++){let C=m[v];km(C,f)?g.push(C):h=!0}if(h&&g.length>0)if(n){let v=g[0];me(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{let v=g[g.length-1];me(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(v){let C=v.focus,y=v.anchor,x=y.key,w=y.offset,I=y.type;y.set(C.key,C.offset,C.type,!0),C.set(x,w,I,!0)})(this)}}o==="lineboundary"&&mR(this,t,n,o,"decorators")}forwardDeletion(t,n,o){if(!o&&(t.type==="element"&&me(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){let r=n.getParent(),a=n.getNextSibling()||(r===null?null:r.getNextSibling());if(me(a)&&a.isShadowRoot())return!0}return!1}deleteCharacter(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t))return;let a=IC(vs(o,t?"previous":"next"));if(a.getTextSlices().every(i=>i===null||i.distance===0)){let i={type:"initial"};for(let l of a.iterNodeCarets("shadowRoot"))if(br(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(i.type==="merge-block")break;if(me(a.anchor.origin)&&a.anchor.origin.isEmpty()){let d=Cr(l);cu(this,hs(d,d)),a.anchor.origin.remove()}return}i.type!=="merge-next-block"&&i.type!=="merge-block"||(i={block:i.block,caret:l,type:"merge-block"})}}else{if(i.type==="merge-block")break;if(vi(l)){if(me(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(a.anchor.origin))break}else i={block:l.origin,type:"merge-next-block"};continue}if(Qt(l.origin)){if(!l.origin.isIsolated())if(i.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&me(a.anchor.origin)&&a.anchor.origin.isEmpty()){a.anchor.origin.remove();let d=rC();d.add(l.origin.getKey()),bo(d)}else l.origin.remove();return}break}}if(i.type==="merge-block"){let{caret:l,block:d}=i;return cu(this,hs(!l.origin.isEmpty()&&d.isEmpty()?Xl(Nn(d,l.direction)):a.anchor,l)),this.removeText()}}let s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&o.offset===0&&iR(this,o.getNode()))return}else{let i=s.type==="text"?s.getNode():null;if(r=o.type==="text"?o.getNode():null,i!==null&&i.isSegmented()){let l=s.offset,d=i.getTextContentSize();if(i.is(r)||t&&l!==d||!t&&l!==0)return void lR(i,t,l)}else if(r!==null&&r.isSegmented()){let l=o.offset,d=r.getTextContentSize();if(r.is(i)||t&&l!==0||!t&&l!==d)return void lR(r,t,l)}(function(l,d){let u=l.anchor,p=l.focus,f=u.getNode(),m=p.getNode();if(f===m&&u.type==="text"&&p.type==="text"){let g=u.offset,h=p.offset,v=g<h,C=v?g:h,y=v?h:g,x=y-1;C!==x&&(function(w){return!(VL(w)||qV(w))})(f.getTextContent().slice(C,y))&&(d?p.set(p.key,x,p.type):u.set(u.key,x,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let o=this.anchor.getNode();o.isEmpty()&&Fn(o.getParent())&&o.getPreviousSibling()===null&&iR(this,o)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){let n=this.anchor,o=n.getNode();if(this.forwardDeletion(n,o,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Iu(e){return e instanceof bm}function sR(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Ay(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[sR(n),sR(o)]}function iR(e,t){for(let n=t;n;n=n.getParent()){if(me(n)){if(n.collapseAtStart(e))return!0;if(or(n))break}if(n.getPreviousSibling())break}return!1}var qV=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("\u2764\uFE0F")&&t("#\uFE0F\u20E3")&&t("\u{1F44D}"))return t}catch{}return()=>!1})();function lR(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),a=r.length,s=0,i=0;for(let d=0;d<a;d++){let u=d===a-1;if(i=s,s+=r[d].length,t&&s===n||s>n||u){r.splice(d,1),u&&(i=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(i,i))}function dR(e,t,n,o){let r,a=t;if(ro(e)){let s=!1,i=e.childNodes,l=i.length,d=o._blockCursorElement;a===l&&(s=!0,a=l-1);let u=i[a],p=!1;if(u===d)u=i[a+1],p=!0;else if(d!==null){let f=d.parentNode;e===f&&t>Array.prototype.indexOf.call(f.children,d)&&a--}if(r=_l(u),We(r))a=Sr(r,s?"next":"previous");else{let f=_l(e);if(f===null)return null;if(me(f)){let m=o.getElementByKey(f.getKey());m===null&&ve(214),[f,a]=f.getDOMSlot(m).resolveChildIndex(f,m,e,t),me(f)||ve(215),s&&a>=f.getChildrenSize()&&(a=Math.max(0,f.getChildrenSize()-1));let h=f.getChildAtIndex(a);if(me(h)&&(function(v,C,y){let x=v.getParent();return y===null||x===null||!x.canBeEmpty()||x!==y.getNode()})(h,0,n)){let v=s?h.getLastDescendant():h.getFirstDescendant();v===null?f=h:(h=v,f=me(h)?h:h.getParentOrThrow()),a=0}We(h)?(r=h,f=null,a=Sr(h,s?"next":"previous")):h!==f&&s&&!p&&(me(f)||ve(216),a=Math.min(f.getChildrenSize(),a+1))}else{let m=f.getIndexWithinParent();a=t===0&&Qt(f)&&_l(e)===f?m:m+1,f=f.getParentOrThrow()}if(me(f))return Ir(f.__key,a,"element")}}else r=_l(e);return We(r)?Ir(r.__key,Sr(r,a,"clamp"),"text"):null}function cR(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let a=r.getPreviousSibling(),s=r.getParent();if(t){if((n||!t)&&a===null&&me(s)&&s.isInline()){let i=s.getPreviousSibling();We(i)&&e.set(i.__key,i.getTextContent().length,"text")}}else me(a)&&!n&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):We(a)&&e.set(a.__key,a.getTextContent().length,"text")}else if(o===r.getTextContent().length){let a=r.getNextSibling(),s=r.getParent();if(t&&me(a)&&a.isInline())e.set(a.__key,0,"element");else if((n||t)&&a===null&&me(s)&&s.isInline()&&!s.canInsertTextAfter()){let i=s.getNextSibling();We(i)&&e.set(i.__key,0,"text")}}}function kL(e,t,n){if(e.type==="text"&&t.type==="text"){let o=e.isBefore(t),r=e.is(t);cR(e,o,r),cR(t,!o,r),r&&t.set(e.key,e.offset,e.type)}}function PL(e,t,n,o,r,a){if(e===null||n===null||!wu(r,e,n))return null;let s=dR(e,t,tt(a)?a.anchor:null,r);if(s===null)return null;let i=dR(n,o,tt(a)?a.focus:null,r);if(i===null)return null;if(s.type==="element"&&i.type==="element"){let l=_l(e),d=_l(n);if(Qt(l)&&Qt(d))return null}return kL(s,i),[s,i]}function VV(e){return me(e)&&!e.isInline()}function RL(e,t,n,o,r,a){let s=ba(),i=new gi(Ir(e,t,r),Ir(n,o,a),0,"");return i.dirty=!0,s._selection=i,i}function LL(){let e=Ir("root",0,"element"),t=Ir("root",0,"element");return new gi(e,t,0,"")}function rC(){return new bm(new Set)}function WV(e,t){return Nm(null,e,t,null)}function Nm(e,t,n,o){let r=n._window;if(r===null)return null;let a=o||r.event,s=a?a.type:void 0,i=s==="selectionchange",l=!py&&(i||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&a&&a.detail===3||s==="drop"||s===void 0),d,u,p,f;if(tt(e)&&!l)return e.clone();if(t===null)return null;if(d=t.anchorNode,u=t.focusNode,p=t.anchorOffset,f=t.focusOffset,(i||s===void 0)&&tt(e)&&!wu(n,d,u))return e.clone();let m=PL(d,p,u,f,n,e);if(m===null)return null;let[g,h]=m,v=0,C="";if(tt(e)){let y=e.anchor;if(g.key===y.key)v=e.format,C=e.style;else{let x=g.getNode();We(x)?(v=x.getFormat(),C=x.getStyle()):me(x)&&(v=x.getTextFormat(),C=x.getTextStyle())}}return new gi(g,h,v,C)}function Mt(){return ba()._selection}function yi(){return Vt()._editorState._selection}function Sm(e,t,n,o=1){let r=e.anchor,a=e.focus,s=r.getNode(),i=a.getNode();if(!t.is(s)&&!t.is(i))return;let l=t.__key;if(e.isCollapsed()){let d=r.offset;if(n<=d&&o>0||n<d&&o<0){let u=Math.max(0,d+o);r.set(l,u,"element"),a.set(l,u,"element"),uR(e)}}else{let d=e.isBackward(),u=d?a:r,p=u.getNode(),f=d?r:a,m=f.getNode();if(t.is(p)){let g=u.offset;(n<=g&&o>0||n<g&&o<0)&&u.set(l,Math.max(0,g+o),"element")}if(t.is(m)){let g=f.offset;(n<=g&&o>0||n<g&&o<0)&&f.set(l,Math.max(0,g+o),"element")}}uR(e)}function uR(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,a=t.getNode(),s=o.getNode();if(e.isCollapsed()){if(!me(a))return;let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(We(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text"),o.set(d.__key,u,"text")}return}if(me(a)){let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(We(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text")}}if(me(s)){let i=s.getChildrenSize(),l=r>=i,d=l?s.getChildAtIndex(i-1):s.getChildAtIndex(r);if(We(d)){let u=0;l&&(u=d.getTextContentSize()),o.set(d.__key,u,"text")}}}function Im(e,t,n,o,r){let a=null,s=0,i=null;o!==null?(a=o.__key,We(o)?(s=o.getTextContentSize(),i="text"):me(o)&&(s=o.getChildrenSize(),i="element")):r!==null&&(a=r.__key,We(r)?i="text":me(r)&&(i="element")),a!==null&&i!==null?e.set(a,s,i):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function pR(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function EL(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch{}}function fR(e,t,n){let o=$l(e,t.getKey());if(me(t)){let r=t.getDOMSlot(o);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function GV(e,t,n,o,r,a,s){let i=o.anchorNode,l=o.focusNode,d=o.anchorOffset,u=o.focusOffset,p=document.activeElement;if(r.has(CL)&&p!==a||p!==null&&cC(p))return;if(!tt(t))return void(e!==null&&wu(n,i,l)&&o.removeAllRanges());let f=t.anchor,m=t.focus,g=f.getNode(),h=m.getNode(),[v,C]=fR(n,g,f.offset),[y,x]=fR(n,h,m.offset),w=t.format,I=t.style,S=t.isCollapsed(),k=v,P=y,T=!1;var R,E,D,L,O;if(f.type==="text"?(k=hi(v),T=g.getFormat()!==w||g.getStyle()!==I):tt(e)&&e.anchor.type==="text"&&(T=!0),m.type==="text"&&(P=hi(y)),k!==null&&P!==null&&(S&&(e===null||T||tt(e)&&(e.format!==w||e.style!==I))&&(R=w,E=I,D=C,L=f.key,O=performance.now(),pL=[R,E,D,L,O]),d!==C||u!==x||i!==k||l!==P||o.type==="Range"&&S||(p!==null&&a.contains(p)||r.has(Ey)||a.focus({preventScroll:!0}),f.type==="element"))){if(EL(o,k,C,P,x),!ps||!t.isCollapsed()||a===null||r.has(Ey)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!r.has(xL)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let U=tt(t)&&t.anchor.type==="element"?k.childNodes[C]||null:o.rangeCount>0?o.getRangeAt(0):null;if(U!==null){let F;if(U instanceof Text){let _=document.createRange();_.selectNode(U),F=_.getBoundingClientRect()}else F=U.getBoundingClientRect();(function(_,j,N){let z=vC(N),re=yC(z);if(z===null||re===null)return;let{top:H,bottom:te}=j,q=0,J=0,X=N;for(;X!==null;){let se=X===z.body;if(se)q=0,J=Ho(_).innerHeight;else{let ee=X.getBoundingClientRect();q=ee.top,J=ee.bottom}let ce=0;if(H<q?ce=-(q-H):te>J&&(ce=te-J),ce!==0)if(se)re.scrollBy(0,ce);else{let ee=X.scrollTop;X.scrollTop+=ce;let ne=X.scrollTop-ee;H-=ne,te-=ne}if(se)break;X=ku(X)}})(n,F,a)}}Py=!0}}function jV(e){let t=Mt()||yi();t===null&&(t=zo().selectEnd()),t.insertNodes(e)}function QV(){let e=Mt();return e===null?"":e.getTextContent()}function ay(e){let t=e;e.isCollapsed()||t.removeText();let n=Mt();tt(n)&&(t=n),tt(t)||ve(161);let o=t.anchor,r=o.getNode(),a=o.offset;for(;!va(r);){let s=r;if([r,a]=YV(r,a),s.is(r))break}return a}function YV(e,t){let n=e.getParent();if(!n){let r=ya();return zo().append(r),r.select(),[zo(),0]}if(We(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let a=t===0?0:1;return[n,r[0].getIndexWithinParent()+a]}if(!me(e)||t===0)return[n,e.getIndexWithinParent()];let o=e.getChildAtIndex(t);if(o){let r=new gi(Ir(e.__key,t,"element"),Ir(e.__key,t,"element"),0,""),a=e.insertNewAfter(r);a&&a.append(o,...o.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function mR(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[u,p]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return p.set(u.key,u.offset,u.type),!0}let a=vs(e.focus,n?"previous":"next"),s=o==="lineboundary",i=t==="move",l=a,d=r==="decorators-and-blocks";if(!dE(l)){for(let u of l){d=!1;let{origin:p}=u;if(!Qt(p)||p.isIsolated()||(l=u,!s||!p.isInline()))break}if(d)for(let u of IC(a).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(br(u))u.origin.isInline()||(l=u);else{if(me(u.origin))continue;Qt(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===a)return!1;if(i&&!s&&Qt(l.origin)&&l.origin.isKeyboardSelectable()){let u=rC();return u.add(l.origin.getKey()),bo(u),!0}return l=Cr(l),i&&jl(e.anchor,l),jl(e.focus,l),d||!s}var Mn=null,An=null,xo=!1,sy=!1,dm=0,gR={characterData:!0,childList:!0,subtree:!0};function Ql(){return xo||Mn!==null&&Mn._readOnly}function Ln(){xo&&ve(13)}function ML(){dm>99&&ve(14)}function ba(){return Mn===null&&ve(195,AL()),Mn}function Vt(){return An===null&&ve(196,AL()),An}function AL(){let e=0,t=new Set,n=ms.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let a=Tu(r);if(Dm(a))e++;else if(a){let s=String(a.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function XV(){return An}function hR(e,t,n){let o=t.__type,r=lC(e,o),a=n.get(o);a===void 0&&(a=Array.from(r.transforms),n.set(o,a));let s=a.length;for(let i=0;i<s&&(a[i](t),t.isAttached());i++);}function vR(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function NL(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function JV(e){return aC(e,Vt()._nodes)}function aC(e,t){let n=e.type,o=t.get(n);o===void 0&&ve(17,n);let r=o.klass;e.type!==r.getType()&&ve(18,r.name);let a=r.importJSON(e),s=e.children;if(me(a)&&Array.isArray(s))for(let i=0;i<s.length;i++){let l=aC(s[i],t);a.append(l)}return a}function yR(e,t,n){let o=Mn,r=xo,a=An;Mn=t,xo=!0,An=e;try{return n()}finally{Mn=o,xo=r,An=a}}function ha(e,t){let n=e._pendingEditorState,o=e._rootElement,r=e._headless||o===null;if(n===null)return;let a=e._editorState,s=a._selection,i=n._selection,l=e._dirtyType!==0,d=Mn,u=xo,p=An,f=e._updating,m=e._observer,g=null;if(e._pendingEditorState=null,e._editorState=n,!r&&l&&m!==null){An=e,Mn=n,xo=!1,e._updating=!0;try{let S=e._dirtyType,k=e._dirtyElements,P=e._dirtyLeaves;m.disconnect(),g=vV(a,n,e,S,k,P)}catch(S){if(S instanceof Error&&e._onError(S),sy)throw S;return FL(e,null,o,n),BR(e),e._dirtyType=2,sy=!0,ha(e,a),void(sy=!1)}finally{m.observe(o,gR),e._updating=f,Mn=d,xo=u,An=p}}n._readOnly||(n._readOnly=!0);let h=e._dirtyLeaves,v=e._dirtyElements,C=e._normalizedNodes,y=e._updateTags,x=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(S,k){let P=S._decorators,T=S._pendingDecorators||P,R=k._nodeMap,E;for(E in T)R.has(E)||(T===P&&(T=$L(S)),delete T[E])})(e,n);let w=r?null:Tr(Ho(e));if(e._editable&&w!==null&&(l||i===null||i.dirty||!i.is(s))&&o!==null&&!y.has(bL)){An=e,Mn=n;try{if(m!==null&&m.disconnect(),l||i===null||i.dirty){let S=e._blockCursorElement;S!==null&&Dy(S,e,o),GV(s,i,e,w,y,o)}(function(S,k,P){let T=S._blockCursorElement;if(tt(P)&&P.isCollapsed()&&P.anchor.type==="element"&&k.contains(document.activeElement)){let R=P.anchor,E=R.getNode(),D=R.offset,L=!1,O=null;if(D===E.getChildrenSize())ly(E.getChildAtIndex(D-1))&&(L=!0);else{let U=E.getChildAtIndex(D);if(U!==null&&ly(U)){let F=U.getPreviousSibling();(F===null||ly(F))&&(L=!0,O=S.getElementByKey(U.__key))}}if(L){let U=S.getElementByKey(E.__key);return T===null&&(S._blockCursorElement=T=(function(F){let _=F.theme,j=document.createElement("div");j.contentEditable="false",j.setAttribute("data-lexical-cursor","true");let N=_.blockCursor;if(N!==void 0){if(typeof N=="string"){let z=Lu(N);N=_.blockCursor=z}N!==void 0&&j.classList.add(...N)}return j})(S._config)),k.style.caretColor="transparent",void(O===null?U.appendChild(T):U.insertBefore(T,O))}}T!==null&&Dy(T,S,k)})(e,o,i)}finally{m!==null&&m.observe(o,gR),An=p,Mn=d}}g!==null&&(function(S,k,P,T,R){let E=Array.from(S._listeners.mutation),D=E.length;for(let L=0;L<D;L++){let[O,U]=E[L];for(let F of U){let _=k.get(F);_!==void 0&&O(_,{dirtyLeaves:T,prevEditorState:R,updateTags:P})}}})(e,g,y,h,a),tt(i)||i===null||s!==null&&s.is(i)||e.dispatchCommand(Vy,void 0);let I=e._pendingDecorators;I!==null&&(e._decorators=I,e._pendingDecorators=null,iu("decorator",e,!0,I)),(function(S,k,P){let T=SR(k),R=SR(P);T!==R&&iu("textcontent",S,!0,R)})(e,t||a,n),iu("update",e,!0,{dirtyElements:v,dirtyLeaves:h,editorState:n,mutatedNodes:g,normalizedNodes:C,prevEditorState:t||a,tags:y}),(function(S,k){if(S._deferred=[],k.length!==0){let P=S._updating;S._updating=!0;try{for(let T=0;T<k.length;T++)k[T]()}finally{S._updating=P}}})(e,x),(function(S){let k=S._updates;if(k.length!==0){let P=k.shift();if(P){let[T,R]=P;_m(S,T,R)}}})(e)}function iu(e,t,n,...o){let r=t._updating;t._updating=n;try{let a=Array.from(t._listeners[e]);for(let s=0;s<a.length;s++)a[s].apply(null,o)}finally{t._updating=r}}function CR(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[a,s]=r,i=e._pendingEditorState,l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(o=!0),s.discrete&&(i===null&&ve(191),i._flushSync=!0),l&&e._deferred.push(l),NL(e,s.tag)),i==null?_m(e,a,s):a()}}return o}function _m(e,t,n){let o=e._updateTags,r,a=!1,s=!1;n!==void 0&&(r=n.onUpdate,NL(e,n.tag),a=n.skipTransforms||!1,s=n.discrete||!1),r&&e._deferred.push(r);let i=e._editorState,l=e._pendingEditorState,d=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=_L(l||i),d=!0),l._flushSync=s;let u=Mn,p=xo,f=An,m=e._updating;Mn=l,xo=!1,e._updating=!0,An=e;let g=e._headless||e.getRootElement()===null;iC(null);try{d&&(g?i._selection!==null&&(l._selection=i._selection.clone()):l._selection=(function(y,x){let w=y.getEditorState()._selection,I=Tr(Ho(y));return tt(w)||w==null?Nm(w,I,y,x):w.clone()})(e,n&&n.event||null));let v=e._compositionKey;t(),a=CR(e,a),(function(y,x){let w=x.getEditorState()._selection,I=y._selection;if(tt(I)){let S=I.anchor,k=I.focus,P;if(S.type==="text"&&(P=S.getNode(),P.selectionTransform(w,I)),k.type==="text"){let T=k.getNode();P!==T&&T.selectionTransform(w,I)}}})(l,e),e._dirtyType!==0&&(a?(function(y,x){let w=x._dirtyLeaves,I=y._nodeMap;for(let S of w){let k=I.get(S);We(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&GP(k)}})(l,e):(function(y,x){let w=x._dirtyLeaves,I=x._dirtyElements,S=y._nodeMap,k=ds(),P=new Map,T=w,R=T.size,E=I,D=E.size;for(;R>0||D>0;){if(R>0){x._dirtyLeaves=new Set;for(let L of T){let O=S.get(L);We(O)&&O.isAttached()&&O.isSimpleText()&&!O.isUnmergeable()&&GP(O),O!==void 0&&vR(O,k)&&hR(x,O,P),w.add(L)}if(T=x._dirtyLeaves,R=T.size,R>0){dm++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,E.delete("root")&&E.set("root",!0);for(let L of E){let O=L[0],U=L[1];if(I.set(O,U),!U)continue;let F=S.get(O);F!==void 0&&vR(F,k)&&hR(x,F,P)}T=x._dirtyLeaves,R=T.size,E=x._dirtyElements,D=E.size,dm++}x._dirtyLeaves=w,x._dirtyElements=I})(l,e),CR(e),(function(y,x,w,I){let S=y._nodeMap,k=x._nodeMap,P=[];for(let[T]of I){let R=k.get(T);R!==void 0&&(R.isAttached()||(me(R)&&DR(R,T,S,k,P,I),S.has(T)||I.delete(T),P.push(T)))}for(let T of P)k.delete(T);for(let T of w){let R=k.get(T);R===void 0||R.isAttached()||(S.has(T)||w.delete(T),k.delete(T))}})(i,l,e._dirtyLeaves,e._dirtyElements)),v!==e._compositionKey&&(l._flushSync=!0);let C=l._selection;if(tt(C)){let y=l._nodeMap,x=C.anchor.key,w=C.focus.key;y.get(x)!==void 0&&y.get(w)!==void 0||ve(19)}else Iu(C)&&C._nodes.size===0&&(l._selection=null)}catch(v){return v instanceof Error&&e._onError(v),e._pendingEditorState=i,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ha(e)}finally{Mn=u,xo=p,An=f,e._updating=m,dm=0}e._dirtyType!==0||e._deferred.length>0||(function(v,C){let y=C.getEditorState()._selection,x=v._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,ha(e)):d&&i4(()=>{ha(e)}):(l._flushSync=!1,d&&(o.clear(),e._deferred=[],e._pendingEditorState=null))}function $r(e,t,n){An===e&&n===void 0?t():_m(e,t,n)}var Ny=class e{element;before;after;constructor(t,n,o){this.element=t,this.before=n||null,this.after=o||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(t){let n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&ve(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&ve(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&ve(224),this.element.replaceChild(t,n),this}getFirstChild(){let t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{let n=t==="decorator"&&(Lm||Su||Rm);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let t=this.getManagedLineBreak();if(t){let n=this.element,o=t.nodeName==="IMG"?t.nextSibling:null;o&&n.removeChild(o),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){let n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before,a=document.createElement("br");if(o.insertBefore(a,r),t){let s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",o.insertBefore(s,a),o.__lexicalLineBreak=s}else o.__lexicalLineBreak=a}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,o,r){if(o===this.element){let l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,r))]}let a=xR(n,o);a.push(r);let s=xR(n,this.element),i=t.getIndexWithinParent();for(let l=0;l<s.length;l++){let d=a[l],u=s[l];if(d===void 0||d<u)break;if(d>u){i+=1;break}}return[t.getParentOrThrow(),i]}};function xR(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let a=o.previousSibling;a!==null;a=a.previousSibling)r++;n.push(r)}return o!==e&&ve(225),n.reverse()}var fs=class extends nr{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),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=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let t=this.getFormat();return oV[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let t=Vt()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){let t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){let t=[],n=this.getFirstChild();for(;n!==null;){if(We(n)&&t.push(n),me(n)){let o=n.getAllTextNodes();t.push(...o)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;me(t);){let n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;me(t);){let n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){let n=this.getChildren(),o=n.length;if(t>=o){let a=n[o-1];return me(a)&&a.getLastDescendant()||a||null}let r=n[t];return me(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let t=this.getLatest().__first;return t===null?null:bn(t)}getFirstChildOrThrow(){let t=this.getFirstChild();return t===null&&ve(45,this.__key),t}getLastChild(){let t=this.getLatest().__last;return t===null?null:bn(t)}getLastChildOrThrow(){let t=this.getLastChild();return t===null&&ve(96,this.__key),t}getChildAtIndex(t){let n=this.getChildrenSize(),o,r;if(t<n/2){for(o=this.getFirstChild(),r=0;o!==null&&r<=t;){if(r===t)return o;o=o.getNextSibling(),r++}return null}for(o=this.getLastChild(),r=n-1;o!==null&&r>=t;){if(r===t)return o;o=o.getPreviousSibling(),r--}return null}getTextContent(){let t="",n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContent(),me(a)&&r!==o-1&&!a.isInline()&&(t+=Em)}return t}getTextContentSize(){let t=0,n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContentSize(),me(a)&&r!==o-1&&!a.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){let n=uy[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){let n=Wn[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return xu(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){Ln();let o=Mt(),r=t,a=n,s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){let l=this.getFirstChild();if(We(l)||me(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){let l=this.getLastChild();if(We(l)||me(l))return l.select()}}r===void 0&&(r=s),a===void 0&&(a=s);let i=this.__key;return tt(o)?(o.anchor.set(i,r,"element"),o.focus.set(i,a,"element"),o.dirty=!0,o):RL(i,r,i,a,"element","element")}selectStart(){let t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){let t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){let t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){let n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?uy[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){let n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){let n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,o){xm(this)&&ve(324,this.__key,this.__type);let r=this.getChildrenSize(),a=this.getWritable();t+n<=r||ve(226,String(t),String(n),String(r));let s=a.__key,i=[],l=[],d=this.getChildAtIndex(t+n),u=null,p=r-n+o.length;if(t!==0)if(t===r)u=this.getLastChild();else{let m=this.getChildAtIndex(t);m!==null&&(u=m.getPreviousSibling())}if(n>0){let m=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){m===null&&ve(100);let h=m.getNextSibling(),v=m.__key;us(m.getWritable()),l.push(v),m=h}}let f=u;for(let m of o){f!==null&&m.is(f)&&(u=f=f.getPreviousSibling());let g=m.getWritable();g.__parent===s&&p--,us(g);let h=m.__key;if(f===null)a.__first=h,g.__prev=null;else{let v=f.getWritable();v.__next=h,g.__prev=v.__key}m.__key===s&&ve(76),g.__parent=s,i.push(h),f=m}if(t+n===r)f!==null&&(f.getWritable().__next=null,a.__last=f.__key);else if(d!==null){let m=d.getWritable();if(f!==null){let g=f.getWritable();m.__prev=f.__key,g.__next=d.__key}else m.__prev=null}if(a.__size=p,l.length){let m=Mt();if(tt(m)){let g=new Set(l),h=new Set(i),{anchor:v,focus:C}=m;bR(v,g,h)&&Im(v,v.getNode(),this,u,d),bR(C,g,h)&&Im(C,C.getNode(),this,u,d),p!==0||this.canBeEmpty()||or(this)||this.remove()}}return a}getDOMSlot(t){return new Ny(t)}exportDOM(t){let{element:n}=super.exportDOM(t);if(ro(n)){let o=this.getIndent();o>0&&(n.style.paddingInlineStart=40*o+"px");let r=this.getDirection();r&&(n.dir=r)}return{element:n}}exportJSON(){let t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),o=this.getTextStyle();return n===0&&o===""||or(this)||this.getChildren().some(We)||(n!==0&&(t.textFormat=n),o!==""&&(t.textStyle=o)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,o){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){let o=this.getDOMSlot(t),r=o.getFirstChild();for(let a=this.getFirstChild();a;a=a.getNextSibling()){let s=n.getElementByKey(a.getKey());s!==null&&(r==null?(o.insertChild(s),r=s):r!==s&&o.replaceChild(s,r),r=r.nextSibling)}}};function me(e){return e instanceof fs}function bR(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}var yu=class extends nr{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Qt(e){return e instanceof yu}var Ul=class e extends fs{__cachedText;static getType(){return"root"}static clone(){return new e}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){ve(51)}getTextContent(){let t=this.__cachedText;return!Ql()&&Vt()._dirtyType!==0||t===null?super.getTextContent():t}remove(){ve(52)}replace(t){ve(53)}insertBefore(t){ve(54)}insertAfter(t){ve(55)}updateDOM(t,n){return!1}splice(t,n,o){for(let r of o)me(r)||Qt(r)||ve(282);return super.splice(t,n,o)}static importJSON(t){return zo().updateFromJSON(t)}collapseAtStart(){return!0}};function Fn(e){return e instanceof Ul}function _L(e){return new Cu(new Map(e._nodeMap))}function sC(){return new Cu(new Map([["root",new Ul]]))}function DL(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&ve(130,n.name),me(e)){let o=t.children;Array.isArray(o)||ve(59,n.name);let r=e.getChildren();for(let a=0;a<r.length;a++){let s=DL(r[a]);o.push(s)}}return t}function ZV(e){return e instanceof Cu}var Cu=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return yR(n&&n.editor||null,this,t)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return yR(null,this,()=>({root:DL(zo())}))}},wm=class extends fs{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}},Kl=class e extends fs{static getType(){return"paragraph"}static clone(t){return new e(t.__key)}createDOM(t){let n=document.createElement("p"),o=Fl(t.theme,"paragraph");return o!==void 0&&n.classList.add(...o),n}updateDOM(t,n,o){return!1}static importDOM(){return{p:t=>({conversion:e4,priority:0})}}exportDOM(t){let{element:n}=super.exportDOM(t);if(ro(n)){this.isEmpty()&&n.append(document.createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o)}return{element:n}}static importJSON(t){return ya().updateFromJSON(t)}exportJSON(){let t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(We);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){let o=ya();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){let t=this.getChildren();if(t.length===0||We(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function e4(e){let t=ya();if(e.style&&(t.setFormat(e.style.textAlign),oE(e,t)),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in uy&&t.setFormat(n)}return{node:t}}function ya(){return Pu(new Kl)}function OL(e){return e instanceof Kl}var Nl=0,t4=1,n4=2,o4=3,r4=4;function FL(e,t,n,o){let r=e._keyToDOMMap;r.clear(),e._editorState=sC(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",r.set("root",n))}function BL(e){let t=new Set,n=new Set,o=e;for(;o;){let{ownNodeConfig:r}=Ru(o),a=o.transform;if(!n.has(a)){n.add(a);let s=o.transform();s&&t.add(s)}if(r){let s=r.$transform;s&&t.add(s),o=r.extends}else{let s=Object.getPrototypeOf(o);o=s.prototype instanceof nr&&s!==nr?s:void 0}}return t}function a4(e){let t=e||{},n=XV(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,s=sC(),i=t.namespace||(r!==null?r._config.namespace:WL()),l=t.editorState,d=[Ul,mi,Bl,Hl,Kl,wm,...t.nodes||[]],{onError:u,html:p}=t,f=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let h=0;h<d.length;h++){let v=d[h],C=null,y=null;if(typeof v!="function"){let I=v;v=I.replace,C=I.with,y=I.withKlass||null}Ru(v);let x=v.getType(),w=BL(v);m.set(x,{exportDOM:p&&p.export?p.export.get(v):void 0,klass:v,replace:C,replaceWithKlass:y,sharedNodeState:zR(d[h]),transforms:w})}}let g=new ms(s,r,m,{disableEvents:a,namespace:i,theme:o},u||console.error,(function(h,v){let C=new Map,y=new Set,x=w=>{Object.keys(w).forEach(I=>{let S=C.get(I);S===void 0&&(S=[],C.set(I,S)),S.push(w[I])})};return h.forEach(w=>{let I=w.klass.importDOM;if(I==null||y.has(I))return;y.add(I);let S=I.call(w.klass);S!==null&&x(S)}),v&&x(v),C})(m,p?p.import:void 0),f,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(h){h.registerCommand(Wy,PV,Nl),h.registerCommand(Gy,RV,Nl),h.registerCommand(jy,LV,Nl),h.registerCommand(Qy,EV,Nl),h.registerCommand(Zy,MV,Nl)})(g),g}var ms=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,o,r,a,s,i,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=o,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=WL(),this._onError=a,this._htmlConversions=s,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){let n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){let n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){let n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){let n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){let n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,o){o===void 0&&ve(35);let r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);let a=r.get(t);a===void 0&&ve(36,String(t));let s=a[o];return s.add(n),()=>{s.delete(n),a.every(i=>i.size===0)&&r.delete(t)}}registerMutationListener(t,n,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,a=this._listeners.mutation,s=a.get(n);s===void 0&&(s=new Set,a.set(n,s)),s.add(r);let i=o&&o.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(n,r),()=>{s.delete(r),s.size===0&&a.delete(n)}}getRegisteredNode(t){let n=this._nodes.get(t.getType());return n===void 0&&ve(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){let o=this._editorState,r=Fy(o).get(n.getType());if(!r)return;let a=new Map;for(let s of r.keys())a.set(s,"created");a.size>0&&t(a,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){let o=this.getRegisteredNode(t);return o.transforms.add(n),o}registerNodeTransform(t,n){let o=this.registerNodeTransformToKlass(t,n),r=[o],a=o.replaceWithKlass;if(a!=null){let s=this.registerNodeTransformToKlass(a,n);r.push(s)}return(function(s,i){let l=Fy(s.getEditorState()),d=[];for(let u of i){let p=l.get(u);p&&d.push(p)}d.length!==0&&s.update(()=>{for(let u of d)for(let p of u.keys()){let f=bn(p);f&&f.markDirty()}},s._pendingEditorState===null?{tag:lm}:void 0)})(this,r.map(s=>s.klass.getType())),()=>{r.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Oe(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let n=this._rootElement;if(t!==n){let o=Fl(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,FL(this,n,t,r),n!==null&&(this._config.disableEvents||AV(n),o!=null&&n.classList.remove(...o)),t!==null){let a=yC(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=a,this._dirtyType=2,BR(this),this._updateTags.add(lm),ha(this),this._config.disableEvents||(function(i,l){let d=i.ownerDocument;ky.set(i,d);let u=ym.get(d)??0;u<1&&d.addEventListener("selectionchange",vL),ym.set(d,u+1),i.__lexicalEditor=l;let p=hL(i);for(let f=0;f<Ty.length;f++){let[m,g]=Ty[f],h=typeof g=="function"?v=>{eR(v)||(ZP(v),(l.isEditable()||m==="click")&&g(v,l))}:v=>{if(eR(v))return;ZP(v);let C=l.isEditable();switch(m){case"cut":return C&&Oe(l,tC,v);case"copy":return Oe(l,eC,v);case"paste":return C&&Oe(l,Yy,v);case"dragstart":return C&&Oe(l,rL,v);case"dragover":return C&&Oe(l,aL,v);case"dragend":return C&&Oe(l,sL,v);case"focus":return C&&Oe(l,iL,v);case"blur":return C&&Oe(l,lL,v);case"drop":return C&&Oe(l,oL,v)}};i.addEventListener(m,h),p.push(()=>{i.removeEventListener(m,h)})}})(t,this),o!=null&&t.classList.add(...o)}else this._window=null,this._updateTags.add(lm),ha(this);iu("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&ve(38);let o=t;o._readOnly&&(o=_L(t),o._selection=t._selection?t._selection.clone():null),FR(this);let r=this._pendingEditorState,a=this._updateTags,s=n!==void 0?n.tag:null;r===null||r.isEmpty()||(s!=null&&a.add(s),ha(this)),this._pendingEditorState=o,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&a.add(s),this._updating||ha(this)}parseEditorState(t,n){return(function(o,r,a){let s=sC(),i=Mn,l=xo,d=An,u=r._dirtyElements,p=r._dirtyLeaves,f=r._cloneNotNeeded,m=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,Mn=s,xo=!1,An=r,iC(null);try{let g=r._nodes;aC(o.root,g),a&&a(),s._readOnly=!0}catch(g){g instanceof Error&&r._onError(g)}finally{r._dirtyElements=u,r._dirtyLeaves=p,r._cloneNotNeeded=f,r._dirtyType=m,Mn=i,xo=l,An=d}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return ha(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(o,r,a){o._updating?o._updates.push([r,a]):_m(o,r,a)})(this,t,n)}focus(t,n={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),$r(this,()=>{let r=Mt(),a=zo();r!==null?r.dirty||bo(r.clone()):a.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?a.selectStart():a.selectEnd()),Bm("focus"),XL(()=>{o.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let n=Tr(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,iu("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}};ms.version="0.41.0+prod.esm";var _y=null;function iC(e){_y=e}var zL=1;function s4(){zL=1}function lC(e,t){let n=dC(e,t);return n===void 0&&ve(30,t),n}function dC(e,t){return e._nodes.get(t)}var i4=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function HL(e){return Qt(Fm(e))}function cC(e){let t=document.activeElement;if(!ro(t))return!1;let n=t.nodeName;return Qt(Fm(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&Tu(t)==null)}function wu(e,t,n){let o=e.getRootElement();try{return o!==null&&o.contains(t)&&o.contains(n)&&t!==null&&!cC(t)&&uC(t)===e}catch{return!1}}function Dm(e){return e instanceof ms}function uC(e){let t=e;for(;t!=null;){let n=Tu(t);if(Dm(n))return n;t=ku(t)}return null}function Tu(e){return e?e.__lexicalEditor:null}function l4(e){return eV.test(e)?"rtl":tV.test(e)?"ltr":null}function cs(e){return oC(e)||e.isToken()}function ga(e){return cs(e)||e.isSegmented()}function qr(e){return Yl(e)&&e.nodeType===3}function UL(e){return Yl(e)&&e.nodeType===9}function hi(e){let t=e;for(;t!=null;){if(qr(t))return t;t=t.firstChild}return null}function xu(e,t,n){let o=Wn[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~Wn.superscript:t==="superscript"?r&=~Wn.subscript:t==="lowercase"?(r&=~Wn.uppercase,r&=~Wn.capitalize):t==="uppercase"?(r&=~Wn.lowercase,r&=~Wn.capitalize):t==="capitalize"&&(r&=~Wn.lowercase,r&=~Wn.uppercase),r}function d4(e){return We(e)||ui(e)||Qt(e)}function KL(e,t){let n=(function(){let s=_y;return _y=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);Ln(),ML();let o=Vt(),r=ba(),a=""+zL++;r._nodeMap.set(a,e),me(e)?o._dirtyElements.set(a,!0):o._dirtyLeaves.add(a),o._cloneNotNeeded.add(a),o._dirtyType=1,e.__key=a}function us(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),a=e.getNextSibling(),s=a!==null?a.__key:null,i=r!==null?r.__key:null,l=r!==null?r.getWritable():null,d=a!==null?a.getWritable():null;r===null&&(o.__first=s),a===null&&(o.__last=i),l!==null&&(l.__next=s),d!==null&&(d.__prev=i),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}function Tm(e){ML(),xm(e)&&ve(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,o=ba(),r=Vt(),a=o._nodeMap,s=r._dirtyElements;n!==null&&(function(l,d,u){let p=l;for(;p!==null;){if(u.has(p))return;let f=d.get(p);if(f===void 0)break;u.set(p,!1),p=f.__parent}})(n,a,s);let i=t.__key;r._dirtyType=1,me(e)?s.set(i,!0):r._dirtyLeaves.add(i)}function En(e){Ln();let t=Vt(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=bn(n);o!==null&&o.getWritable()}if(e!==null){let o=bn(e);o!==null&&o.getWritable()}}}function ds(){return Ql()?null:Vt()._compositionKey}function bn(e,t){let n=(t||ba())._nodeMap.get(e);return n===void 0?null:n}function pC(e,t){let n=Om(e,Vt());return n!==void 0?bn(n,t):null}function Om(e,t){return e[`__lexicalKey_${t._key}`]}function Fm(e,t){let n=e;for(;n!=null;){let o=pC(n,t);if(o!==null)return o;n=ku(n)}return null}function $L(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function SR(e){return e.read(()=>zo().getTextContent())}function zo(){return qL(ba())}function qL(e){return e._nodeMap.get("root")}function bo(e){Ln();let t=ba();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function _l(e){let t=Vt(),n=(function(o,r){let a=o;for(;a!=null;){let s=Om(a,r);if(s!==void 0)return s;a=ku(a)}return null})(e,t);return n===null?e===t.getRootElement()?bn("root"):null:bn(n)}function VL(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function fC(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function WL(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function GL(e){return qr(e)?e.nodeValue:null}function mC(e,t,n){let o=Tr(Ho(t));if(o===null)return;let r=o.anchorNode,{anchorOffset:a,focusOffset:s}=o;if(r!==null){let i=GL(r),l=Fm(r);if(i!==null&&We(l)){if((i===uu||i===Ky)&&n){let d=n.length;i=n,a=d,s=d}i!==null&&gC(l,i,a,s,e)}}}function gC(e,t,n,o,r){let a=e;if(a.isAttached()&&(r||!a.isDirty())){let s=a.isComposing(),i=t;if((s||r)&&(t.endsWith(uu)&&(i=t.slice(0,-uu.length)),r)){let d=Ky,u;for(;(u=i.indexOf(d))!==-1;)i=i.slice(0,u)+i.slice(u+d.length),n!==null&&n>u&&(n=Math.max(u,n-d.length)),o!==null&&o>u&&(o=Math.max(u,o-d.length))}let l=a.getTextContent();if(r||i!==l){if(i===""){if(En(null),Rm||Su||Lm)a.remove();else{let h=Vt();setTimeout(()=>{h.update(()=>{a.isAttached()&&a.remove()})},20)}return}let d=a.getParent(),u=yi(),p=a.getTextContentSize(),f=ds(),m=a.getKey();if(a.isToken()||f!==null&&m===f&&!s||tt(u)&&(d!==null&&!d.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===p&&!a.canInsertTextAfter()&&!s))return void a.markDirty();let g=Mt();if(!tt(g)||n===null||o===null)return void IR(a,i,g);if(g.setTextNodeRange(a,n,a,o),a.isSegmented()){let h=Rn(a.getTextContent());a.replace(h),a=h}IR(a,i,g)}}}function IR(e,t,n){if(e.setTextContent(t),tt(n)){let o=e.getKey();for(let r of["anchor","focus"]){let a=n[r];a.type==="text"&&a.key===o&&(a.offset=Sr(e,a.offset,"clamp"))}}}function nm(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function jL(e,t){return nm(e,t,"altKey")&&nm(e,t,"ctrlKey")&&nm(e,t,"shiftKey")&&nm(e,t,"metaKey")}function Ft(e,t,n){if(!jL(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let o="Key"+t.toUpperCase();return e.code===o}var ma={ctrlKey:!yr,metaKey:yr},wR={altKey:yr,ctrlKey:!yr};function TR(e){return e.key==="Backspace"}function kR(e){return Ft(e,"a",ma)}function c4(e){let t=zo();if(tt(e)){let n=e.anchor,o=e.focus,r=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),pm(e),e}{let n=t.select(0,t.getChildrenSize());return bo(pm(n)),n}}function Fl(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let a=Lu(r);return n[t]=a,a}return r}function hC(e,t,n,o,r){if(n.size===0)return;let a=o.__type,s=o.__key,i=t.get(a);i===void 0&&ve(33,a);let l=i.klass,d=e.get(l);d===void 0&&(d=new Map,e.set(l,d));let u=d.get(s),p=u==="destroyed"&&r==="created";(u===void 0||p)&&d.set(s,p?"updated":r)}function u4(e){let t=e.getType(),n=ba();if(n._readOnly){let a=Fy(n).get(t);return a?Array.from(a.values()):[]}let o=n._nodeMap,r=[];for(let[,a]of o)a instanceof e&&a.__type===t&&a.isAttached()&&r.push(a);return r}function PR(e,t,n){let o=e.getParent(),r=n,a=e;return o!==null&&(t&&n===0?(r=a.getIndexWithinParent(),a=o):t||n!==a.getChildrenSize()||(r=a.getIndexWithinParent()+1,a=o)),a.getChildAtIndex(t?r-1:r)}function QL(e,t){let n=e.offset;if(e.type==="element")return PR(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?PR(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function YL(e){let t=Ho(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Oe(e,t,n){return(function(o,r,a){let s=fC(o);for(let i=4;i>=0;i--)for(let l=0;l<s.length;l++){let d=s[l],u=d._commands.get(r);if(u!==void 0){let p=u[i];if(p!==void 0){let f=Array.from(p),m=f.length,g=!1;if($r(d,()=>{for(let h=0;h<m;h++)if(f[h](a,o))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function $l(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&ve(75,t),n}function ku(e){let t=e.assignedSlot||e.parentElement;return tE(t)?t.host:t}function vC(e){return UL(e)?e:ro(e)?e.ownerDocument:null}function p4(e){return Vt()._updateTags.has(e)}function Bm(e){Ln(),Vt()._updateTags.add(e)}function XL(e){Ln(),Vt()._deferred.push(e)}function km(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function yC(e){let t=vC(e);return t?t.defaultView:null}function Ho(e){let t=e._window;return t===null&&ve(78),t}function f4(e){return me(e)&&e.isInline()||Qt(e)&&e.isInline()}function JL(e){let t=e.getParentOrThrow();for(;t!==null;){if(or(t))return t;t=t.getParentOrThrow()}return t}function or(e){return Fn(e)||me(e)&&e.isShadowRoot()}function CC(e){let t=e.constructor.clone(e);return KL(t,null),t.afterCloneFrom(e),t}function Pu(e){let t=Vt(),n=e.getType(),o=dC(t,n);o===void 0&&ve(200,e.constructor.name,n);let{replace:r,replaceWithKlass:a}=o;if(r!==null){let s=r(e),i=s.constructor;return a!==null?s instanceof a||ve(201,a.name,a.getType(),i.name,i.getType(),e.constructor.name,n):s instanceof e.constructor&&i!==e.constructor||ve(202,i.name,i.getType(),e.constructor.name,n),s.__key===e.__key&&ve(203,e.constructor.name,n,i.name,i.getType()),s}return e}function iy(e,t){!Fn(e.getParent())||me(t)||Qt(t)||ve(99)}function ZL(e){let t=bn(e);return t===null&&ve(63,e),t}function ly(e){return(Qt(e)||me(e)&&!e.canBeEmpty())&&!e.isInline()}function Dy(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Tr(e){return wr?(e||window).getSelection():null}function eE(e){let t=yC(e);return t?t.getSelection():null}function m4(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),or(e)&&ve(102);let o=s=>{let i=s.getParentOrThrow(),l=or(i),d=s!==n||l?CC(s):s;if(l)return me(s)&&me(d)||ve(133),s.insertAfter(d),[s,d,d];{let[u,p,f]=o(i),m=s.getNextSiblings();return f.append(d,...m),[u,p,d]}},[r,a]=o(n);return[r,a]}function g4(e){return ro(e)&&e.tagName==="A"}function ro(e){return Yl(e)&&e.nodeType===1}function Yl(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function tE(e){return Yl(e)&&e.nodeType===11}function nE(e){let t=new RegExp(/^(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");return e.nodeName.match(t)!==null}function Oy(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function va(e){if(Qt(e)&&!e.isInline())return!0;if(!me(e)||or(e))return!1;let t=e.getFirstChild(),n=t===null||ui(t)||We(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function xC(){return Vt()}var RR=new WeakMap,h4=new Map;function Fy(e){if(!e._readOnly&&e.isEmpty())return h4;e._readOnly||ve(192);let t=RR.get(e);return t||(t=(function(n){let o=new Map;for(let[r,a]of n._nodeMap){let s=a.__type,i=o.get(s);i||(i=new Map,o.set(s,i)),i.set(r,a)}return o})(e),RR.set(e,t)),t}function bC(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function v4(e){return(t=bC(e))[yL]=!0,t;var t}function oE(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,o=Math.round(n/40);t.setIndent(o)}function y4(e){e.__lexicalUnmanaged=!0}function rE(e){return e.__lexicalUnmanaged===!0}function ou(e,t){return(function(n,o){return Object.prototype.hasOwnProperty.call(n,o)})(e,t)&&e[t]!==nr[t]}function Ru(e){let t=HP in e.prototype?e.prototype[HP]():void 0,n=(function(s){if(!(s===nr||s.prototype instanceof nr)){let i="<unknown>",l="<unknown>";try{i=s.getType()}catch{}try{ms.version&&(l=JSON.parse(ms.version))}catch{}ve(290,s.name,i,l)}return s===yu||s===fs||s===nr})(e),o=!n&&ou(e,"getType")?e.getType():void 0,r,a=o;if(t)if(o)r=t[o];else for(let[s,i]of Object.entries(t))a=s,r=i;if(!n&&a&&(ou(e,"getType")||(e.getType=()=>a),ou(e,"clone")||(e.clone=s=>(iC(s),new e)),ou(e,"importJSON")||(e.importJSON=r&&r.$importJSON||(s=>new e().updateFromJSON(s))),!ou(e,"importDOM")&&r)){let{importDOM:s}=r;s&&(e.importDOM=()=>s)}return{ownNodeConfig:r,ownNodeType:a}}function C4(e){let t=xC();return Ln(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var lu=(e,t)=>{let n=e;for(;n!=null&&!Fn(n);){if(t(n))return n;n=n.getParent()}return null},x4={next:"previous",previous:"next"},ql=class{origin;constructor(t){this.origin=t}[Symbol.iterator](){return wC({hasNext:vi,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Nn(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Nn(this.origin,this.direction)}remove(){let t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){let o=this.getNodeAtCaret();return t.is(this.origin)||t.is(o)||(o===null?this.insert(t):o.replace(t,n)),this}splice(t,n,o="next"){let r=o===this.direction?n:Array.from(n).reverse(),a=this,s=this.getParentAtCaret(),i=new Map;for(let l=a.getAdjacentCaret();l!==null&&i.size<t;l=l.getAdjacentCaret()){let d=l.origin.getWritable();i.set(d.getKey(),d)}for(let l of r){if(i.size>0){let d=a.getNodeAtCaret();if(d){if(i.delete(d.getKey()),i.delete(l.getKey()),!(d.is(l)||a.origin.is(l))){let u=l.getParent();u&&u.is(s)&&l.remove(),d.replace(l)}}else d===null&&ve(263,Array.from(i).join(" "))}else a.insert(l);a=Nn(l,this.direction)}for(let l of i.values())l.remove();return this}},bu=class e extends ql{type="child";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:xa(t,this.direction)}getParentCaret(t="root"){return Nn(SC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return Nn(this.getNodeAtCaret(),t)||xa(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}},b4={root:Fn,shadowRoot:or};function Cs(e){return x4[e]}function SC(e,t="root"){return b4[t](e)?null:e}var Vl=class e extends ql{type="sibling";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:Nn(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return me(this.origin)?xa(this.origin,this.direction):null}getParentCaret(t="root"){return Nn(SC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return Nn(this.getNodeAtCaret(),t)||xa(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Wl)&&this.direction===t.direction&&this.origin.is(t.origin)}},Wl=class e extends ql{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){let t=this.origin.getLatest();return t===this.origin?this:gs(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Nn(SC(this.getParentAtCaret(),t),this.direction)}getFlipped(){return gs(this.origin,Cs(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Vl||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Nn(this.origin,this.direction)}};function Ca(e){return e instanceof Wl}function S4(e){return e instanceof ql}function vi(e){return e instanceof Vl}function br(e){return e instanceof bu}var I4={next:class extends Wl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Wl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},w4={next:class extends Vl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Vl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},T4={next:class extends bu{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends bu{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Nn(e,t){return e?new w4[t](e):null}function gs(e,t,n){return e?new I4[t](e,Sr(e,n)):null}function Sr(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&MR(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function By(e,t){return new Pm(e,t)}function xa(e,t){return me(e)?new T4[t](e):null}function aE(e){return e&&e.getChildCaret()||e}function Gl(e){return e&&aE(e.getAdjacentCaret())}var zy=class e{type="node-caret-range";direction;anchor;focus;constructor(t,n,o){this.anchor=t,this.focus=n,this.direction=o}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let t=r=>{let a=this[r].getLatest();return Ca(a)?(function(s,i){let{direction:l,origin:d}=s,u=Sr(d,i==="focus"?Cs(l):l);return By(s,u-s.offset)})(a,r):null},n=t("anchor"),o=t("focus");if(n&&o){let{caret:r}=n,{caret:a}=o;if(r.isSameNodeCaret(a))return[By(r,a.offset-r.offset),null]}return[n,o]}iterNodeCarets(t="root"){let n=Ca(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=Ca(o),a=s=>s.isSameNodeCaret(o)?null:Gl(s)||s.getParentCaret(t);return wC({hasNext:s=>s!==null&&!(r&&o.isSameNodeCaret(s)),initial:n.isSameNodeCaret(o)?null:a(n),map:s=>s,step:a})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Pm=class{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){let{distance:t,caret:{offset:n}}=this,o=n+t;return o<n?[o,n]:[n,o]}getTextContent(){let[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:t,direction:n}}=this,[o,r]=this.getSliceIndices(),a=t.getTextContent();return gs(t.setTextContent(a.slice(0,o)+a.slice(r)),n,o)}};function k4(e){return e instanceof Pm}function IC(e){return hs(e,Nn(zo(),e.direction))}function sE(e){return hs(e,e)}function hs(e,t){return e.direction!==t.direction&&ve(265),new zy(e,t,e.direction)}function wC(e){let{initial:t,hasNext:n,step:o,map:r}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let s={done:!1,value:r(a)};return a=o(a),s}}}function TC(e,t){let n=du(e.origin,t.origin);switch(n===null&&ve(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?(function(a,s){return Math.sign(a-s)})(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return kC(n)}}function kC(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,a=t,s=n;for(;a&&s;a=a.getNextSibling(),s=s.getNextSibling()){if(a.__key===r)return-1;if(s.__key===o)return 1}return a===null?1:-1}function om(e,t){return t.is(e)}function LR(e){return me(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function du(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=LR(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=LR(t);o;r=o,o=o.getParent()){let a=n.get(o);if(a!==void 0)return a===null?(om(e,o)||ve(276),{commonAncestor:o,type:"ancestor"}):r===null?(om(t,o)||ve(277),{commonAncestor:o,type:"descendant"}):((me(a)||om(e,a))&&(me(r)||om(t,r))&&o.is(a.getParent())&&o.is(r.getParent())||ve(278),{a,b:r,commonAncestor:o,type:"branch"})}return null}function vs(e,t){let{type:n,key:o,offset:r}=e,a=ZL(e.key);return n==="text"?(We(a)||ve(266,a.getType(),o),gs(a,t,r)):(me(a)||ve(267,a.getType(),o),cE(a,e.offset,t))}function jl(e,t){let{origin:n,direction:o}=t,r=o==="next";Ca(t)?e.set(n.getKey(),t.offset,"text"):vi(t)?We(n)?e.set(n.getKey(),Sr(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(br(t)&&me(n)||ve(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function iE(e){let t=Mt(),n=tt(t)?t:LL();return cu(n,e),bo(n),n}function cu(e,t){jl(e.anchor,t.anchor),jl(e.focus,t.focus)}function Hy(e){let{anchor:t,focus:n}=e,o=vs(t,"next"),r=vs(n,"next"),a=TC(o,r)<=0?"next":"previous";return hs(ys(o,a),ys(r,a))}function Xl(e){let{direction:t,origin:n}=e,o=Nn(n,Cs(t)).getNodeAtCaret();return o?Nn(o,t):xa(n.getParentOrThrow(),t)}function ER(e,t="root"){let n=[e];for(let o=br(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Xl(o));return n}function dy(e){return!!e&&e.origin.isAttached()}function lE(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,a=PC(e,o),s=ER(a.anchor,n),i=ER(a.focus.getFlipped(),n),l=new Set,d=[];for(let g of a.iterNodeCarets(n))if(br(g))l.add(g.origin.getKey());else if(vi(g)){let{origin:h}=g;me(h)&&!l.has(h.getKey())||d.push(h)}for(let g of d)g.remove();for(let g of a.getTextSlices()){if(!g)continue;let{origin:h}=g.caret,v=h.getTextContentSize(),C=Xl(Nn(h,o)),y=h.getMode();if(Math.abs(g.distance)===v&&r==="removeEmptySlices"||y==="token"&&g.distance!==0)C.remove();else if(g.distance!==0){r="removeEmptySlices";let x=g.removeTextSlice(),w=g.caret.origin;if(y==="segmented"){let I=x.origin,S=Rn(I.getTextContent()).setStyle(I.getStyle()).setFormat(I.getFormat());C.replaceOrInsert(S),x=gs(S,o,x.offset)}w.is(s[0].origin)&&(s[0]=x),w.is(i[0].origin)&&(i[0]=x.getFlipped())}}let u,p;for(let g of s)if(dy(g)){u=Cr(g);break}for(let g of i)if(dy(g)){p=Cr(g);break}let f=(function(g,h,v){if(!g||!h)return null;let C=g.getParentAtCaret(),y=h.getParentAtCaret();if(!C||!y)return null;let x=C.getParents().reverse();x.push(C);let w=y.getParents().reverse();w.push(y);let I=Math.min(x.length,w.length),S;for(S=0;S<I&&x[S]===w[S];S++);let k=(R,E)=>{let D;for(let L=S;L<R.length;L++){let O=R[L];if(or(O))return;!D&&E(O)&&(D=O)}return D},P=k(x,va),T=P&&k(w,R=>v.has(R.getKey())&&va(R));return P&&T?[P,T]:null})(u,p,l);if(f){let[g,h]=f;xa(g,"previous").splice(0,h.getChildren());let v=h.getParent();for(h.remove(!0);v&&v.isEmpty();){let C=v;v=v.getParent(),C.remove(!0)}}let m=[u,p,...s,...i].find(dy);if(m)return sE(ys(Cr(m),e.direction));ve(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Cr(e){let t=(function(r){let a=r;for(;br(a);){let s=Gl(a);if(!br(s))break;a=s}return a})(e.getLatest()),{direction:n}=t;if(We(t.origin))return Ca(t)?t:gs(t.origin,n,n);let o=t.getAdjacentCaret();return vi(o)&&We(o.origin)?gs(o.origin,n,Cs(n)):t}function dE(e){return Ca(e)&&e.offset!==Sr(e.origin,e.direction)}function ys(e,t){return e.direction===t?e:e.getFlipped()}function PC(e,t){return e.direction===t?e:hs(ys(e.focus,t),ys(e.anchor,t))}function cE(e,t,n){let o=xa(e,"next");for(let r=0;r<t;r++){let a=o.getAdjacentCaret();if(a===null)break;o=a}return ys(o,n)}function P4(e,t="root"){let n=0,o=e,r=Gl(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=Gl(o)}return r&&[r,n]}function R4(e){let{origin:t,offset:n,direction:o}=e;if(n===Sr(t,o))return e.getSiblingCaret();if(n===Sr(t,Cs(o)))return Xl(e.getSiblingCaret());let[r]=t.splitText(n);return We(r)||ve(281),ys(Nn(r,"next"),o)}function L4(e,t){return!0}function E4(e,{$copyElementNode:t=CC,$splitTextPointCaretNext:n=R4,rootMode:o="shadowRoot",$shouldSplit:r=L4}={}){if(Ca(e))return n(e);let a=e.getParentCaret(o);if(a){let{origin:s}=a;if(br(e)&&(!s.canBeEmpty()||!r(s,"first")))return Xl(a);let i=(function(l){let d=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())d.push(u.origin);return d})(e);(i.length>0||s.canBeEmpty()&&r(s,"last"))&&a.insert(t(s).splice(0,0,i))}return a}function M4(e){return e}function A4(...e){return e}function N4(e,t){return[e,t]}function _4(e){return e}function D4(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Lu(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function O4(e,...t){let n=Lu(...t);n.length>0&&e.classList.add(...n)}function F4(e,...t){let n=Lu(...t);n.length>0&&e.classList.remove(...n)}function B4(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var B=RC,lhe=B.$addUpdateTag,xs=B.$applyNodeReplacement,Jl=B.$caretFromPoint,uE=B.$caretRangeFromSelection,zm=B.$cloneWithProperties,pE=B.$cloneWithPropertiesEphemeral,dhe=B.$comparePointCaretNext,che=B.$copyNode,fE=B.$create,Ci=B.$createLineBreakNode,mE=B.$createNodeSelection,rr=B.$createParagraphNode,uhe=B.$createPoint,xi=B.$createRangeSelection,gE=B.$createRangeSelectionFromDom,hE=B.$createTabNode,kr=B.$createTextNode,vE=B.$extendCaretToRange,Sa=B.$findMatchingParent,LC=B.$getAdjacentChildCaret,phe=B.$getAdjacentNode,bi=B.$getAdjacentSiblingOrParentSiblingCaret,EC=B.$getCaretInDirection,yE=B.$getCaretRange,fhe=B.$getCaretRangeInDirection,CE=B.$getCharacterOffsets,bs=B.$getChildCaret,mhe=B.$getChildCaretAtIndex,MC=B.$getChildCaretOrSelf,xE=B.$getCollapsedCaretRange,ghe=B.$getCommonAncestor,hhe=B.$getCommonAncestorResultBranchOrder,Hm=B.$getEditor,vhe=B.$getNearestNodeFromDOMNode,yhe=B.$getNearestRootOrShadowRoot,Zl=B.$getNodeByKey,Che=B.$getNodeByKeyOrThrow,bE=B.$getNodeFromDOMNode,Eu=B.$getPreviousSelection,St=B.$getRoot,Fe=B.$getSelection,Ia=B.$getSiblingCaret,Um=B.$getState,xhe=B.$getStateChange,bhe=B.$getTextContent,She=B.$getTextNodeOffset,Ihe=B.$getTextPointCaret,whe=B.$getTextPointCaretSlice,The=B.$getWritableNodeState,SE=B.$hasAncestor,khe=B.$hasUpdateTag,Phe=B.$insertNodes,ed=B.$isBlockElementNode,Mu=B.$isChildCaret,Km=B.$isDecoratorNode,IE=B.$isEditorState,Ze=B.$isElementNode,wE=B.$isExtendableTextPointCaret,Rhe=B.$isInlineElementOrDecoratorNode,TE=B.$isLeafNode,td=B.$isLineBreakNode,Lhe=B.$isNodeCaret,AC=B.$isNodeSelection,kE=B.$isParagraphNode,Me=B.$isRangeSelection,Au=B.$isRootNode,Si=B.$isRootOrShadowRoot,PE=B.$isSiblingCaret,Ehe=B.$isTabNode,mt=B.$isTextNode,$m=B.$isTextPointCaret,Mhe=B.$isTextPointCaretSlice,NC=B.$isTokenOrSegmented,Ahe=B.$isTokenOrTab,Nhe=B.$nodesOfType,RE=B.$normalizeCaret,LE=B.$normalizeSelection__EXPERIMENTAL,_he=B.$onUpdate,EE=B.$parseSerializedNode,Dhe=B.$removeTextFromCaretRange,ME=B.$rewindSiblingCaret,qm=B.$selectAll,Ohe=B.$setCompositionKey,Fhe=B.$setPointFromCaret,ar=B.$setSelection,AE=B.$setSelectionFromCaretRange,Vm=B.$setState,NE=B.$splitAtPointCaretNext,_E=B.$splitNode,Bhe=B.$updateRangeSelectionFromCaretRange,_C=B.ArtificialNode__DO_NOT_USE,zhe=B.BEFORE_INPUT_COMMAND,DE=B.BLUR_COMMAND,Nu=B.CAN_REDO_COMMAND,_u=B.CAN_UNDO_COMMAND,Wm=B.CLEAR_EDITOR_COMMAND,OE=B.CLEAR_HISTORY_COMMAND,FE=B.CLICK_COMMAND,Hhe=B.COLLABORATION_TAG,Gm=B.COMMAND_PRIORITY_CRITICAL,Yt=B.COMMAND_PRIORITY_EDITOR,sr=B.COMMAND_PRIORITY_HIGH,nd=B.COMMAND_PRIORITY_LOW,Uhe=B.COMMAND_PRIORITY_NORMAL,Khe=B.COMPOSITION_END_COMMAND,BE=B.COMPOSITION_END_TAG,$he=B.COMPOSITION_START_COMMAND,zE=B.COMPOSITION_START_TAG,HE=B.CONTROLLED_TEXT_INSERTION_COMMAND,jm=B.COPY_COMMAND,UE=B.CUT_COMMAND,Qm=B.DELETE_CHARACTER_COMMAND,KE=B.DELETE_LINE_COMMAND,$E=B.DELETE_WORD_COMMAND,qhe=B.DRAGEND_COMMAND,Vhe=B.DRAGOVER_COMMAND,qE=B.DRAGSTART_COMMAND,VE=B.DROP_COMMAND,So=B.DecoratorNode,Whe=B.ElementNode,WE=B.FOCUS_COMMAND,Ghe=B.FORMAT_ELEMENT_COMMAND,GE=B.FORMAT_TEXT_COMMAND,Ym=B.HISTORIC_TAG,Io=B.HISTORY_MERGE_TAG,jE=B.HISTORY_PUSH_TAG,DC=B.INDENT_CONTENT_COMMAND,jhe=B.INPUT_COMMAND,OC=B.INSERT_LINE_BREAK_COMMAND,QE=B.INSERT_PARAGRAPH_COMMAND,YE=B.INSERT_TAB_COMMAND,Du=B.INTERNAL_$isBlock,Qhe=B.IS_ALL_FORMATTING,Yhe=B.IS_BOLD,Xhe=B.IS_CODE,Jhe=B.IS_HIGHLIGHT,Zhe=B.IS_ITALIC,eve=B.IS_STRIKETHROUGH,tve=B.IS_SUBSCRIPT,nve=B.IS_SUPERSCRIPT,ove=B.IS_UNDERLINE,XE=B.KEY_ARROW_DOWN_COMMAND,Xm=B.KEY_ARROW_LEFT_COMMAND,Jm=B.KEY_ARROW_RIGHT_COMMAND,JE=B.KEY_ARROW_UP_COMMAND,Zm=B.KEY_BACKSPACE_COMMAND,ZE=B.KEY_DELETE_COMMAND,eM=B.KEY_DOWN_COMMAND,eg=B.KEY_ENTER_COMMAND,tM=B.KEY_ESCAPE_COMMAND,rve=B.KEY_MODIFIER_COMMAND,ave=B.KEY_SPACE_COMMAND,tg=B.KEY_TAB_COMMAND,nM=B.LineBreakNode,sve=B.MOVE_TO_END,ive=B.MOVE_TO_START,lve=B.NODE_STATE_KEY,oM=B.OUTDENT_CONTENT_COMMAND,ng=B.PASTE_COMMAND,rM=B.PASTE_TAG,aM=B.ParagraphNode,sM=B.REDO_COMMAND,iM=B.REMOVE_TEXT_COMMAND,lM=B.RootNode,dve=B.SELECTION_CHANGE_COMMAND,dM=B.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,cM=B.SELECT_ALL_COMMAND,cve=B.SKIP_COLLAB_TAG,uM=B.SKIP_DOM_SELECTION_TAG,FC=B.SKIP_SCROLL_INTO_VIEW_TAG,uve=B.SKIP_SELECTION_FOCUS_TAG,pM=B.TEXT_TYPE_TO_FORMAT,fM=B.TabNode,og=B.TextNode,mM=B.UNDO_COMMAND,Ou=B.addClassNamesToElement,pve=B.buildImportMap,rg=B.configExtension,gM=B.createCommand,ag=B.createEditor,fve=B.createSharedNodeState,hM=B.createState,vM=B.declarePeerDependency,fn=B.defineExtension,mve=B.flipDirection,gve=B.getDOMOwnerDocument,BC=B.getDOMSelection,hve=B.getDOMSelectionFromTarget,yM=B.getDOMTextNode,vve=B.getEditorPropertyFromDOMNode,yve=B.getNearestEditorFromDOMNode,CM=B.getRegisteredNode,Cve=B.getRegisteredNodeOrThrow,xve=B.getStaticNodeConfig,bve=B.getTextDirection,Sve=B.getTransformSetFromKlass,xM=B.isBlockDomNode,Ive=B.isCurrentlyReadOnlyMode,bM=B.isDOMDocumentNode,SM=B.isDOMNode,wve=B.isDOMTextNode,Tve=B.isDOMUnmanaged,zC=B.isDocumentFragment,kve=B.isExactShortcutMatch,IM=B.isHTMLAnchorElement,sg=B.isHTMLElement,Fu=B.isInlineDomNode,Pve=B.isLexicalEditor,Rve=B.isModifierMatch,Lve=B.isSelectionCapturedInDecoratorInput,wM=B.isSelectionWithinEditor,HC=B.makeStepwiseIterator,Vr=B.mergeRegister,Eve=B.normalizeClassNames,ig=B.removeClassNamesFromElement,Mve=B.removeFromParent,Ave=B.resetRandomKey,Pr=B.safeCast,Nve=B.setDOMUnmanaged,_ve=B.setNodeIndentFromDOM,lg=B.shallowMergeConfig,UC=B.toggleTextFormatType;var KC={};un(KC,{LexicalComposer:()=>H4});V();var TM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,z4=TM?fe:$,dg={tag:Io};function H4({initialConfig:e,children:t}){let n=K(()=>{let{theme:o,namespace:r,nodes:a,onError:s,editorState:i,html:l}=e,d=zP(null,o),u=ag({editable:e.editable,html:l,namespace:r,nodes:a,onError:p=>s(p,u),theme:o});return(function(p,f){if(f!==null){if(f===void 0)p.update(()=>{let m=St();if(m.isEmpty()){let g=rr();m.append(g);let h=TM?document.activeElement:null;(Fe()!==null||h!==null&&h===p.getRootElement())&&g.select()}},dg);else if(f!==null)switch(typeof f){case"string":{let m=p.parseEditorState(f);p.setEditorState(m,dg);break}case"object":p.setEditorState(f,dg);break;case"function":p.update(()=>{St().isEmpty()&&f(p)},dg)}}})(u,i),[u,d]},[]);return z4(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),c(BP.Provider,{value:n,children:t})}var U4=KC,kM=U4.LexicalComposer;var qC={};un(qC,{$canShowPlaceholder:()=>RM,$canShowPlaceholderCurry:()=>$4,$findTextIntersectionFromCharacters:()=>q4,$isRootTextContentEmpty:()=>$C,$isRootTextContentEmptyCurry:()=>K4,$rootTextContent:()=>PM,registerLexicalTextEntity:()=>W4});function PM(){return St().getTextContent()}function $C(e,t=!0){if(e)return!1;let n=PM();return t&&(n=n.trim()),n===""}function K4(e,t){return()=>$C(e,t)}function RM(e){if(!$C(e,!1))return!1;let t=St().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(Km(r))return!1;if(Ze(r)){if(!kE(r)||r.__indent!==0)return!1;let a=r.getChildren(),s=a.length;for(let i=0;i<s;i++){let l=a[o];if(!mt(l))return!1}}}return!0}function $4(e){return()=>RM(e)}function q4(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(Ze(n)){let s=n.getFirstChild();if(s!==null){n=s;continue}}else if(mt(n)){let s=n.getTextContentSize();if(o+s>t)return{node:n,offset:t-o};o+=s}let r=n.getNextSibling();if(r!==null){n=r;continue}let a=n.getParent();for(;a!==null;){let s=a.getNextSibling();if(s!==null){n=s;continue e}a=a.getParent()}break}return null}function V4(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function W4(e,t,n,o){let r=s=>s instanceof n,a=s=>{let i=kr(s.getTextContent());i.setFormat(s.getFormat()),s.replace(i)};return[e.registerNodeTransform(og,s=>{if(!s.isSimpleText())return;let i,l=s.getPreviousSibling(),d=s.getTextContent(),u=s;if(mt(l)){let f=l.getTextContent(),m=t(f+d);if(r(l)){if(m===null||(g=>g.getLatest().__mode)(l)!==0)return void a(l);{let g=m.end-f.length;if(g>0){let h=f+d.slice(0,g);if(l.select(),l.setTextContent(h),g===d.length)s.remove();else{let v=d.slice(g);s.setTextContent(v)}return}}}else if(m===null||m.start<f.length)return}let p=0;for(;;){i=t(d);let f,m=i===null?"":d.slice(i.end);if(d=m,m===""){let h=u.getNextSibling();if(mt(h)){m=u.getTextContent()+h.getTextContent();let v=t(m);if(v===null)return void(r(h)?a(h):h.markDirty());if(v.start!==0)return}}if(i===null)return;if(i.start===0&&mt(l)&&l.isTextEntity()){p+=i.end;continue}i.start===0?[f,u]=u.splitText(i.end):[,f,u]=u.splitText(i.start+p,i.end+p),f===void 0&&V4(165,"nodeToReplace");let g=o(f);if(g.setFormat(f.getFormat()),f.replace(g),u==null)return;p=0,l=g}}),e.registerNodeTransform(n,s=>{let i=s.getTextContent(),l=t(i);if(l===null||l.start!==0)return void a(s);if(i.length>l.end)return void s.splitText(l.end);let d=s.getPreviousSibling();mt(d)&&d.isTextEntity()&&(a(d),a(s));let u=s.getNextSibling();mt(u)&&u.isTextEntity()&&(a(u),r(s)&&a(s))})]}var Ii=qC,Kve=Ii.$canShowPlaceholder,cg=Ii.$canShowPlaceholderCurry,$ve=Ii.$findTextIntersectionFromCharacters,qve=Ii.$isRootTextContentEmpty,Vve=Ii.$isRootTextContentEmptyCurry,Wve=Ii.$rootTextContent,Gve=Ii.registerLexicalTextEntity;var YC={};un(YC,{$addNodeStyle:()=>J4,$cloneWithProperties:()=>zm,$copyBlockFormatIndent:()=>FM,$ensureForwardRangeSelection:()=>OM,$forEachSelectedTextNode:()=>DM,$getComputedStyleForElement:()=>GC,$getComputedStyleForParent:()=>jC,$getSelectionStyleValueForProperty:()=>sW,$isAtNodeEnd:()=>X4,$isParentElementRTL:()=>QC,$isParentRTL:()=>Q4,$moveCaretSelection:()=>HM,$moveCharacter:()=>rW,$patchStyleText:()=>Z4,$selectAll:()=>qm,$setBlocksType:()=>eW,$shouldOverrideDefaultCharacterSelection:()=>oW,$sliceSelectedTextNodeContent:()=>Y4,$trimTextContentFromAnchor:()=>_M,$wrapNodes:()=>nW,createDOMRange:()=>G4,createRectsFromDOMRange:()=>j4,getCSSFromStyleObject:()=>NM,getStyleObjectFromCSS:()=>fg,trimTextContentFromAnchor:()=>iW});function WC(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var pg=new Map;function LM(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function EM(e){let t=e.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function G4(e,t,n,o,r){let a=t.getKey(),s=o.getKey(),i=document.createRange(),l=e.getElementByKey(a),d=e.getElementByKey(s),u=n,p=r;if(mt(t)&&(l=LM(l)),mt(o)&&(d=LM(d)),t===void 0||o===void 0||l===null||d===null)return null;l.nodeName==="BR"&&([l,u]=EM(l)),d.nodeName==="BR"&&([d,p]=EM(d));let f=l.firstChild;l===d&&f!=null&&f.nodeName==="BR"&&u===0&&p===0&&(p=1);try{i.setStart(l,u),i.setEnd(d,p)}catch{return null}return!i.collapsed||u===p&&a===s||(i.setStart(d,p),i.setEnd(l,u)),i}function j4(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),a=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),s=Array.from(t.getClientRects()),i,l=s.length;s.sort((d,u)=>{let p=d.top-u.top;return Math.abs(p)<=3?d.left-u.left:p});for(let d=0;d<l;d++){let u=s[d],p=i&&i.top<=u.top&&i.top+i.height>u.top&&i.left+i.width>u.left,f=u.width+a===o.width;p||f?(s.splice(d--,1),l--):i=u}return s}function AM(e){let t={};if(!e)return t;let n=e.split(";");for(let o of n)if(o!==""){let[r,a]=o.split(/:([^]+)/);r&&a&&(t[r.trim()]=a.trim())}return t}function fg(e){let t=pg.get(e);return t===void 0&&(t=AM(e),pg.set(e,t)),t}function NM(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function GC(e){let t=Hm().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function jC(e){return GC(Au(e)?e:e.getParentOrThrow())}function Q4(e){let t=jC(e);return t!==null&&t.direction==="rtl"}function Y4(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!NC(t)&&o!==null){let[r,a]=o,s=e.isBackward(),i=r.getNode(),l=a.getNode(),d=t.is(i),u=t.is(l);if(d||u){let[p,f]=CE(e),m=i.is(l),g=t.is(s?l:i),h=t.is(s?i:l),v,C=0;m?(C=p>f?f:p,v=p>f?p:f):g?(C=s?f:p,v=void 0):h&&(C=0,v=s?p:f);let y=t.__text.slice(C,v);y!==t.__text&&(n==="clone"&&(t=pE(t)),t.__text=y)}}return t}function X4(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return Ze(t)||WC(177),e.offset===t.getChildrenSize()}function _M(e,t,n){let o=t.getNode(),r=n;if(Ze(o)){let a=o.getDescendantByIndex(t.offset);a!==null&&(o=a)}for(;r>0&&o!==null;){if(Ze(o)){let d=o.getLastDescendant();d!==null&&(o=d)}let a=o.getPreviousSibling(),s=0;if(a===null){let d=o.getParentOrThrow(),u=d.getPreviousSibling();for(;u===null;){if(d=d.getParent(),d===null){a=null;break}u=d.getPreviousSibling()}d!==null&&(s=d.isInline()?0:2,a=u)}let i=o.getTextContent();i===""&&Ze(o)&&!o.isInline()&&(i=`
3794
+ `?o.push(zl()):s===" "?o.push(Am()):o.push(Rn(s))}this.insertNodes(o)}insertText(t){let n=this.anchor,o=this.focus,r=this.format,a=this.style,s=n,i=o;!this.isCollapsed()&&o.isBefore(n)&&(s=o,i=n),s.type==="element"&&(function(v,C,y,x){let w=v.getNode(),I=w.getChildAtIndex(v.offset),S=Rn();if(S.setFormat(y),S.setStyle(x),OL(I))I.splice(0,0,[S]);else{let k=Fn(w)?ya().append(S):S;I===null?w.append(k):I.insertBefore(k)}v.is(C)&&C.set(S.__key,0,"text"),v.set(S.__key,0,"text")})(s,i,r,a),i.type==="element"&&jl(i,Cr(vs(i,"next")));let l=s.offset,d=i.offset,u=this.getNodes(),p=u.length,f=u[0];We(f)||ve(26);let m=f.getTextContent().length,g=f.getParentOrThrow(),h=u[p-1];if(p===1&&i.type==="element"&&(d=m,i.set(s.key,d,"text")),this.isCollapsed()&&l===m&&(ga(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let v=f.getNextSibling();if(We(v)&&v.canInsertTextBefore()&&!ga(v)||(v=Rn(),v.setFormat(r),v.setStyle(a),g.canInsertTextAfter()?f.insertAfter(v):g.insertAfter(v)),v.select(0,0),f=v,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(ga(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let v=f.getPreviousSibling();if(We(v)&&!ga(v)||(v=Rn(),v.setFormat(r),g.canInsertTextBefore()?f.insertBefore(v):g.insertBefore(v)),v.select(),f=v,t!=="")return void this.insertText(t)}else if(f.isSegmented()&&l!==m){let v=Rn(f.getTextContent());v.setFormat(r),f.replace(v),f=v}else if(!this.isCollapsed()&&t!==""){let v=h.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||me(v)&&(!v.canInsertTextBefore()||!v.canInsertTextAfter()))return this.insertText(""),kL(this.anchor,this.focus),void this.insertText(t)}if(p===1){if(cs(f)){let x=Rn(t);return x.select(),void f.replace(x)}let v=f.getFormat(),C=f.getStyle();if(l!==d||v===r&&C===a){if(oC(f)){let x=Rn(t);return x.setFormat(r),x.setStyle(a),x.select(),void f.replace(x)}}else{if(f.getTextContent()!==""){let x=Rn(t);if(x.setFormat(r),x.setStyle(a),x.select(),l===0)f.insertBefore(x,!1);else{let[w]=f.splitText(l);w.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}f.setFormat(r),f.setStyle(a)}let y=d-l;f=f.spliceText(l,y,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=v,this.style=C,f.isComposing()&&(this.anchor.offset-=t.length))}else{let v=new Set([...f.getParentKeys(),...h.getParentKeys()]),C=me(f)?f:f.getParentOrThrow(),y=me(h)?h:h.getParentOrThrow(),x=h;if(!C.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(i.type==="text"&&(d!==0||h.getTextContent()==="")||i.type==="element"&&h.getIndexWithinParent()<d)if(We(h)&&!cs(h)&&d!==h.getTextContentSize()){if(h.isSegmented()){let P=Rn(h.getTextContent());h.replace(P),h=P}Fn(i.getNode())||i.type!=="text"||(h=h.spliceText(0,d,"")),v.add(h.__key)}else{let P=h.getParentOrThrow();P.canBeEmpty()||P.getChildrenSize()!==1?h.remove():P.remove()}else v.add(h.__key);let w=y.getChildren(),I=new Set(u),S=C.is(y),k=C.isInline()&&f.getNextSibling()===null?C:f;for(let P=w.length-1;P>=0;P--){let T=w[P];if(T.is(f)||me(T)&&T.isParentOf(f))break;T.isAttached()&&(!I.has(T)||T.is(x)?S||k.insertAfter(T,!1):T.remove())}if(!S){let P=y,T=null;for(;P!==null;){let R=P.getChildren(),E=R.length;(E===0||R[E-1].is(T))&&(v.delete(P.__key),T=P),P=P.getParent()}}if(cs(f))if(l===m)f.select();else{let P=Rn(t);P.select(),f.replace(P)}else f=f.spliceText(l,m-l,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=f.getFormat(),this.style=f.getStyle(),f.isComposing()&&(this.anchor.offset-=t.length));for(let P=1;P<p;P++){let T=u[P],R=T.__key;v.has(R)||T.remove()}}}removeText(){let t=Mt()===this;cu(this,lE(Hy(this))),t&&Mt()!==this&&bo(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void En(null);let o=this.getNodes(),r=[];for(let w of o)We(w)&&r.push(w);let a=w=>{o.forEach(I=>{if(me(I)){let S=I.getFormatFlags(t,w);I.setTextFormat(S)}})},s=r.length;if(s===0)return this.toggleFormat(t),En(null),void a(n);let i=this.anchor,l=this.focus,d=this.isBackward(),u=d?l:i,p=d?i:l,f=0,m=r[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===m.getTextContentSize()&&(f=1,m=r[1],g=0),m==null)return;let h=m.getFormatFlags(t,n);a(h);let v=s-1,C=r[v],y=p.type==="text"?p.offset:C.getTextContentSize();if(m.is(C)){if(g===y)return;if(ga(m)||g===0&&y===m.getTextContentSize())m.setFormat(h);else{let w=m.splitText(g,y),I=g===0?w[0]:w[1];I.setFormat(h),u.type==="text"&&u.set(I.__key,0,"text"),p.type==="text"&&p.set(I.__key,y-g,"text")}return void(this.format=h)}g===0||ga(m)||([,m]=m.splitText(g),g=0),m.setFormat(h);let x=C.getFormatFlags(t,h);y>0&&(y===C.getTextContentSize()||ga(C)||([C]=C.splitText(y)),C.setFormat(x));for(let w=f+1;w<v;w++){let I=r[w],S=I.getFormatFlags(t,x);I.setFormat(S)}u.type==="text"&&u.set(m.__key,g,"text"),p.type==="text"&&p.set(C.__key,y,"text"),this.format=h|x}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let g=Mt();return tt(g)||ve(134),g.insertNodes(t)}let n=(this.isBackward()?this.focus:this.anchor).getNode(),o=lu(n,va),r=t[t.length-1];if(me(o)&&"__language"in o){if("__language"in t[0])this.insertText(t[0].getTextContent());else{let g=ay(this);o.splice(g,0,t),r.selectEnd()}return}if(!t.some(g=>(me(g)||Qt(g))&&!g.isInline())){me(o)||ve(211,n.constructor.name,n.getType());let g=ay(this);return o.splice(g,0,t),void r.selectEnd()}let a=(function(g){let h=ya(),v=null;for(let C=0;C<g.length;C++){let y=g[C],x=ui(y);if(x||Qt(y)&&y.isInline()||me(y)&&y.isInline()||We(y)||y.isParentRequired()){if(v===null&&(v=y.createParentElementNode(),h.append(v),x))continue;v!==null&&v.append(y)}else h.append(y),v=null}return h})(t),s=a.getLastDescendant(),i=a.getChildren(),l=!me(o)||!o.isEmpty()?this.insertParagraph():null,d=i[i.length-1],u=i[0];var p;me(p=u)&&va(p)&&!p.isEmpty()&&me(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(me(o)||ve(211,n.constructor.name,n.getType()),o.append(...u.getChildren()),u=i[1]),u&&(o===null&&ve(212,n.constructor.name,n.getType()),(function(g,h){let v=h.getParentOrThrow().getLastChild(),C=h,y=[h];for(;C!==v;)C.getNextSibling()||ve(140),C=C.getNextSibling(),y.push(C);let x=g;for(let w of y)x=x.insertAfter(w)})(o,u));let f=lu(s,va);l&&me(f)&&(l.canMergeWhenEmpty()||va(d))&&(f.append(...l.getChildren()),l.remove()),me(o)&&o.isEmpty()&&o.remove(),s.selectEnd();let m=me(o)?o.getLastChild():null;ui(m)&&f!==o&&m.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=ya();return zo().splice(this.anchor.offset,0,[s]),s.select(),s}let t=ay(this),n=lu(this.anchor.getNode(),va);me(n)||ve(213);let o=n.getChildAtIndex(t),r=o?[o,...o.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...r),a.selectStart(),a):null}insertLineBreak(t){let n=zl();if(this.insertNodes([n]),t){let o=n.getParentOrThrow(),r=n.getIndexWithinParent();o.select(r,r)}}extract(){let t=[...this.getNodes()],n=t.length,o=t[0],r=t[n-1],[a,s]=Ay(this),i=this.isBackward(),[l,d]=i?[this.focus,this.anchor]:[this.anchor,this.focus],[u,p]=i?[s,a]:[a,s];if(n===0)return[];if(n===1){if(We(o)&&!this.isCollapsed()){let f=o.splitText(u,p),m=u===0?f[0]:f[1];return m?(l.set(m.getKey(),0,"text"),d.set(m.getKey(),m.getTextContentSize(),"text"),[m]):[]}return[o]}if(We(o)&&(u===o.getTextContentSize()?t.shift():u!==0&&([,o]=o.splitText(u),t[0]=o,l.set(o.getKey(),0,"text"))),We(r)){let f=r.getTextContent().length;p===0?t.pop():p!==f&&([r]=r.splitText(p),t[t.length-1]=r,d.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,n,o){if(mR(this,t,n,o))return;let r=t==="move",a=Vt(),s=Tr(Ho(a));if(!s)return;let i=a._blockCursorElement,l=a._rootElement,d=this.focus.getNode();if(l===null||i===null||!me(d)||d.isInline()||d.canBeEmpty()||Dy(i,a,l),this.dirty){let u=$l(a,this.anchor.key),p=$l(a,this.focus.key);this.anchor.type==="text"&&(u=hi(u)),this.focus.type==="text"&&(p=hi(p)),u&&p&&EL(s,u,this.anchor.offset,p,this.focus.offset)}if((function(u,p,f,m){u.modify(p,f,m)})(s,t,n?"backward":"forward",o),s.rangeCount>0){let u=s.getRangeAt(0),p=this.anchor.getNode(),f=Fn(p)?p:JL(p);if(this.applyDOMRange(u),this.dirty=!0,!r){let m=this.getNodes(),g=[],h=!1;for(let v=0;v<m.length;v++){let C=m[v];km(C,f)?g.push(C):h=!0}if(h&&g.length>0)if(n){let v=g[0];me(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{let v=g[g.length-1];me(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(v){let C=v.focus,y=v.anchor,x=y.key,w=y.offset,I=y.type;y.set(C.key,C.offset,C.type,!0),C.set(x,w,I,!0)})(this)}}o==="lineboundary"&&mR(this,t,n,o,"decorators")}forwardDeletion(t,n,o){if(!o&&(t.type==="element"&&me(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){let r=n.getParent(),a=n.getNextSibling()||(r===null?null:r.getNextSibling());if(me(a)&&a.isShadowRoot())return!0}return!1}deleteCharacter(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t))return;let a=IC(vs(o,t?"previous":"next"));if(a.getTextSlices().every(i=>i===null||i.distance===0)){let i={type:"initial"};for(let l of a.iterNodeCarets("shadowRoot"))if(br(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(i.type==="merge-block")break;if(me(a.anchor.origin)&&a.anchor.origin.isEmpty()){let d=Cr(l);cu(this,hs(d,d)),a.anchor.origin.remove()}return}i.type!=="merge-next-block"&&i.type!=="merge-block"||(i={block:i.block,caret:l,type:"merge-block"})}}else{if(i.type==="merge-block")break;if(vi(l)){if(me(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(a.anchor.origin))break}else i={block:l.origin,type:"merge-next-block"};continue}if(Qt(l.origin)){if(!l.origin.isIsolated())if(i.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&me(a.anchor.origin)&&a.anchor.origin.isEmpty()){a.anchor.origin.remove();let d=rC();d.add(l.origin.getKey()),bo(d)}else l.origin.remove();return}break}}if(i.type==="merge-block"){let{caret:l,block:d}=i;return cu(this,hs(!l.origin.isEmpty()&&d.isEmpty()?Xl(Nn(d,l.direction)):a.anchor,l)),this.removeText()}}let s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&o.offset===0&&iR(this,o.getNode()))return}else{let i=s.type==="text"?s.getNode():null;if(r=o.type==="text"?o.getNode():null,i!==null&&i.isSegmented()){let l=s.offset,d=i.getTextContentSize();if(i.is(r)||t&&l!==d||!t&&l!==0)return void lR(i,t,l)}else if(r!==null&&r.isSegmented()){let l=o.offset,d=r.getTextContentSize();if(r.is(i)||t&&l!==0||!t&&l!==d)return void lR(r,t,l)}(function(l,d){let u=l.anchor,p=l.focus,f=u.getNode(),m=p.getNode();if(f===m&&u.type==="text"&&p.type==="text"){let g=u.offset,h=p.offset,v=g<h,C=v?g:h,y=v?h:g,x=y-1;C!==x&&(function(w){return!(VL(w)||qV(w))})(f.getTextContent().slice(C,y))&&(d?p.set(p.key,x,p.type):u.set(u.key,x,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let o=this.anchor.getNode();o.isEmpty()&&Fn(o.getParent())&&o.getPreviousSibling()===null&&iR(this,o)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){let n=this.anchor,o=n.getNode();if(this.forwardDeletion(n,o,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Iu(e){return e instanceof bm}function sR(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Ay(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[sR(n),sR(o)]}function iR(e,t){for(let n=t;n;n=n.getParent()){if(me(n)){if(n.collapseAtStart(e))return!0;if(or(n))break}if(n.getPreviousSibling())break}return!1}var qV=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("\u2764\uFE0F")&&t("#\uFE0F\u20E3")&&t("\u{1F44D}"))return t}catch{}return()=>!1})();function lR(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),a=r.length,s=0,i=0;for(let d=0;d<a;d++){let u=d===a-1;if(i=s,s+=r[d].length,t&&s===n||s>n||u){r.splice(d,1),u&&(i=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(i,i))}function dR(e,t,n,o){let r,a=t;if(ro(e)){let s=!1,i=e.childNodes,l=i.length,d=o._blockCursorElement;a===l&&(s=!0,a=l-1);let u=i[a],p=!1;if(u===d)u=i[a+1],p=!0;else if(d!==null){let f=d.parentNode;e===f&&t>Array.prototype.indexOf.call(f.children,d)&&a--}if(r=_l(u),We(r))a=Sr(r,s?"next":"previous");else{let f=_l(e);if(f===null)return null;if(me(f)){let m=o.getElementByKey(f.getKey());m===null&&ve(214),[f,a]=f.getDOMSlot(m).resolveChildIndex(f,m,e,t),me(f)||ve(215),s&&a>=f.getChildrenSize()&&(a=Math.max(0,f.getChildrenSize()-1));let h=f.getChildAtIndex(a);if(me(h)&&(function(v,C,y){let x=v.getParent();return y===null||x===null||!x.canBeEmpty()||x!==y.getNode()})(h,0,n)){let v=s?h.getLastDescendant():h.getFirstDescendant();v===null?f=h:(h=v,f=me(h)?h:h.getParentOrThrow()),a=0}We(h)?(r=h,f=null,a=Sr(h,s?"next":"previous")):h!==f&&s&&!p&&(me(f)||ve(216),a=Math.min(f.getChildrenSize(),a+1))}else{let m=f.getIndexWithinParent();a=t===0&&Qt(f)&&_l(e)===f?m:m+1,f=f.getParentOrThrow()}if(me(f))return Ir(f.__key,a,"element")}}else r=_l(e);return We(r)?Ir(r.__key,Sr(r,a,"clamp"),"text"):null}function cR(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let a=r.getPreviousSibling(),s=r.getParent();if(t){if((n||!t)&&a===null&&me(s)&&s.isInline()){let i=s.getPreviousSibling();We(i)&&e.set(i.__key,i.getTextContent().length,"text")}}else me(a)&&!n&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):We(a)&&e.set(a.__key,a.getTextContent().length,"text")}else if(o===r.getTextContent().length){let a=r.getNextSibling(),s=r.getParent();if(t&&me(a)&&a.isInline())e.set(a.__key,0,"element");else if((n||t)&&a===null&&me(s)&&s.isInline()&&!s.canInsertTextAfter()){let i=s.getNextSibling();We(i)&&e.set(i.__key,0,"text")}}}function kL(e,t,n){if(e.type==="text"&&t.type==="text"){let o=e.isBefore(t),r=e.is(t);cR(e,o,r),cR(t,!o,r),r&&t.set(e.key,e.offset,e.type)}}function PL(e,t,n,o,r,a){if(e===null||n===null||!wu(r,e,n))return null;let s=dR(e,t,tt(a)?a.anchor:null,r);if(s===null)return null;let i=dR(n,o,tt(a)?a.focus:null,r);if(i===null)return null;if(s.type==="element"&&i.type==="element"){let l=_l(e),d=_l(n);if(Qt(l)&&Qt(d))return null}return kL(s,i),[s,i]}function VV(e){return me(e)&&!e.isInline()}function RL(e,t,n,o,r,a){let s=ba(),i=new gi(Ir(e,t,r),Ir(n,o,a),0,"");return i.dirty=!0,s._selection=i,i}function LL(){let e=Ir("root",0,"element"),t=Ir("root",0,"element");return new gi(e,t,0,"")}function rC(){return new bm(new Set)}function WV(e,t){return Nm(null,e,t,null)}function Nm(e,t,n,o){let r=n._window;if(r===null)return null;let a=o||r.event,s=a?a.type:void 0,i=s==="selectionchange",l=!py&&(i||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&a&&a.detail===3||s==="drop"||s===void 0),d,u,p,f;if(tt(e)&&!l)return e.clone();if(t===null)return null;if(d=t.anchorNode,u=t.focusNode,p=t.anchorOffset,f=t.focusOffset,(i||s===void 0)&&tt(e)&&!wu(n,d,u))return e.clone();let m=PL(d,p,u,f,n,e);if(m===null)return null;let[g,h]=m,v=0,C="";if(tt(e)){let y=e.anchor;if(g.key===y.key)v=e.format,C=e.style;else{let x=g.getNode();We(x)?(v=x.getFormat(),C=x.getStyle()):me(x)&&(v=x.getTextFormat(),C=x.getTextStyle())}}return new gi(g,h,v,C)}function Mt(){return ba()._selection}function yi(){return Vt()._editorState._selection}function Sm(e,t,n,o=1){let r=e.anchor,a=e.focus,s=r.getNode(),i=a.getNode();if(!t.is(s)&&!t.is(i))return;let l=t.__key;if(e.isCollapsed()){let d=r.offset;if(n<=d&&o>0||n<d&&o<0){let u=Math.max(0,d+o);r.set(l,u,"element"),a.set(l,u,"element"),uR(e)}}else{let d=e.isBackward(),u=d?a:r,p=u.getNode(),f=d?r:a,m=f.getNode();if(t.is(p)){let g=u.offset;(n<=g&&o>0||n<g&&o<0)&&u.set(l,Math.max(0,g+o),"element")}if(t.is(m)){let g=f.offset;(n<=g&&o>0||n<g&&o<0)&&f.set(l,Math.max(0,g+o),"element")}}uR(e)}function uR(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,a=t.getNode(),s=o.getNode();if(e.isCollapsed()){if(!me(a))return;let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(We(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text"),o.set(d.__key,u,"text")}return}if(me(a)){let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(We(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text")}}if(me(s)){let i=s.getChildrenSize(),l=r>=i,d=l?s.getChildAtIndex(i-1):s.getChildAtIndex(r);if(We(d)){let u=0;l&&(u=d.getTextContentSize()),o.set(d.__key,u,"text")}}}function Im(e,t,n,o,r){let a=null,s=0,i=null;o!==null?(a=o.__key,We(o)?(s=o.getTextContentSize(),i="text"):me(o)&&(s=o.getChildrenSize(),i="element")):r!==null&&(a=r.__key,We(r)?i="text":me(r)&&(i="element")),a!==null&&i!==null?e.set(a,s,i):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function pR(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function EL(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch{}}function fR(e,t,n){let o=$l(e,t.getKey());if(me(t)){let r=t.getDOMSlot(o);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function GV(e,t,n,o,r,a,s){let i=o.anchorNode,l=o.focusNode,d=o.anchorOffset,u=o.focusOffset,p=document.activeElement;if(r.has(CL)&&p!==a||p!==null&&cC(p))return;if(!tt(t))return void(e!==null&&wu(n,i,l)&&o.removeAllRanges());let f=t.anchor,m=t.focus,g=f.getNode(),h=m.getNode(),[v,C]=fR(n,g,f.offset),[y,x]=fR(n,h,m.offset),w=t.format,I=t.style,S=t.isCollapsed(),k=v,P=y,T=!1;var R,E,D,L,O;if(f.type==="text"?(k=hi(v),T=g.getFormat()!==w||g.getStyle()!==I):tt(e)&&e.anchor.type==="text"&&(T=!0),m.type==="text"&&(P=hi(y)),k!==null&&P!==null&&(S&&(e===null||T||tt(e)&&(e.format!==w||e.style!==I))&&(R=w,E=I,D=C,L=f.key,O=performance.now(),pL=[R,E,D,L,O]),d!==C||u!==x||i!==k||l!==P||o.type==="Range"&&S||(p!==null&&a.contains(p)||r.has(Ey)||a.focus({preventScroll:!0}),f.type==="element"))){if(EL(o,k,C,P,x),!ps||!t.isCollapsed()||a===null||r.has(Ey)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!r.has(xL)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let U=tt(t)&&t.anchor.type==="element"?k.childNodes[C]||null:o.rangeCount>0?o.getRangeAt(0):null;if(U!==null){let F;if(U instanceof Text){let _=document.createRange();_.selectNode(U),F=_.getBoundingClientRect()}else F=U.getBoundingClientRect();(function(_,j,N){let z=vC(N),re=yC(z);if(z===null||re===null)return;let{top:H,bottom:te}=j,q=0,J=0,X=N;for(;X!==null;){let se=X===z.body;if(se)q=0,J=Ho(_).innerHeight;else{let ee=X.getBoundingClientRect();q=ee.top,J=ee.bottom}let ce=0;if(H<q?ce=-(q-H):te>J&&(ce=te-J),ce!==0)if(se)re.scrollBy(0,ce);else{let ee=X.scrollTop;X.scrollTop+=ce;let ne=X.scrollTop-ee;H-=ne,te-=ne}if(se)break;X=ku(X)}})(n,F,a)}}Py=!0}}function jV(e){let t=Mt()||yi();t===null&&(t=zo().selectEnd()),t.insertNodes(e)}function QV(){let e=Mt();return e===null?"":e.getTextContent()}function ay(e){let t=e;e.isCollapsed()||t.removeText();let n=Mt();tt(n)&&(t=n),tt(t)||ve(161);let o=t.anchor,r=o.getNode(),a=o.offset;for(;!va(r);){let s=r;if([r,a]=YV(r,a),s.is(r))break}return a}function YV(e,t){let n=e.getParent();if(!n){let r=ya();return zo().append(r),r.select(),[zo(),0]}if(We(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let a=t===0?0:1;return[n,r[0].getIndexWithinParent()+a]}if(!me(e)||t===0)return[n,e.getIndexWithinParent()];let o=e.getChildAtIndex(t);if(o){let r=new gi(Ir(e.__key,t,"element"),Ir(e.__key,t,"element"),0,""),a=e.insertNewAfter(r);a&&a.append(o,...o.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function mR(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[u,p]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return p.set(u.key,u.offset,u.type),!0}let a=vs(e.focus,n?"previous":"next"),s=o==="lineboundary",i=t==="move",l=a,d=r==="decorators-and-blocks";if(!dE(l)){for(let u of l){d=!1;let{origin:p}=u;if(!Qt(p)||p.isIsolated()||(l=u,!s||!p.isInline()))break}if(d)for(let u of IC(a).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(br(u))u.origin.isInline()||(l=u);else{if(me(u.origin))continue;Qt(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===a)return!1;if(i&&!s&&Qt(l.origin)&&l.origin.isKeyboardSelectable()){let u=rC();return u.add(l.origin.getKey()),bo(u),!0}return l=Cr(l),i&&jl(e.anchor,l),jl(e.focus,l),d||!s}var Mn=null,An=null,xo=!1,sy=!1,dm=0,gR={characterData:!0,childList:!0,subtree:!0};function Ql(){return xo||Mn!==null&&Mn._readOnly}function Ln(){xo&&ve(13)}function ML(){dm>99&&ve(14)}function ba(){return Mn===null&&ve(195,AL()),Mn}function Vt(){return An===null&&ve(196,AL()),An}function AL(){let e=0,t=new Set,n=ms.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let a=Tu(r);if(Dm(a))e++;else if(a){let s=String(a.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function XV(){return An}function hR(e,t,n){let o=t.__type,r=lC(e,o),a=n.get(o);a===void 0&&(a=Array.from(r.transforms),n.set(o,a));let s=a.length;for(let i=0;i<s&&(a[i](t),t.isAttached());i++);}function vR(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function NL(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function JV(e){return aC(e,Vt()._nodes)}function aC(e,t){let n=e.type,o=t.get(n);o===void 0&&ve(17,n);let r=o.klass;e.type!==r.getType()&&ve(18,r.name);let a=r.importJSON(e),s=e.children;if(me(a)&&Array.isArray(s))for(let i=0;i<s.length;i++){let l=aC(s[i],t);a.append(l)}return a}function yR(e,t,n){let o=Mn,r=xo,a=An;Mn=t,xo=!0,An=e;try{return n()}finally{Mn=o,xo=r,An=a}}function ha(e,t){let n=e._pendingEditorState,o=e._rootElement,r=e._headless||o===null;if(n===null)return;let a=e._editorState,s=a._selection,i=n._selection,l=e._dirtyType!==0,d=Mn,u=xo,p=An,f=e._updating,m=e._observer,g=null;if(e._pendingEditorState=null,e._editorState=n,!r&&l&&m!==null){An=e,Mn=n,xo=!1,e._updating=!0;try{let S=e._dirtyType,k=e._dirtyElements,P=e._dirtyLeaves;m.disconnect(),g=vV(a,n,e,S,k,P)}catch(S){if(S instanceof Error&&e._onError(S),sy)throw S;return FL(e,null,o,n),BR(e),e._dirtyType=2,sy=!0,ha(e,a),void(sy=!1)}finally{m.observe(o,gR),e._updating=f,Mn=d,xo=u,An=p}}n._readOnly||(n._readOnly=!0);let h=e._dirtyLeaves,v=e._dirtyElements,C=e._normalizedNodes,y=e._updateTags,x=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(S,k){let P=S._decorators,T=S._pendingDecorators||P,R=k._nodeMap,E;for(E in T)R.has(E)||(T===P&&(T=$L(S)),delete T[E])})(e,n);let w=r?null:Tr(Ho(e));if(e._editable&&w!==null&&(l||i===null||i.dirty||!i.is(s))&&o!==null&&!y.has(bL)){An=e,Mn=n;try{if(m!==null&&m.disconnect(),l||i===null||i.dirty){let S=e._blockCursorElement;S!==null&&Dy(S,e,o),GV(s,i,e,w,y,o)}(function(S,k,P){let T=S._blockCursorElement;if(tt(P)&&P.isCollapsed()&&P.anchor.type==="element"&&k.contains(document.activeElement)){let R=P.anchor,E=R.getNode(),D=R.offset,L=!1,O=null;if(D===E.getChildrenSize())ly(E.getChildAtIndex(D-1))&&(L=!0);else{let U=E.getChildAtIndex(D);if(U!==null&&ly(U)){let F=U.getPreviousSibling();(F===null||ly(F))&&(L=!0,O=S.getElementByKey(U.__key))}}if(L){let U=S.getElementByKey(E.__key);return T===null&&(S._blockCursorElement=T=(function(F){let _=F.theme,j=document.createElement("div");j.contentEditable="false",j.setAttribute("data-lexical-cursor","true");let N=_.blockCursor;if(N!==void 0){if(typeof N=="string"){let z=Lu(N);N=_.blockCursor=z}N!==void 0&&j.classList.add(...N)}return j})(S._config)),k.style.caretColor="transparent",void(O===null?U.appendChild(T):U.insertBefore(T,O))}}T!==null&&Dy(T,S,k)})(e,o,i)}finally{m!==null&&m.observe(o,gR),An=p,Mn=d}}g!==null&&(function(S,k,P,T,R){let E=Array.from(S._listeners.mutation),D=E.length;for(let L=0;L<D;L++){let[O,U]=E[L];for(let F of U){let _=k.get(F);_!==void 0&&O(_,{dirtyLeaves:T,prevEditorState:R,updateTags:P})}}})(e,g,y,h,a),tt(i)||i===null||s!==null&&s.is(i)||e.dispatchCommand(Vy,void 0);let I=e._pendingDecorators;I!==null&&(e._decorators=I,e._pendingDecorators=null,iu("decorator",e,!0,I)),(function(S,k,P){let T=SR(k),R=SR(P);T!==R&&iu("textcontent",S,!0,R)})(e,t||a,n),iu("update",e,!0,{dirtyElements:v,dirtyLeaves:h,editorState:n,mutatedNodes:g,normalizedNodes:C,prevEditorState:t||a,tags:y}),(function(S,k){if(S._deferred=[],k.length!==0){let P=S._updating;S._updating=!0;try{for(let T=0;T<k.length;T++)k[T]()}finally{S._updating=P}}})(e,x),(function(S){let k=S._updates;if(k.length!==0){let P=k.shift();if(P){let[T,R]=P;_m(S,T,R)}}})(e)}function iu(e,t,n,...o){let r=t._updating;t._updating=n;try{let a=Array.from(t._listeners[e]);for(let s=0;s<a.length;s++)a[s].apply(null,o)}finally{t._updating=r}}function CR(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[a,s]=r,i=e._pendingEditorState,l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(o=!0),s.discrete&&(i===null&&ve(191),i._flushSync=!0),l&&e._deferred.push(l),NL(e,s.tag)),i==null?_m(e,a,s):a()}}return o}function _m(e,t,n){let o=e._updateTags,r,a=!1,s=!1;n!==void 0&&(r=n.onUpdate,NL(e,n.tag),a=n.skipTransforms||!1,s=n.discrete||!1),r&&e._deferred.push(r);let i=e._editorState,l=e._pendingEditorState,d=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=_L(l||i),d=!0),l._flushSync=s;let u=Mn,p=xo,f=An,m=e._updating;Mn=l,xo=!1,e._updating=!0,An=e;let g=e._headless||e.getRootElement()===null;iC(null);try{d&&(g?i._selection!==null&&(l._selection=i._selection.clone()):l._selection=(function(y,x){let w=y.getEditorState()._selection,I=Tr(Ho(y));return tt(w)||w==null?Nm(w,I,y,x):w.clone()})(e,n&&n.event||null));let v=e._compositionKey;t(),a=CR(e,a),(function(y,x){let w=x.getEditorState()._selection,I=y._selection;if(tt(I)){let S=I.anchor,k=I.focus,P;if(S.type==="text"&&(P=S.getNode(),P.selectionTransform(w,I)),k.type==="text"){let T=k.getNode();P!==T&&T.selectionTransform(w,I)}}})(l,e),e._dirtyType!==0&&(a?(function(y,x){let w=x._dirtyLeaves,I=y._nodeMap;for(let S of w){let k=I.get(S);We(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&GP(k)}})(l,e):(function(y,x){let w=x._dirtyLeaves,I=x._dirtyElements,S=y._nodeMap,k=ds(),P=new Map,T=w,R=T.size,E=I,D=E.size;for(;R>0||D>0;){if(R>0){x._dirtyLeaves=new Set;for(let L of T){let O=S.get(L);We(O)&&O.isAttached()&&O.isSimpleText()&&!O.isUnmergeable()&&GP(O),O!==void 0&&vR(O,k)&&hR(x,O,P),w.add(L)}if(T=x._dirtyLeaves,R=T.size,R>0){dm++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,E.delete("root")&&E.set("root",!0);for(let L of E){let O=L[0],U=L[1];if(I.set(O,U),!U)continue;let F=S.get(O);F!==void 0&&vR(F,k)&&hR(x,F,P)}T=x._dirtyLeaves,R=T.size,E=x._dirtyElements,D=E.size,dm++}x._dirtyLeaves=w,x._dirtyElements=I})(l,e),CR(e),(function(y,x,w,I){let S=y._nodeMap,k=x._nodeMap,P=[];for(let[T]of I){let R=k.get(T);R!==void 0&&(R.isAttached()||(me(R)&&DR(R,T,S,k,P,I),S.has(T)||I.delete(T),P.push(T)))}for(let T of P)k.delete(T);for(let T of w){let R=k.get(T);R===void 0||R.isAttached()||(S.has(T)||w.delete(T),k.delete(T))}})(i,l,e._dirtyLeaves,e._dirtyElements)),v!==e._compositionKey&&(l._flushSync=!0);let C=l._selection;if(tt(C)){let y=l._nodeMap,x=C.anchor.key,w=C.focus.key;y.get(x)!==void 0&&y.get(w)!==void 0||ve(19)}else Iu(C)&&C._nodes.size===0&&(l._selection=null)}catch(v){return v instanceof Error&&e._onError(v),e._pendingEditorState=i,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ha(e)}finally{Mn=u,xo=p,An=f,e._updating=m,dm=0}e._dirtyType!==0||e._deferred.length>0||(function(v,C){let y=C.getEditorState()._selection,x=v._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,ha(e)):d&&i4(()=>{ha(e)}):(l._flushSync=!1,d&&(o.clear(),e._deferred=[],e._pendingEditorState=null))}function $r(e,t,n){An===e&&n===void 0?t():_m(e,t,n)}var Ny=class e{element;before;after;constructor(t,n,o){this.element=t,this.before=n||null,this.after=o||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(t){let n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&ve(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&ve(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&ve(224),this.element.replaceChild(t,n),this}getFirstChild(){let t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{let n=t==="decorator"&&(Lm||Su||Rm);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let t=this.getManagedLineBreak();if(t){let n=this.element,o=t.nodeName==="IMG"?t.nextSibling:null;o&&n.removeChild(o),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){let n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before,a=document.createElement("br");if(o.insertBefore(a,r),t){let s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",o.insertBefore(s,a),o.__lexicalLineBreak=s}else o.__lexicalLineBreak=a}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,o,r){if(o===this.element){let l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,r))]}let a=xR(n,o);a.push(r);let s=xR(n,this.element),i=t.getIndexWithinParent();for(let l=0;l<s.length;l++){let d=a[l],u=s[l];if(d===void 0||d<u)break;if(d>u){i+=1;break}}return[t.getParentOrThrow(),i]}};function xR(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let a=o.previousSibling;a!==null;a=a.previousSibling)r++;n.push(r)}return o!==e&&ve(225),n.reverse()}var fs=class extends nr{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),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=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let t=this.getFormat();return oV[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let t=Vt()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){let t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){let t=[],n=this.getFirstChild();for(;n!==null;){if(We(n)&&t.push(n),me(n)){let o=n.getAllTextNodes();t.push(...o)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;me(t);){let n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;me(t);){let n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){let n=this.getChildren(),o=n.length;if(t>=o){let a=n[o-1];return me(a)&&a.getLastDescendant()||a||null}let r=n[t];return me(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let t=this.getLatest().__first;return t===null?null:bn(t)}getFirstChildOrThrow(){let t=this.getFirstChild();return t===null&&ve(45,this.__key),t}getLastChild(){let t=this.getLatest().__last;return t===null?null:bn(t)}getLastChildOrThrow(){let t=this.getLastChild();return t===null&&ve(96,this.__key),t}getChildAtIndex(t){let n=this.getChildrenSize(),o,r;if(t<n/2){for(o=this.getFirstChild(),r=0;o!==null&&r<=t;){if(r===t)return o;o=o.getNextSibling(),r++}return null}for(o=this.getLastChild(),r=n-1;o!==null&&r>=t;){if(r===t)return o;o=o.getPreviousSibling(),r--}return null}getTextContent(){let t="",n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContent(),me(a)&&r!==o-1&&!a.isInline()&&(t+=Em)}return t}getTextContentSize(){let t=0,n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContentSize(),me(a)&&r!==o-1&&!a.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){let n=uy[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){let n=Wn[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return xu(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){Ln();let o=Mt(),r=t,a=n,s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){let l=this.getFirstChild();if(We(l)||me(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){let l=this.getLastChild();if(We(l)||me(l))return l.select()}}r===void 0&&(r=s),a===void 0&&(a=s);let i=this.__key;return tt(o)?(o.anchor.set(i,r,"element"),o.focus.set(i,a,"element"),o.dirty=!0,o):RL(i,r,i,a,"element","element")}selectStart(){let t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){let t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){let t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){let n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?uy[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){let n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){let n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,o){xm(this)&&ve(324,this.__key,this.__type);let r=this.getChildrenSize(),a=this.getWritable();t+n<=r||ve(226,String(t),String(n),String(r));let s=a.__key,i=[],l=[],d=this.getChildAtIndex(t+n),u=null,p=r-n+o.length;if(t!==0)if(t===r)u=this.getLastChild();else{let m=this.getChildAtIndex(t);m!==null&&(u=m.getPreviousSibling())}if(n>0){let m=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){m===null&&ve(100);let h=m.getNextSibling(),v=m.__key;us(m.getWritable()),l.push(v),m=h}}let f=u;for(let m of o){f!==null&&m.is(f)&&(u=f=f.getPreviousSibling());let g=m.getWritable();g.__parent===s&&p--,us(g);let h=m.__key;if(f===null)a.__first=h,g.__prev=null;else{let v=f.getWritable();v.__next=h,g.__prev=v.__key}m.__key===s&&ve(76),g.__parent=s,i.push(h),f=m}if(t+n===r)f!==null&&(f.getWritable().__next=null,a.__last=f.__key);else if(d!==null){let m=d.getWritable();if(f!==null){let g=f.getWritable();m.__prev=f.__key,g.__next=d.__key}else m.__prev=null}if(a.__size=p,l.length){let m=Mt();if(tt(m)){let g=new Set(l),h=new Set(i),{anchor:v,focus:C}=m;bR(v,g,h)&&Im(v,v.getNode(),this,u,d),bR(C,g,h)&&Im(C,C.getNode(),this,u,d),p!==0||this.canBeEmpty()||or(this)||this.remove()}}return a}getDOMSlot(t){return new Ny(t)}exportDOM(t){let{element:n}=super.exportDOM(t);if(ro(n)){let o=this.getIndent();o>0&&(n.style.paddingInlineStart=40*o+"px");let r=this.getDirection();r&&(n.dir=r)}return{element:n}}exportJSON(){let t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),o=this.getTextStyle();return n===0&&o===""||or(this)||this.getChildren().some(We)||(n!==0&&(t.textFormat=n),o!==""&&(t.textStyle=o)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,o){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){let o=this.getDOMSlot(t),r=o.getFirstChild();for(let a=this.getFirstChild();a;a=a.getNextSibling()){let s=n.getElementByKey(a.getKey());s!==null&&(r==null?(o.insertChild(s),r=s):r!==s&&o.replaceChild(s,r),r=r.nextSibling)}}};function me(e){return e instanceof fs}function bR(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}var yu=class extends nr{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Qt(e){return e instanceof yu}var Ul=class e extends fs{__cachedText;static getType(){return"root"}static clone(){return new e}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){ve(51)}getTextContent(){let t=this.__cachedText;return!Ql()&&Vt()._dirtyType!==0||t===null?super.getTextContent():t}remove(){ve(52)}replace(t){ve(53)}insertBefore(t){ve(54)}insertAfter(t){ve(55)}updateDOM(t,n){return!1}splice(t,n,o){for(let r of o)me(r)||Qt(r)||ve(282);return super.splice(t,n,o)}static importJSON(t){return zo().updateFromJSON(t)}collapseAtStart(){return!0}};function Fn(e){return e instanceof Ul}function _L(e){return new Cu(new Map(e._nodeMap))}function sC(){return new Cu(new Map([["root",new Ul]]))}function DL(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&ve(130,n.name),me(e)){let o=t.children;Array.isArray(o)||ve(59,n.name);let r=e.getChildren();for(let a=0;a<r.length;a++){let s=DL(r[a]);o.push(s)}}return t}function ZV(e){return e instanceof Cu}var Cu=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return yR(n&&n.editor||null,this,t)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return yR(null,this,()=>({root:DL(zo())}))}},wm=class extends fs{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}},Kl=class e extends fs{static getType(){return"paragraph"}static clone(t){return new e(t.__key)}createDOM(t){let n=document.createElement("p"),o=Fl(t.theme,"paragraph");return o!==void 0&&n.classList.add(...o),n}updateDOM(t,n,o){return!1}static importDOM(){return{p:t=>({conversion:e4,priority:0})}}exportDOM(t){let{element:n}=super.exportDOM(t);if(ro(n)){this.isEmpty()&&n.append(document.createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o)}return{element:n}}static importJSON(t){return ya().updateFromJSON(t)}exportJSON(){let t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(We);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){let o=ya();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){let t=this.getChildren();if(t.length===0||We(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function e4(e){let t=ya();if(e.style&&(t.setFormat(e.style.textAlign),oE(e,t)),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in uy&&t.setFormat(n)}return{node:t}}function ya(){return Pu(new Kl)}function OL(e){return e instanceof Kl}var Nl=0,t4=1,n4=2,o4=3,r4=4;function FL(e,t,n,o){let r=e._keyToDOMMap;r.clear(),e._editorState=sC(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",r.set("root",n))}function BL(e){let t=new Set,n=new Set,o=e;for(;o;){let{ownNodeConfig:r}=Ru(o),a=o.transform;if(!n.has(a)){n.add(a);let s=o.transform();s&&t.add(s)}if(r){let s=r.$transform;s&&t.add(s),o=r.extends}else{let s=Object.getPrototypeOf(o);o=s.prototype instanceof nr&&s!==nr?s:void 0}}return t}function a4(e){let t=e||{},n=XV(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,s=sC(),i=t.namespace||(r!==null?r._config.namespace:WL()),l=t.editorState,d=[Ul,mi,Bl,Hl,Kl,wm,...t.nodes||[]],{onError:u,html:p}=t,f=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let h=0;h<d.length;h++){let v=d[h],C=null,y=null;if(typeof v!="function"){let I=v;v=I.replace,C=I.with,y=I.withKlass||null}Ru(v);let x=v.getType(),w=BL(v);m.set(x,{exportDOM:p&&p.export?p.export.get(v):void 0,klass:v,replace:C,replaceWithKlass:y,sharedNodeState:zR(d[h]),transforms:w})}}let g=new ms(s,r,m,{disableEvents:a,namespace:i,theme:o},u||console.error,(function(h,v){let C=new Map,y=new Set,x=w=>{Object.keys(w).forEach(I=>{let S=C.get(I);S===void 0&&(S=[],C.set(I,S)),S.push(w[I])})};return h.forEach(w=>{let I=w.klass.importDOM;if(I==null||y.has(I))return;y.add(I);let S=I.call(w.klass);S!==null&&x(S)}),v&&x(v),C})(m,p?p.import:void 0),f,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(h){h.registerCommand(Wy,PV,Nl),h.registerCommand(Gy,RV,Nl),h.registerCommand(jy,LV,Nl),h.registerCommand(Qy,EV,Nl),h.registerCommand(Zy,MV,Nl)})(g),g}var ms=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,o,r,a,s,i,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=o,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=WL(),this._onError=a,this._htmlConversions=s,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){let n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){let n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){let n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){let n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){let n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,o){o===void 0&&ve(35);let r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);let a=r.get(t);a===void 0&&ve(36,String(t));let s=a[o];return s.add(n),()=>{s.delete(n),a.every(i=>i.size===0)&&r.delete(t)}}registerMutationListener(t,n,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,a=this._listeners.mutation,s=a.get(n);s===void 0&&(s=new Set,a.set(n,s)),s.add(r);let i=o&&o.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(n,r),()=>{s.delete(r),s.size===0&&a.delete(n)}}getRegisteredNode(t){let n=this._nodes.get(t.getType());return n===void 0&&ve(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){let o=this._editorState,r=Fy(o).get(n.getType());if(!r)return;let a=new Map;for(let s of r.keys())a.set(s,"created");a.size>0&&t(a,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){let o=this.getRegisteredNode(t);return o.transforms.add(n),o}registerNodeTransform(t,n){let o=this.registerNodeTransformToKlass(t,n),r=[o],a=o.replaceWithKlass;if(a!=null){let s=this.registerNodeTransformToKlass(a,n);r.push(s)}return(function(s,i){let l=Fy(s.getEditorState()),d=[];for(let u of i){let p=l.get(u);p&&d.push(p)}d.length!==0&&s.update(()=>{for(let u of d)for(let p of u.keys()){let f=bn(p);f&&f.markDirty()}},s._pendingEditorState===null?{tag:lm}:void 0)})(this,r.map(s=>s.klass.getType())),()=>{r.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Oe(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let n=this._rootElement;if(t!==n){let o=Fl(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,FL(this,n,t,r),n!==null&&(this._config.disableEvents||AV(n),o!=null&&n.classList.remove(...o)),t!==null){let a=yC(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=a,this._dirtyType=2,BR(this),this._updateTags.add(lm),ha(this),this._config.disableEvents||(function(i,l){let d=i.ownerDocument;ky.set(i,d);let u=ym.get(d)??0;u<1&&d.addEventListener("selectionchange",vL),ym.set(d,u+1),i.__lexicalEditor=l;let p=hL(i);for(let f=0;f<Ty.length;f++){let[m,g]=Ty[f],h=typeof g=="function"?v=>{eR(v)||(ZP(v),(l.isEditable()||m==="click")&&g(v,l))}:v=>{if(eR(v))return;ZP(v);let C=l.isEditable();switch(m){case"cut":return C&&Oe(l,tC,v);case"copy":return Oe(l,eC,v);case"paste":return C&&Oe(l,Yy,v);case"dragstart":return C&&Oe(l,rL,v);case"dragover":return C&&Oe(l,aL,v);case"dragend":return C&&Oe(l,sL,v);case"focus":return C&&Oe(l,iL,v);case"blur":return C&&Oe(l,lL,v);case"drop":return C&&Oe(l,oL,v)}};i.addEventListener(m,h),p.push(()=>{i.removeEventListener(m,h)})}})(t,this),o!=null&&t.classList.add(...o)}else this._window=null,this._updateTags.add(lm),ha(this);iu("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&ve(38);let o=t;o._readOnly&&(o=_L(t),o._selection=t._selection?t._selection.clone():null),FR(this);let r=this._pendingEditorState,a=this._updateTags,s=n!==void 0?n.tag:null;r===null||r.isEmpty()||(s!=null&&a.add(s),ha(this)),this._pendingEditorState=o,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&a.add(s),this._updating||ha(this)}parseEditorState(t,n){return(function(o,r,a){let s=sC(),i=Mn,l=xo,d=An,u=r._dirtyElements,p=r._dirtyLeaves,f=r._cloneNotNeeded,m=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,Mn=s,xo=!1,An=r,iC(null);try{let g=r._nodes;aC(o.root,g),a&&a(),s._readOnly=!0}catch(g){g instanceof Error&&r._onError(g)}finally{r._dirtyElements=u,r._dirtyLeaves=p,r._cloneNotNeeded=f,r._dirtyType=m,Mn=i,xo=l,An=d}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return ha(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(o,r,a){o._updating?o._updates.push([r,a]):_m(o,r,a)})(this,t,n)}focus(t,n={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),$r(this,()=>{let r=Mt(),a=zo();r!==null?r.dirty||bo(r.clone()):a.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?a.selectStart():a.selectEnd()),Bm("focus"),XL(()=>{o.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let n=Tr(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,iu("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}};ms.version="0.41.0+prod.esm";var _y=null;function iC(e){_y=e}var zL=1;function s4(){zL=1}function lC(e,t){let n=dC(e,t);return n===void 0&&ve(30,t),n}function dC(e,t){return e._nodes.get(t)}var i4=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function HL(e){return Qt(Fm(e))}function cC(e){let t=document.activeElement;if(!ro(t))return!1;let n=t.nodeName;return Qt(Fm(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&Tu(t)==null)}function wu(e,t,n){let o=e.getRootElement();try{return o!==null&&o.contains(t)&&o.contains(n)&&t!==null&&!cC(t)&&uC(t)===e}catch{return!1}}function Dm(e){return e instanceof ms}function uC(e){let t=e;for(;t!=null;){let n=Tu(t);if(Dm(n))return n;t=ku(t)}return null}function Tu(e){return e?e.__lexicalEditor:null}function l4(e){return eV.test(e)?"rtl":tV.test(e)?"ltr":null}function cs(e){return oC(e)||e.isToken()}function ga(e){return cs(e)||e.isSegmented()}function qr(e){return Yl(e)&&e.nodeType===3}function UL(e){return Yl(e)&&e.nodeType===9}function hi(e){let t=e;for(;t!=null;){if(qr(t))return t;t=t.firstChild}return null}function xu(e,t,n){let o=Wn[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~Wn.superscript:t==="superscript"?r&=~Wn.subscript:t==="lowercase"?(r&=~Wn.uppercase,r&=~Wn.capitalize):t==="uppercase"?(r&=~Wn.lowercase,r&=~Wn.capitalize):t==="capitalize"&&(r&=~Wn.lowercase,r&=~Wn.uppercase),r}function d4(e){return We(e)||ui(e)||Qt(e)}function KL(e,t){let n=(function(){let s=_y;return _y=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);Ln(),ML();let o=Vt(),r=ba(),a=""+zL++;r._nodeMap.set(a,e),me(e)?o._dirtyElements.set(a,!0):o._dirtyLeaves.add(a),o._cloneNotNeeded.add(a),o._dirtyType=1,e.__key=a}function us(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),a=e.getNextSibling(),s=a!==null?a.__key:null,i=r!==null?r.__key:null,l=r!==null?r.getWritable():null,d=a!==null?a.getWritable():null;r===null&&(o.__first=s),a===null&&(o.__last=i),l!==null&&(l.__next=s),d!==null&&(d.__prev=i),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}function Tm(e){ML(),xm(e)&&ve(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,o=ba(),r=Vt(),a=o._nodeMap,s=r._dirtyElements;n!==null&&(function(l,d,u){let p=l;for(;p!==null;){if(u.has(p))return;let f=d.get(p);if(f===void 0)break;u.set(p,!1),p=f.__parent}})(n,a,s);let i=t.__key;r._dirtyType=1,me(e)?s.set(i,!0):r._dirtyLeaves.add(i)}function En(e){Ln();let t=Vt(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=bn(n);o!==null&&o.getWritable()}if(e!==null){let o=bn(e);o!==null&&o.getWritable()}}}function ds(){return Ql()?null:Vt()._compositionKey}function bn(e,t){let n=(t||ba())._nodeMap.get(e);return n===void 0?null:n}function pC(e,t){let n=Om(e,Vt());return n!==void 0?bn(n,t):null}function Om(e,t){return e[`__lexicalKey_${t._key}`]}function Fm(e,t){let n=e;for(;n!=null;){let o=pC(n,t);if(o!==null)return o;n=ku(n)}return null}function $L(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function SR(e){return e.read(()=>zo().getTextContent())}function zo(){return qL(ba())}function qL(e){return e._nodeMap.get("root")}function bo(e){Ln();let t=ba();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function _l(e){let t=Vt(),n=(function(o,r){let a=o;for(;a!=null;){let s=Om(a,r);if(s!==void 0)return s;a=ku(a)}return null})(e,t);return n===null?e===t.getRootElement()?bn("root"):null:bn(n)}function VL(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function fC(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function WL(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function GL(e){return qr(e)?e.nodeValue:null}function mC(e,t,n){let o=Tr(Ho(t));if(o===null)return;let r=o.anchorNode,{anchorOffset:a,focusOffset:s}=o;if(r!==null){let i=GL(r),l=Fm(r);if(i!==null&&We(l)){if((i===uu||i===Ky)&&n){let d=n.length;i=n,a=d,s=d}i!==null&&gC(l,i,a,s,e)}}}function gC(e,t,n,o,r){let a=e;if(a.isAttached()&&(r||!a.isDirty())){let s=a.isComposing(),i=t;if((s||r)&&(t.endsWith(uu)&&(i=t.slice(0,-uu.length)),r)){let d=Ky,u;for(;(u=i.indexOf(d))!==-1;)i=i.slice(0,u)+i.slice(u+d.length),n!==null&&n>u&&(n=Math.max(u,n-d.length)),o!==null&&o>u&&(o=Math.max(u,o-d.length))}let l=a.getTextContent();if(r||i!==l){if(i===""){if(En(null),Rm||Su||Lm)a.remove();else{let h=Vt();setTimeout(()=>{h.update(()=>{a.isAttached()&&a.remove()})},20)}return}let d=a.getParent(),u=yi(),p=a.getTextContentSize(),f=ds(),m=a.getKey();if(a.isToken()||f!==null&&m===f&&!s||tt(u)&&(d!==null&&!d.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===p&&!a.canInsertTextAfter()&&!s))return void a.markDirty();let g=Mt();if(!tt(g)||n===null||o===null)return void IR(a,i,g);if(g.setTextNodeRange(a,n,a,o),a.isSegmented()){let h=Rn(a.getTextContent());a.replace(h),a=h}IR(a,i,g)}}}function IR(e,t,n){if(e.setTextContent(t),tt(n)){let o=e.getKey();for(let r of["anchor","focus"]){let a=n[r];a.type==="text"&&a.key===o&&(a.offset=Sr(e,a.offset,"clamp"))}}}function nm(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function jL(e,t){return nm(e,t,"altKey")&&nm(e,t,"ctrlKey")&&nm(e,t,"shiftKey")&&nm(e,t,"metaKey")}function Ft(e,t,n){if(!jL(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let o="Key"+t.toUpperCase();return e.code===o}var ma={ctrlKey:!yr,metaKey:yr},wR={altKey:yr,ctrlKey:!yr};function TR(e){return e.key==="Backspace"}function kR(e){return Ft(e,"a",ma)}function c4(e){let t=zo();if(tt(e)){let n=e.anchor,o=e.focus,r=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),pm(e),e}{let n=t.select(0,t.getChildrenSize());return bo(pm(n)),n}}function Fl(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let a=Lu(r);return n[t]=a,a}return r}function hC(e,t,n,o,r){if(n.size===0)return;let a=o.__type,s=o.__key,i=t.get(a);i===void 0&&ve(33,a);let l=i.klass,d=e.get(l);d===void 0&&(d=new Map,e.set(l,d));let u=d.get(s),p=u==="destroyed"&&r==="created";(u===void 0||p)&&d.set(s,p?"updated":r)}function u4(e){let t=e.getType(),n=ba();if(n._readOnly){let a=Fy(n).get(t);return a?Array.from(a.values()):[]}let o=n._nodeMap,r=[];for(let[,a]of o)a instanceof e&&a.__type===t&&a.isAttached()&&r.push(a);return r}function PR(e,t,n){let o=e.getParent(),r=n,a=e;return o!==null&&(t&&n===0?(r=a.getIndexWithinParent(),a=o):t||n!==a.getChildrenSize()||(r=a.getIndexWithinParent()+1,a=o)),a.getChildAtIndex(t?r-1:r)}function QL(e,t){let n=e.offset;if(e.type==="element")return PR(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?PR(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function YL(e){let t=Ho(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Oe(e,t,n){return(function(o,r,a){let s=fC(o);for(let i=4;i>=0;i--)for(let l=0;l<s.length;l++){let d=s[l],u=d._commands.get(r);if(u!==void 0){let p=u[i];if(p!==void 0){let f=Array.from(p),m=f.length,g=!1;if($r(d,()=>{for(let h=0;h<m;h++)if(f[h](a,o))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function $l(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&ve(75,t),n}function ku(e){let t=e.assignedSlot||e.parentElement;return tE(t)?t.host:t}function vC(e){return UL(e)?e:ro(e)?e.ownerDocument:null}function p4(e){return Vt()._updateTags.has(e)}function Bm(e){Ln(),Vt()._updateTags.add(e)}function XL(e){Ln(),Vt()._deferred.push(e)}function km(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function yC(e){let t=vC(e);return t?t.defaultView:null}function Ho(e){let t=e._window;return t===null&&ve(78),t}function f4(e){return me(e)&&e.isInline()||Qt(e)&&e.isInline()}function JL(e){let t=e.getParentOrThrow();for(;t!==null;){if(or(t))return t;t=t.getParentOrThrow()}return t}function or(e){return Fn(e)||me(e)&&e.isShadowRoot()}function CC(e){let t=e.constructor.clone(e);return KL(t,null),t.afterCloneFrom(e),t}function Pu(e){let t=Vt(),n=e.getType(),o=dC(t,n);o===void 0&&ve(200,e.constructor.name,n);let{replace:r,replaceWithKlass:a}=o;if(r!==null){let s=r(e),i=s.constructor;return a!==null?s instanceof a||ve(201,a.name,a.getType(),i.name,i.getType(),e.constructor.name,n):s instanceof e.constructor&&i!==e.constructor||ve(202,i.name,i.getType(),e.constructor.name,n),s.__key===e.__key&&ve(203,e.constructor.name,n,i.name,i.getType()),s}return e}function iy(e,t){!Fn(e.getParent())||me(t)||Qt(t)||ve(99)}function ZL(e){let t=bn(e);return t===null&&ve(63,e),t}function ly(e){return(Qt(e)||me(e)&&!e.canBeEmpty())&&!e.isInline()}function Dy(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Tr(e){return wr?(e||window).getSelection():null}function eE(e){let t=yC(e);return t?t.getSelection():null}function m4(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),or(e)&&ve(102);let o=s=>{let i=s.getParentOrThrow(),l=or(i),d=s!==n||l?CC(s):s;if(l)return me(s)&&me(d)||ve(133),s.insertAfter(d),[s,d,d];{let[u,p,f]=o(i),m=s.getNextSiblings();return f.append(d,...m),[u,p,d]}},[r,a]=o(n);return[r,a]}function g4(e){return ro(e)&&e.tagName==="A"}function ro(e){return Yl(e)&&e.nodeType===1}function Yl(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function tE(e){return Yl(e)&&e.nodeType===11}function nE(e){let t=new RegExp(/^(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");return e.nodeName.match(t)!==null}function Oy(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function va(e){if(Qt(e)&&!e.isInline())return!0;if(!me(e)||or(e))return!1;let t=e.getFirstChild(),n=t===null||ui(t)||We(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function xC(){return Vt()}var RR=new WeakMap,h4=new Map;function Fy(e){if(!e._readOnly&&e.isEmpty())return h4;e._readOnly||ve(192);let t=RR.get(e);return t||(t=(function(n){let o=new Map;for(let[r,a]of n._nodeMap){let s=a.__type,i=o.get(s);i||(i=new Map,o.set(s,i)),i.set(r,a)}return o})(e),RR.set(e,t)),t}function bC(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function v4(e){return(t=bC(e))[yL]=!0,t;var t}function oE(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,o=Math.round(n/40);t.setIndent(o)}function y4(e){e.__lexicalUnmanaged=!0}function rE(e){return e.__lexicalUnmanaged===!0}function ou(e,t){return(function(n,o){return Object.prototype.hasOwnProperty.call(n,o)})(e,t)&&e[t]!==nr[t]}function Ru(e){let t=HP in e.prototype?e.prototype[HP]():void 0,n=(function(s){if(!(s===nr||s.prototype instanceof nr)){let i="<unknown>",l="<unknown>";try{i=s.getType()}catch{}try{ms.version&&(l=JSON.parse(ms.version))}catch{}ve(290,s.name,i,l)}return s===yu||s===fs||s===nr})(e),o=!n&&ou(e,"getType")?e.getType():void 0,r,a=o;if(t)if(o)r=t[o];else for(let[s,i]of Object.entries(t))a=s,r=i;if(!n&&a&&(ou(e,"getType")||(e.getType=()=>a),ou(e,"clone")||(e.clone=s=>(iC(s),new e)),ou(e,"importJSON")||(e.importJSON=r&&r.$importJSON||(s=>new e().updateFromJSON(s))),!ou(e,"importDOM")&&r)){let{importDOM:s}=r;s&&(e.importDOM=()=>s)}return{ownNodeConfig:r,ownNodeType:a}}function C4(e){let t=xC();return Ln(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var lu=(e,t)=>{let n=e;for(;n!=null&&!Fn(n);){if(t(n))return n;n=n.getParent()}return null},x4={next:"previous",previous:"next"},ql=class{origin;constructor(t){this.origin=t}[Symbol.iterator](){return wC({hasNext:vi,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Nn(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Nn(this.origin,this.direction)}remove(){let t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){let o=this.getNodeAtCaret();return t.is(this.origin)||t.is(o)||(o===null?this.insert(t):o.replace(t,n)),this}splice(t,n,o="next"){let r=o===this.direction?n:Array.from(n).reverse(),a=this,s=this.getParentAtCaret(),i=new Map;for(let l=a.getAdjacentCaret();l!==null&&i.size<t;l=l.getAdjacentCaret()){let d=l.origin.getWritable();i.set(d.getKey(),d)}for(let l of r){if(i.size>0){let d=a.getNodeAtCaret();if(d){if(i.delete(d.getKey()),i.delete(l.getKey()),!(d.is(l)||a.origin.is(l))){let u=l.getParent();u&&u.is(s)&&l.remove(),d.replace(l)}}else d===null&&ve(263,Array.from(i).join(" "))}else a.insert(l);a=Nn(l,this.direction)}for(let l of i.values())l.remove();return this}},bu=class e extends ql{type="child";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:xa(t,this.direction)}getParentCaret(t="root"){return Nn(SC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return Nn(this.getNodeAtCaret(),t)||xa(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}},b4={root:Fn,shadowRoot:or};function Cs(e){return x4[e]}function SC(e,t="root"){return b4[t](e)?null:e}var Vl=class e extends ql{type="sibling";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:Nn(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return me(this.origin)?xa(this.origin,this.direction):null}getParentCaret(t="root"){return Nn(SC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return Nn(this.getNodeAtCaret(),t)||xa(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Wl)&&this.direction===t.direction&&this.origin.is(t.origin)}},Wl=class e extends ql{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){let t=this.origin.getLatest();return t===this.origin?this:gs(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Nn(SC(this.getParentAtCaret(),t),this.direction)}getFlipped(){return gs(this.origin,Cs(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Vl||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Nn(this.origin,this.direction)}};function Ca(e){return e instanceof Wl}function S4(e){return e instanceof ql}function vi(e){return e instanceof Vl}function br(e){return e instanceof bu}var I4={next:class extends Wl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Wl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},w4={next:class extends Vl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Vl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},T4={next:class extends bu{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends bu{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Nn(e,t){return e?new w4[t](e):null}function gs(e,t,n){return e?new I4[t](e,Sr(e,n)):null}function Sr(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&MR(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function By(e,t){return new Pm(e,t)}function xa(e,t){return me(e)?new T4[t](e):null}function aE(e){return e&&e.getChildCaret()||e}function Gl(e){return e&&aE(e.getAdjacentCaret())}var zy=class e{type="node-caret-range";direction;anchor;focus;constructor(t,n,o){this.anchor=t,this.focus=n,this.direction=o}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let t=r=>{let a=this[r].getLatest();return Ca(a)?(function(s,i){let{direction:l,origin:d}=s,u=Sr(d,i==="focus"?Cs(l):l);return By(s,u-s.offset)})(a,r):null},n=t("anchor"),o=t("focus");if(n&&o){let{caret:r}=n,{caret:a}=o;if(r.isSameNodeCaret(a))return[By(r,a.offset-r.offset),null]}return[n,o]}iterNodeCarets(t="root"){let n=Ca(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=Ca(o),a=s=>s.isSameNodeCaret(o)?null:Gl(s)||s.getParentCaret(t);return wC({hasNext:s=>s!==null&&!(r&&o.isSameNodeCaret(s)),initial:n.isSameNodeCaret(o)?null:a(n),map:s=>s,step:a})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Pm=class{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){let{distance:t,caret:{offset:n}}=this,o=n+t;return o<n?[o,n]:[n,o]}getTextContent(){let[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:t,direction:n}}=this,[o,r]=this.getSliceIndices(),a=t.getTextContent();return gs(t.setTextContent(a.slice(0,o)+a.slice(r)),n,o)}};function k4(e){return e instanceof Pm}function IC(e){return hs(e,Nn(zo(),e.direction))}function sE(e){return hs(e,e)}function hs(e,t){return e.direction!==t.direction&&ve(265),new zy(e,t,e.direction)}function wC(e){let{initial:t,hasNext:n,step:o,map:r}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let s={done:!1,value:r(a)};return a=o(a),s}}}function TC(e,t){let n=du(e.origin,t.origin);switch(n===null&&ve(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?(function(a,s){return Math.sign(a-s)})(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return kC(n)}}function kC(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,a=t,s=n;for(;a&&s;a=a.getNextSibling(),s=s.getNextSibling()){if(a.__key===r)return-1;if(s.__key===o)return 1}return a===null?1:-1}function om(e,t){return t.is(e)}function LR(e){return me(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function du(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=LR(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=LR(t);o;r=o,o=o.getParent()){let a=n.get(o);if(a!==void 0)return a===null?(om(e,o)||ve(276),{commonAncestor:o,type:"ancestor"}):r===null?(om(t,o)||ve(277),{commonAncestor:o,type:"descendant"}):((me(a)||om(e,a))&&(me(r)||om(t,r))&&o.is(a.getParent())&&o.is(r.getParent())||ve(278),{a,b:r,commonAncestor:o,type:"branch"})}return null}function vs(e,t){let{type:n,key:o,offset:r}=e,a=ZL(e.key);return n==="text"?(We(a)||ve(266,a.getType(),o),gs(a,t,r)):(me(a)||ve(267,a.getType(),o),cE(a,e.offset,t))}function jl(e,t){let{origin:n,direction:o}=t,r=o==="next";Ca(t)?e.set(n.getKey(),t.offset,"text"):vi(t)?We(n)?e.set(n.getKey(),Sr(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(br(t)&&me(n)||ve(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function iE(e){let t=Mt(),n=tt(t)?t:LL();return cu(n,e),bo(n),n}function cu(e,t){jl(e.anchor,t.anchor),jl(e.focus,t.focus)}function Hy(e){let{anchor:t,focus:n}=e,o=vs(t,"next"),r=vs(n,"next"),a=TC(o,r)<=0?"next":"previous";return hs(ys(o,a),ys(r,a))}function Xl(e){let{direction:t,origin:n}=e,o=Nn(n,Cs(t)).getNodeAtCaret();return o?Nn(o,t):xa(n.getParentOrThrow(),t)}function ER(e,t="root"){let n=[e];for(let o=br(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Xl(o));return n}function dy(e){return!!e&&e.origin.isAttached()}function lE(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,a=PC(e,o),s=ER(a.anchor,n),i=ER(a.focus.getFlipped(),n),l=new Set,d=[];for(let g of a.iterNodeCarets(n))if(br(g))l.add(g.origin.getKey());else if(vi(g)){let{origin:h}=g;me(h)&&!l.has(h.getKey())||d.push(h)}for(let g of d)g.remove();for(let g of a.getTextSlices()){if(!g)continue;let{origin:h}=g.caret,v=h.getTextContentSize(),C=Xl(Nn(h,o)),y=h.getMode();if(Math.abs(g.distance)===v&&r==="removeEmptySlices"||y==="token"&&g.distance!==0)C.remove();else if(g.distance!==0){r="removeEmptySlices";let x=g.removeTextSlice(),w=g.caret.origin;if(y==="segmented"){let I=x.origin,S=Rn(I.getTextContent()).setStyle(I.getStyle()).setFormat(I.getFormat());C.replaceOrInsert(S),x=gs(S,o,x.offset)}w.is(s[0].origin)&&(s[0]=x),w.is(i[0].origin)&&(i[0]=x.getFlipped())}}let u,p;for(let g of s)if(dy(g)){u=Cr(g);break}for(let g of i)if(dy(g)){p=Cr(g);break}let f=(function(g,h,v){if(!g||!h)return null;let C=g.getParentAtCaret(),y=h.getParentAtCaret();if(!C||!y)return null;let x=C.getParents().reverse();x.push(C);let w=y.getParents().reverse();w.push(y);let I=Math.min(x.length,w.length),S;for(S=0;S<I&&x[S]===w[S];S++);let k=(R,E)=>{let D;for(let L=S;L<R.length;L++){let O=R[L];if(or(O))return;!D&&E(O)&&(D=O)}return D},P=k(x,va),T=P&&k(w,R=>v.has(R.getKey())&&va(R));return P&&T?[P,T]:null})(u,p,l);if(f){let[g,h]=f;xa(g,"previous").splice(0,h.getChildren());let v=h.getParent();for(h.remove(!0);v&&v.isEmpty();){let C=v;v=v.getParent(),C.remove(!0)}}let m=[u,p,...s,...i].find(dy);if(m)return sE(ys(Cr(m),e.direction));ve(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Cr(e){let t=(function(r){let a=r;for(;br(a);){let s=Gl(a);if(!br(s))break;a=s}return a})(e.getLatest()),{direction:n}=t;if(We(t.origin))return Ca(t)?t:gs(t.origin,n,n);let o=t.getAdjacentCaret();return vi(o)&&We(o.origin)?gs(o.origin,n,Cs(n)):t}function dE(e){return Ca(e)&&e.offset!==Sr(e.origin,e.direction)}function ys(e,t){return e.direction===t?e:e.getFlipped()}function PC(e,t){return e.direction===t?e:hs(ys(e.focus,t),ys(e.anchor,t))}function cE(e,t,n){let o=xa(e,"next");for(let r=0;r<t;r++){let a=o.getAdjacentCaret();if(a===null)break;o=a}return ys(o,n)}function P4(e,t="root"){let n=0,o=e,r=Gl(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=Gl(o)}return r&&[r,n]}function R4(e){let{origin:t,offset:n,direction:o}=e;if(n===Sr(t,o))return e.getSiblingCaret();if(n===Sr(t,Cs(o)))return Xl(e.getSiblingCaret());let[r]=t.splitText(n);return We(r)||ve(281),ys(Nn(r,"next"),o)}function L4(e,t){return!0}function E4(e,{$copyElementNode:t=CC,$splitTextPointCaretNext:n=R4,rootMode:o="shadowRoot",$shouldSplit:r=L4}={}){if(Ca(e))return n(e);let a=e.getParentCaret(o);if(a){let{origin:s}=a;if(br(e)&&(!s.canBeEmpty()||!r(s,"first")))return Xl(a);let i=(function(l){let d=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())d.push(u.origin);return d})(e);(i.length>0||s.canBeEmpty()&&r(s,"last"))&&a.insert(t(s).splice(0,0,i))}return a}function M4(e){return e}function A4(...e){return e}function N4(e,t){return[e,t]}function _4(e){return e}function D4(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Lu(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function O4(e,...t){let n=Lu(...t);n.length>0&&e.classList.add(...n)}function F4(e,...t){let n=Lu(...t);n.length>0&&e.classList.remove(...n)}function B4(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var B=RC,che=B.$addUpdateTag,xs=B.$applyNodeReplacement,Jl=B.$caretFromPoint,uE=B.$caretRangeFromSelection,zm=B.$cloneWithProperties,pE=B.$cloneWithPropertiesEphemeral,uhe=B.$comparePointCaretNext,phe=B.$copyNode,fE=B.$create,Ci=B.$createLineBreakNode,mE=B.$createNodeSelection,rr=B.$createParagraphNode,fhe=B.$createPoint,xi=B.$createRangeSelection,gE=B.$createRangeSelectionFromDom,hE=B.$createTabNode,kr=B.$createTextNode,vE=B.$extendCaretToRange,Sa=B.$findMatchingParent,LC=B.$getAdjacentChildCaret,mhe=B.$getAdjacentNode,bi=B.$getAdjacentSiblingOrParentSiblingCaret,EC=B.$getCaretInDirection,yE=B.$getCaretRange,ghe=B.$getCaretRangeInDirection,CE=B.$getCharacterOffsets,bs=B.$getChildCaret,hhe=B.$getChildCaretAtIndex,MC=B.$getChildCaretOrSelf,xE=B.$getCollapsedCaretRange,vhe=B.$getCommonAncestor,yhe=B.$getCommonAncestorResultBranchOrder,Hm=B.$getEditor,Che=B.$getNearestNodeFromDOMNode,xhe=B.$getNearestRootOrShadowRoot,Zl=B.$getNodeByKey,bhe=B.$getNodeByKeyOrThrow,bE=B.$getNodeFromDOMNode,Eu=B.$getPreviousSelection,St=B.$getRoot,Fe=B.$getSelection,Ia=B.$getSiblingCaret,Um=B.$getState,She=B.$getStateChange,Ihe=B.$getTextContent,whe=B.$getTextNodeOffset,The=B.$getTextPointCaret,khe=B.$getTextPointCaretSlice,Phe=B.$getWritableNodeState,SE=B.$hasAncestor,Rhe=B.$hasUpdateTag,Lhe=B.$insertNodes,ed=B.$isBlockElementNode,Mu=B.$isChildCaret,Km=B.$isDecoratorNode,IE=B.$isEditorState,Ze=B.$isElementNode,wE=B.$isExtendableTextPointCaret,Ehe=B.$isInlineElementOrDecoratorNode,TE=B.$isLeafNode,td=B.$isLineBreakNode,Mhe=B.$isNodeCaret,AC=B.$isNodeSelection,kE=B.$isParagraphNode,Me=B.$isRangeSelection,Au=B.$isRootNode,Si=B.$isRootOrShadowRoot,PE=B.$isSiblingCaret,Ahe=B.$isTabNode,mt=B.$isTextNode,$m=B.$isTextPointCaret,Nhe=B.$isTextPointCaretSlice,NC=B.$isTokenOrSegmented,_he=B.$isTokenOrTab,Dhe=B.$nodesOfType,RE=B.$normalizeCaret,LE=B.$normalizeSelection__EXPERIMENTAL,Ohe=B.$onUpdate,EE=B.$parseSerializedNode,Fhe=B.$removeTextFromCaretRange,ME=B.$rewindSiblingCaret,qm=B.$selectAll,Bhe=B.$setCompositionKey,zhe=B.$setPointFromCaret,ar=B.$setSelection,AE=B.$setSelectionFromCaretRange,Vm=B.$setState,NE=B.$splitAtPointCaretNext,_E=B.$splitNode,Hhe=B.$updateRangeSelectionFromCaretRange,_C=B.ArtificialNode__DO_NOT_USE,Uhe=B.BEFORE_INPUT_COMMAND,DE=B.BLUR_COMMAND,Nu=B.CAN_REDO_COMMAND,_u=B.CAN_UNDO_COMMAND,Wm=B.CLEAR_EDITOR_COMMAND,OE=B.CLEAR_HISTORY_COMMAND,FE=B.CLICK_COMMAND,Khe=B.COLLABORATION_TAG,Gm=B.COMMAND_PRIORITY_CRITICAL,Yt=B.COMMAND_PRIORITY_EDITOR,sr=B.COMMAND_PRIORITY_HIGH,nd=B.COMMAND_PRIORITY_LOW,$he=B.COMMAND_PRIORITY_NORMAL,qhe=B.COMPOSITION_END_COMMAND,BE=B.COMPOSITION_END_TAG,Vhe=B.COMPOSITION_START_COMMAND,zE=B.COMPOSITION_START_TAG,HE=B.CONTROLLED_TEXT_INSERTION_COMMAND,jm=B.COPY_COMMAND,UE=B.CUT_COMMAND,Qm=B.DELETE_CHARACTER_COMMAND,KE=B.DELETE_LINE_COMMAND,$E=B.DELETE_WORD_COMMAND,Whe=B.DRAGEND_COMMAND,Ghe=B.DRAGOVER_COMMAND,qE=B.DRAGSTART_COMMAND,VE=B.DROP_COMMAND,So=B.DecoratorNode,jhe=B.ElementNode,WE=B.FOCUS_COMMAND,Qhe=B.FORMAT_ELEMENT_COMMAND,GE=B.FORMAT_TEXT_COMMAND,Ym=B.HISTORIC_TAG,Io=B.HISTORY_MERGE_TAG,jE=B.HISTORY_PUSH_TAG,DC=B.INDENT_CONTENT_COMMAND,Yhe=B.INPUT_COMMAND,OC=B.INSERT_LINE_BREAK_COMMAND,QE=B.INSERT_PARAGRAPH_COMMAND,YE=B.INSERT_TAB_COMMAND,Du=B.INTERNAL_$isBlock,Xhe=B.IS_ALL_FORMATTING,Jhe=B.IS_BOLD,Zhe=B.IS_CODE,eve=B.IS_HIGHLIGHT,tve=B.IS_ITALIC,nve=B.IS_STRIKETHROUGH,ove=B.IS_SUBSCRIPT,rve=B.IS_SUPERSCRIPT,ave=B.IS_UNDERLINE,XE=B.KEY_ARROW_DOWN_COMMAND,Xm=B.KEY_ARROW_LEFT_COMMAND,Jm=B.KEY_ARROW_RIGHT_COMMAND,JE=B.KEY_ARROW_UP_COMMAND,Zm=B.KEY_BACKSPACE_COMMAND,ZE=B.KEY_DELETE_COMMAND,eM=B.KEY_DOWN_COMMAND,eg=B.KEY_ENTER_COMMAND,tM=B.KEY_ESCAPE_COMMAND,sve=B.KEY_MODIFIER_COMMAND,ive=B.KEY_SPACE_COMMAND,tg=B.KEY_TAB_COMMAND,nM=B.LineBreakNode,lve=B.MOVE_TO_END,dve=B.MOVE_TO_START,cve=B.NODE_STATE_KEY,oM=B.OUTDENT_CONTENT_COMMAND,ng=B.PASTE_COMMAND,rM=B.PASTE_TAG,aM=B.ParagraphNode,sM=B.REDO_COMMAND,iM=B.REMOVE_TEXT_COMMAND,lM=B.RootNode,uve=B.SELECTION_CHANGE_COMMAND,dM=B.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,cM=B.SELECT_ALL_COMMAND,pve=B.SKIP_COLLAB_TAG,uM=B.SKIP_DOM_SELECTION_TAG,FC=B.SKIP_SCROLL_INTO_VIEW_TAG,fve=B.SKIP_SELECTION_FOCUS_TAG,pM=B.TEXT_TYPE_TO_FORMAT,fM=B.TabNode,og=B.TextNode,mM=B.UNDO_COMMAND,Ou=B.addClassNamesToElement,mve=B.buildImportMap,rg=B.configExtension,gM=B.createCommand,ag=B.createEditor,gve=B.createSharedNodeState,hM=B.createState,vM=B.declarePeerDependency,fn=B.defineExtension,hve=B.flipDirection,vve=B.getDOMOwnerDocument,BC=B.getDOMSelection,yve=B.getDOMSelectionFromTarget,yM=B.getDOMTextNode,Cve=B.getEditorPropertyFromDOMNode,xve=B.getNearestEditorFromDOMNode,CM=B.getRegisteredNode,bve=B.getRegisteredNodeOrThrow,Sve=B.getStaticNodeConfig,Ive=B.getTextDirection,wve=B.getTransformSetFromKlass,xM=B.isBlockDomNode,Tve=B.isCurrentlyReadOnlyMode,bM=B.isDOMDocumentNode,SM=B.isDOMNode,kve=B.isDOMTextNode,Pve=B.isDOMUnmanaged,zC=B.isDocumentFragment,Rve=B.isExactShortcutMatch,IM=B.isHTMLAnchorElement,sg=B.isHTMLElement,Fu=B.isInlineDomNode,Lve=B.isLexicalEditor,Eve=B.isModifierMatch,Mve=B.isSelectionCapturedInDecoratorInput,wM=B.isSelectionWithinEditor,HC=B.makeStepwiseIterator,Vr=B.mergeRegister,Ave=B.normalizeClassNames,ig=B.removeClassNamesFromElement,Nve=B.removeFromParent,_ve=B.resetRandomKey,Pr=B.safeCast,Dve=B.setDOMUnmanaged,Ove=B.setNodeIndentFromDOM,lg=B.shallowMergeConfig,UC=B.toggleTextFormatType;var KC={};un(KC,{LexicalComposer:()=>H4});V();var TM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,z4=TM?fe:$,dg={tag:Io};function H4({initialConfig:e,children:t}){let n=K(()=>{let{theme:o,namespace:r,nodes:a,onError:s,editorState:i,html:l}=e,d=zP(null,o),u=ag({editable:e.editable,html:l,namespace:r,nodes:a,onError:p=>s(p,u),theme:o});return(function(p,f){if(f!==null){if(f===void 0)p.update(()=>{let m=St();if(m.isEmpty()){let g=rr();m.append(g);let h=TM?document.activeElement:null;(Fe()!==null||h!==null&&h===p.getRootElement())&&g.select()}},dg);else if(f!==null)switch(typeof f){case"string":{let m=p.parseEditorState(f);p.setEditorState(m,dg);break}case"object":p.setEditorState(f,dg);break;case"function":p.update(()=>{St().isEmpty()&&f(p)},dg)}}})(u,i),[u,d]},[]);return z4(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),c(BP.Provider,{value:n,children:t})}var U4=KC,kM=U4.LexicalComposer;var qC={};un(qC,{$canShowPlaceholder:()=>RM,$canShowPlaceholderCurry:()=>$4,$findTextIntersectionFromCharacters:()=>q4,$isRootTextContentEmpty:()=>$C,$isRootTextContentEmptyCurry:()=>K4,$rootTextContent:()=>PM,registerLexicalTextEntity:()=>W4});function PM(){return St().getTextContent()}function $C(e,t=!0){if(e)return!1;let n=PM();return t&&(n=n.trim()),n===""}function K4(e,t){return()=>$C(e,t)}function RM(e){if(!$C(e,!1))return!1;let t=St().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(Km(r))return!1;if(Ze(r)){if(!kE(r)||r.__indent!==0)return!1;let a=r.getChildren(),s=a.length;for(let i=0;i<s;i++){let l=a[o];if(!mt(l))return!1}}}return!0}function $4(e){return()=>RM(e)}function q4(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(Ze(n)){let s=n.getFirstChild();if(s!==null){n=s;continue}}else if(mt(n)){let s=n.getTextContentSize();if(o+s>t)return{node:n,offset:t-o};o+=s}let r=n.getNextSibling();if(r!==null){n=r;continue}let a=n.getParent();for(;a!==null;){let s=a.getNextSibling();if(s!==null){n=s;continue e}a=a.getParent()}break}return null}function V4(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function W4(e,t,n,o){let r=s=>s instanceof n,a=s=>{let i=kr(s.getTextContent());i.setFormat(s.getFormat()),s.replace(i)};return[e.registerNodeTransform(og,s=>{if(!s.isSimpleText())return;let i,l=s.getPreviousSibling(),d=s.getTextContent(),u=s;if(mt(l)){let f=l.getTextContent(),m=t(f+d);if(r(l)){if(m===null||(g=>g.getLatest().__mode)(l)!==0)return void a(l);{let g=m.end-f.length;if(g>0){let h=f+d.slice(0,g);if(l.select(),l.setTextContent(h),g===d.length)s.remove();else{let v=d.slice(g);s.setTextContent(v)}return}}}else if(m===null||m.start<f.length)return}let p=0;for(;;){i=t(d);let f,m=i===null?"":d.slice(i.end);if(d=m,m===""){let h=u.getNextSibling();if(mt(h)){m=u.getTextContent()+h.getTextContent();let v=t(m);if(v===null)return void(r(h)?a(h):h.markDirty());if(v.start!==0)return}}if(i===null)return;if(i.start===0&&mt(l)&&l.isTextEntity()){p+=i.end;continue}i.start===0?[f,u]=u.splitText(i.end):[,f,u]=u.splitText(i.start+p,i.end+p),f===void 0&&V4(165,"nodeToReplace");let g=o(f);if(g.setFormat(f.getFormat()),f.replace(g),u==null)return;p=0,l=g}}),e.registerNodeTransform(n,s=>{let i=s.getTextContent(),l=t(i);if(l===null||l.start!==0)return void a(s);if(i.length>l.end)return void s.splitText(l.end);let d=s.getPreviousSibling();mt(d)&&d.isTextEntity()&&(a(d),a(s));let u=s.getNextSibling();mt(u)&&u.isTextEntity()&&(a(u),r(s)&&a(s))})]}var Ii=qC,qve=Ii.$canShowPlaceholder,cg=Ii.$canShowPlaceholderCurry,Vve=Ii.$findTextIntersectionFromCharacters,Wve=Ii.$isRootTextContentEmpty,Gve=Ii.$isRootTextContentEmptyCurry,jve=Ii.$rootTextContent,Qve=Ii.registerLexicalTextEntity;var YC={};un(YC,{$addNodeStyle:()=>J4,$cloneWithProperties:()=>zm,$copyBlockFormatIndent:()=>FM,$ensureForwardRangeSelection:()=>OM,$forEachSelectedTextNode:()=>DM,$getComputedStyleForElement:()=>GC,$getComputedStyleForParent:()=>jC,$getSelectionStyleValueForProperty:()=>sW,$isAtNodeEnd:()=>X4,$isParentElementRTL:()=>QC,$isParentRTL:()=>Q4,$moveCaretSelection:()=>HM,$moveCharacter:()=>rW,$patchStyleText:()=>Z4,$selectAll:()=>qm,$setBlocksType:()=>eW,$shouldOverrideDefaultCharacterSelection:()=>oW,$sliceSelectedTextNodeContent:()=>Y4,$trimTextContentFromAnchor:()=>_M,$wrapNodes:()=>nW,createDOMRange:()=>G4,createRectsFromDOMRange:()=>j4,getCSSFromStyleObject:()=>NM,getStyleObjectFromCSS:()=>fg,trimTextContentFromAnchor:()=>iW});function WC(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var pg=new Map;function LM(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function EM(e){let t=e.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function G4(e,t,n,o,r){let a=t.getKey(),s=o.getKey(),i=document.createRange(),l=e.getElementByKey(a),d=e.getElementByKey(s),u=n,p=r;if(mt(t)&&(l=LM(l)),mt(o)&&(d=LM(d)),t===void 0||o===void 0||l===null||d===null)return null;l.nodeName==="BR"&&([l,u]=EM(l)),d.nodeName==="BR"&&([d,p]=EM(d));let f=l.firstChild;l===d&&f!=null&&f.nodeName==="BR"&&u===0&&p===0&&(p=1);try{i.setStart(l,u),i.setEnd(d,p)}catch{return null}return!i.collapsed||u===p&&a===s||(i.setStart(d,p),i.setEnd(l,u)),i}function j4(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),a=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),s=Array.from(t.getClientRects()),i,l=s.length;s.sort((d,u)=>{let p=d.top-u.top;return Math.abs(p)<=3?d.left-u.left:p});for(let d=0;d<l;d++){let u=s[d],p=i&&i.top<=u.top&&i.top+i.height>u.top&&i.left+i.width>u.left,f=u.width+a===o.width;p||f?(s.splice(d--,1),l--):i=u}return s}function AM(e){let t={};if(!e)return t;let n=e.split(";");for(let o of n)if(o!==""){let[r,a]=o.split(/:([^]+)/);r&&a&&(t[r.trim()]=a.trim())}return t}function fg(e){let t=pg.get(e);return t===void 0&&(t=AM(e),pg.set(e,t)),t}function NM(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function GC(e){let t=Hm().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function jC(e){return GC(Au(e)?e:e.getParentOrThrow())}function Q4(e){let t=jC(e);return t!==null&&t.direction==="rtl"}function Y4(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!NC(t)&&o!==null){let[r,a]=o,s=e.isBackward(),i=r.getNode(),l=a.getNode(),d=t.is(i),u=t.is(l);if(d||u){let[p,f]=CE(e),m=i.is(l),g=t.is(s?l:i),h=t.is(s?i:l),v,C=0;m?(C=p>f?f:p,v=p>f?p:f):g?(C=s?f:p,v=void 0):h&&(C=0,v=s?p:f);let y=t.__text.slice(C,v);y!==t.__text&&(n==="clone"&&(t=pE(t)),t.__text=y)}}return t}function X4(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return Ze(t)||WC(177),e.offset===t.getChildrenSize()}function _M(e,t,n){let o=t.getNode(),r=n;if(Ze(o)){let a=o.getDescendantByIndex(t.offset);a!==null&&(o=a)}for(;r>0&&o!==null;){if(Ze(o)){let d=o.getLastDescendant();d!==null&&(o=d)}let a=o.getPreviousSibling(),s=0;if(a===null){let d=o.getParentOrThrow(),u=d.getPreviousSibling();for(;u===null;){if(d=d.getParent(),d===null){a=null;break}u=d.getPreviousSibling()}d!==null&&(s=d.isInline()?0:2,a=u)}let i=o.getTextContent();i===""&&Ze(o)&&!o.isInline()&&(i=`
3795
3795
 
3796
- `);let l=i.length;if(!mt(o)||r>=l){let d=o.getParent();o.remove(),d==null||d.getChildrenSize()!==0||Au(d)||d.remove(),r-=l+s,o=a}else{let d=o.getKey(),u=e.getEditorState().read(()=>{let m=Zl(d);return mt(m)&&m.isSimpleText()?m.getTextContent():null}),p=l-r,f=i.slice(0,p);if(u!==null&&u!==i){let m=Eu(),g=o;if(o.isSimpleText())o.setTextContent(u);else{let h=kr(u);o.replace(h),g=h}if(Me(m)&&m.isCollapsed()){let h=m.anchor.offset;g.select(h,h)}}else if(o.isSimpleText()){let m=t.key===d,g=t.offset;g<r&&(g=l);let h=m?g-r:0,v=m?g:p;if(m&&h===0){let[C]=o.splitText(h,v);C.remove()}else{let[,C]=o.splitText(h,v);C.remove()}}else{let m=kr(f);o.replace(m)}r=0}}}function J4(e){let t=e.getStyle(),n=AM(t);pg.set(t,n)}function ug(e,t){(Me(e)?e.isCollapsed():mt(e)||Ze(e))||WC(280);let n=fg(Me(e)?e.style:mt(e)?e.getStyle():e.getTextStyle()),o=Object.entries(t).reduce((a,[s,i])=>(typeof i=="function"?a[s]=i(n[s],e):i===null?delete a[s]:a[s]=i,a),{...n}),r=NM(o);Me(e)||mt(e)?e.setStyle(r):e.setTextStyle(r),pg.set(r,o)}function Z4(e,t){if(Me(e)&&e.isCollapsed()){ug(e,t);let o=e.anchor.getNode();Ze(o)&&o.isEmpty()&&ug(o,t)}DM(o=>{ug(o,t)});let n=e.getNodes();if(n.length>0){let o=new Set;for(let r of n){if(!Ze(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let a=r.getKey();o.has(a)||(o.add(a),ug(r,t))}}}function DM(e){let t=Fe();if(!t)return;let n=new Map,o=a=>n.get(a.getKey())||[0,a.getTextContentSize()];if(Me(t))for(let a of uE(t).getTextSlices())a&&n.set(a.caret.origin.getKey(),a.getSliceIndices());let r=t.getNodes();for(let a of r){if(!mt(a)||!a.canHaveFormat())continue;let[s,i]=o(a);i!==s&&(NC(a)||s===0&&i===a.getTextContentSize()?e(a):e(a.splitText(s,i)[s===0?0:1]))}Me(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&OM(t)}function OM(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:a}=t;t.set(n.key,n.offset,n.type),n.set(o,r,a)}}function FM(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function eW(e,t,n=FM){if(e===null)return;let o=e.getStartEndPoints(),r=new Map,a=null;if(o){let[s,i]=o;a=xi(),a.anchor.set(s.key,s.offset,s.type),a.focus.set(i.key,i.offset,i.type);let l=Sa(s.getNode(),Du),d=Sa(i.getNode(),Du);Ze(l)&&r.set(l.getKey(),l),Ze(d)&&r.set(d.getKey(),d)}for(let s of e.getNodes())if(Ze(s)&&Du(s))r.set(s.getKey(),s);else if(o===null){let i=Sa(s,Du);Ze(i)&&r.set(i.getKey(),i)}for(let[s,i]of r){let l=t();n(i,l),i.replace(l,!0),a&&(s===a.anchor.key&&a.anchor.set(l.getKey(),a.anchor.offset,a.anchor.type),s===a.focus.key&&a.focus.set(l.getKey(),a.focus.offset,a.focus.type))}a&&e.is(Fe())&&ar(a)}function MM(e){return e.getNode().isAttached()}function tW(e){let t=e;for(;t!==null&&!Si(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function nW(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,a=e.getNodes(),s=a.length;if(r!==null&&(s===0||s===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let d=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=d.getChildren(),p=t();return p.setFormat(d.getFormatType()),p.setIndent(d.getIndent()),u.forEach(f=>p.append(f)),n&&(p=n.append(p)),void d.replace(p)}let i=null,l=[];for(let d=0;d<s;d++){let u=a[d];Si(u)?(VC(e,l,l.length,t,n),l=[],i=u):i===null||i!==null&&SE(u,i)?l.push(u):(VC(e,l,l.length,t,n),l=[u])}VC(e,l,l.length,t,n)}function VC(e,t,n,o,r=null){if(t.length===0)return;let a=t[0],s=new Map,i=[],l=Ze(a)?a:a.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let d=!1;for(;l!==null;){let g=l.getPreviousSibling();if(g!==null){l=g,d=!0;break}if(l=l.getParentOrThrow(),Si(l))break}let u=new Set;for(let g=0;g<n;g++){let h=t[g];Ze(h)&&h.getChildrenSize()===0&&u.add(h.getKey())}let p=new Set;for(let g=0;g<n;g++){let h=t[g],v=h.getParent();if(v!==null&&v.isInline()&&(v=v.getParent()),v!==null&&TE(h)&&!p.has(h.getKey())){let C=v.getKey();if(s.get(C)===void 0){let y=o();y.setFormat(v.getFormatType()),y.setIndent(v.getIndent()),i.push(y),s.set(C,y),v.getChildren().forEach(x=>{y.append(x),p.add(x.getKey()),Ze(x)&&x.getChildrenKeys().forEach(w=>p.add(w))}),tW(v)}}else if(u.has(h.getKey())){Ze(h)||WC(179);let C=o();C.setFormat(h.getFormatType()),C.setIndent(h.getIndent()),i.push(C),h.remove(!0)}}if(r!==null)for(let g=0;g<i.length;g++){let h=i[g];r.append(h)}let f=null;if(Si(l))if(d)if(r!==null)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h)}else{let g=l.getFirstChild();if(Ze(g)&&(l=g),g===null)if(r)l.append(r);else for(let h=0;h<i.length;h++){let v=i[h];l.append(v),f=v}else if(r!==null)g.insertBefore(r);else for(let h=0;h<i.length;h++){let v=i[h];g.insertBefore(v),f=v}}else if(r)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h),f=h}let m=Eu();Me(m)&&MM(m.anchor)&&MM(m.focus)?ar(m.clone()):f!==null?f.selectEnd():e.dirty=!0}function BM(e){let t=zM(e);return t!==null&&t.writingMode==="vertical-rl"}function zM(e){let t=e.anchor.getNode();return Ze(t)?GC(t):jC(t)}function oW(e,t){let n=BM(e)?!t:t;QC(e)&&(n=!n);let o=Jl(e.focus,n?"previous":"next");if(wE(o))return!1;for(let r of vE(o)){if(Mu(r))return!r.origin.isInline();if(!Ze(r.origin)){if(Km(r.origin))return!0;break}}return!1}function HM(e,t,n,o){e.modify(t?"extend":"move",n,o)}function QC(e){let t=zM(e);return t!==null&&t.direction==="rtl"}function rW(e,t,n){let o=QC(e),r;r=BM(e)||o?!n:n,HM(e,t,r,"character")}function aW(e,t,n){let o=fg(e.getStyle());return o!==null&&o[t]||n}function sW(e,t,n=""){let o=null,r=e.getNodes(),a=e.anchor,s=e.focus,i=e.isBackward(),l=i?s.offset:a.offset,d=i?s.getNode():a.getNode();if(Me(e)&&e.isCollapsed()&&e.style!==""){let u=fg(e.style);if(u!==null&&t in u)return u[t]}for(let u=0;u<r.length;u++){let p=r[u];if((u===0||l!==0||!p.is(d))&&mt(p)){let f=aW(p,t,n);if(o===null)o=f;else if(o!==f){o="";break}}}return o===null?n:o}var iW=_M;var tn=YC,UM=tn.$addNodeStyle,Xve=tn.$cloneWithProperties,Jve=tn.$copyBlockFormatIndent,Zve=tn.$ensureForwardRangeSelection,eye=tn.$forEachSelectedTextNode,tye=tn.$getComputedStyleForElement,nye=tn.$getComputedStyleForParent,oye=tn.$getSelectionStyleValueForProperty,rye=tn.$isAtNodeEnd,aye=tn.$isParentElementRTL,sye=tn.$isParentRTL,iye=tn.$moveCaretSelection,XC=tn.$moveCharacter,lye=tn.$patchStyleText,dye=tn.$selectAll,cye=tn.$setBlocksType,JC=tn.$shouldOverrideDefaultCharacterSelection,mg=tn.$sliceSelectedTextNodeContent,uye=tn.$trimTextContentFromAnchor,pye=tn.$wrapNodes,fye=tn.createDOMRange,KM=tn.createRectsFromDOMRange,mye=tn.getCSSFromStyleObject,gye=tn.getStyleObjectFromCSS,hye=tn.trimTextContentFromAnchor;var nx={};un(nx,{$descendantsMatching:()=>qW,$dfs:()=>kW,$dfsIterator:()=>JM,$filter:()=>BW,$findMatchingParent:()=>Sa,$firstToLastIterator:()=>VW,$getAdjacentCaret:()=>PW,$getAdjacentSiblingOrParentSiblingCaret:()=>bi,$getDepth:()=>eA,$getNearestBlockElementAncestorOrThrow:()=>AW,$getNearestNodeOfType:()=>MW,$getNextRightPreorderNode:()=>EW,$getNextSiblingOrParentSibling:()=>LW,$handleIndentAndOutdent:()=>zW,$insertFirst:()=>HW,$insertNodeToNearestRoot:()=>DW,$insertNodeToNearestRootAtCaret:()=>nA,$isEditorIsNestedEditor:()=>KW,$lastToFirstIterator:()=>tx,$restoreEditorState:()=>_W,$reverseDfs:()=>RW,$reverseDfsIterator:()=>tA,$splitNode:()=>_E,$unwrapAndFilterDescendants:()=>$W,$unwrapNode:()=>WW,$wrapNodeInElement:()=>OW,CAN_USE_BEFORE_INPUT:()=>vW,CAN_USE_DOM:()=>QM,IS_ANDROID:()=>yW,IS_ANDROID_CHROME:()=>CW,IS_APPLE:()=>xW,IS_APPLE_WEBKIT:()=>bW,IS_CHROME:()=>SW,IS_FIREFOX:()=>YM,IS_IOS:()=>IW,IS_SAFARI:()=>wW,addClassNamesToElement:()=>Ou,calculateZoomLevel:()=>UW,isBlockDomNode:()=>xM,isHTMLAnchorElement:()=>IM,isHTMLElement:()=>sg,isInlineDomNode:()=>Fu,isMimeType:()=>XM,makeStateWrapper:()=>GW,markSelection:()=>jM,mediaFileReader:()=>TW,mergeRegister:()=>Vr,objectKlassEquals:()=>FW,positionNodeOnRange:()=>GM,registerNestedElementResolver:()=>NW,removeClassNamesFromElement:()=>ig,selectionAlwaysOnDisplay:()=>hW});function gg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Rr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,lW=Rr&&"documentMode"in document?document.documentMode:null,VM=Rr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),dW=Rr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),cW=!(!Rr||!("InputEvent"in window)||lW)&&"getTargetRanges"in new window.InputEvent("input"),uW=Rr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pW=Rr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,WM=Rr&&/Android/.test(navigator.userAgent),ex=Rr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),fW=Rr&&WM&&ex,mW=Rr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&VM&&!ex;function Wr(e){return`${e}px`}var gW={attributes:!0,characterData:!0,childList:!0,subtree:!0};function GM(e,t,n){let o=null,r=null,a=null,s=[],i=document.createElement("div");function l(){o===null&&gg(182),r===null&&gg(183);let{left:p,top:f}=r.getBoundingClientRect(),m=KM(e,t);var g,h;i.isConnected||(h=i,(g=r).insertBefore(h,g.firstChild));let v=!1;for(let C=0;C<m.length;C++){let y=m[C],x=s[C]||document.createElement("div"),w=x.style;w.position!=="absolute"&&(w.position="absolute",v=!0);let I=Wr(y.left-p);w.left!==I&&(w.left=I,v=!0);let S=Wr(y.top-f);w.top!==S&&(x.style.top=S,v=!0);let k=Wr(y.width);w.width!==k&&(x.style.width=k,v=!0);let P=Wr(y.height);w.height!==P&&(x.style.height=P,v=!0),x.parentNode!==i&&(i.append(x),v=!0),s[C]=x}for(;s.length>m.length;)s.pop();v&&n(s)}function d(){r=null,o=null,a!==null&&a.disconnect(),a=null,i.remove();for(let p of s)p.remove();s=[]}i.style.position="relative";let u=e.registerRootListener(function p(){let f=e.getRootElement();if(f===null)return d();let m=f.parentElement;if(!sg(m))return d();d(),o=f,r=m,a=new MutationObserver(g=>{let h=e.getRootElement(),v=h&&h.parentElement;if(h!==o||v!==r)return p();for(let C of g)if(!i.contains(C.target))return l()}),a.observe(m,gW),l()});return()=>{u(),d()}}function $M(e,t,n){if(e.type!=="text"&&Ze(t)){let o=t.getDOMSlot(n);return[o.element,o.getFirstChildOffset()+e.offset]}return[yM(n)||n,e.offset]}function jM(e,t){let n=null,o=null,r=null,a=null,s=null,i=null,l=()=>{};function d(u){u.read(()=>{let p=Fe();if(!Me(p))return n=null,r=null,a=null,i=null,l(),void(l=()=>{});let[f,m]=(function(P){let T=P.getStartEndPoints();return P.isBackward()?[T[1],T[0]]:T})(p),g=f.getNode(),h=g.getKey(),v=f.offset,C=m.getNode(),y=C.getKey(),x=m.offset,w=e.getElementByKey(h),I=e.getElementByKey(y),S=n===null||w!==o||v!==r||h!==n.getKey(),k=a===null||I!==s||x!==i||y!==a.getKey();if((S||k)&&w!==null&&I!==null){let P=(function(T,R,E,D,L,O,U){let F=(T._window?T._window.document:document).createRange();return F.setStart(...$M(R,E,D)),F.setEnd(...$M(L,O,U)),F})(e,f,g,w,m,C,I);l(),l=GM(e,P,T=>{if(t===void 0)for(let R of T){let E=R.style;E.background!=="Highlight"&&(E.background="Highlight"),E.color!=="HighlightText"&&(E.color="HighlightText"),E.marginTop!==Wr(-1.5)&&(E.marginTop=Wr(-1.5)),E.paddingTop!==Wr(4)&&(E.paddingTop=Wr(4)),E.paddingBottom!==Wr(0)&&(E.paddingBottom=Wr(0))}else t(T)})}n=g,o=w,r=v,a=C,s=I,i=x})}return d(e.getEditorState()),Vr(e.registerUpdateListener(({editorState:u})=>d(u)),()=>{l()})}function hW(e,t){let n=null,o=()=>{let r=getSelection(),a=r&&r.anchorNode,s=e.getRootElement();a!==null&&s!==null&&s.contains(a)?n!==null&&(n(),n=null):n===null&&(n=jM(e,t))};return document.addEventListener("selectionchange",o),()=>{n!==null&&n(),document.removeEventListener("selectionchange",o)}}var vW=cW,QM=Rr,yW=WM,CW=fW,xW=VM,bW=mW,SW=ex,YM=dW,IW=pW,wW=uW;function XM(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function TW(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let a=[],s=()=>{let{done:i,value:l}=n.next();if(i)return o(a);let d=new FileReader;d.addEventListener("error",r),d.addEventListener("load",()=>{let u=d.result;typeof u=="string"&&a.push({file:l,result:u}),s()}),XM(l,t)?d.readAsDataURL(l):s()};s()})}function kW(e,t){return Array.from(JM(e,t))}function PW(e){return e?e.getAdjacentCaret():null}function RW(e,t){return Array.from(tA(e,t))}function JM(e,t){return ZM("next",e,t)}function qM(e,t){let n=bi(Ia(e,t));return n&&n[0]}function ZM(e,t,n){let o=St(),r=t||o,a=Ze(r)?bs(r,e):Ia(r,e),s=eA(r),i=n?LC(MC(Ia(n,e)))||qM(n,e):qM(r,e),l=s;return HC({hasNext:d=>d!==null,initial:a,map:d=>({depth:l,node:d.origin}),step:d=>{if(d.isSameNodeCaret(i))return null;Mu(d)&&l++;let u=bi(d);return!u||u[0].isSameNodeCaret(i)?null:(l+=u[1],u[0])}})}function LW(e){let t=bi(Ia(e,"next"));return t&&[t[0].origin,t[1]]}function eA(e){let t=-1;for(let n=e;n!==null;n=n.getParent())t++;return t}function EW(e){let t=MC(Ia(e,"previous")),n=bi(t,"root");return n&&n[0].origin}function tA(e,t){return ZM("previous",e,t)}function MW(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function AW(e){let t=Sa(e,n=>Ze(n)&&!n.isInline());return Ze(t)||gg(4,e.__key),t}function NW(e,t,n,o){let r=a=>a instanceof t;return e.registerNodeTransform(t,a=>{let s=(i=>{let l=i.getChildren();for(let p=0;p<l.length;p++){let f=l[p];if(r(f))return null}let d=i,u=i;for(;d!==null;)if(u=d,d=d.getParent(),r(d))return{child:u,parent:d};return null})(a);if(s!==null){let{child:i,parent:l}=s;if(i.is(a)){o(l,a);let d=i.getNextSiblings(),u=d.length;if(l.insertAfter(i),u!==0){let p=n(l);i.insertAfter(p);for(let f=0;f<u;f++)p.append(d[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function _W(e,t){let n=new Map,o=e._pendingEditorState;for(let[a,s]of t._nodeMap)n.set(a,zm(s));o&&(o._nodeMap=n),e._dirtyType=2;let r=t._selection;ar(r===null?null:r.clone())}function DW(e){let t=Fe()||Eu(),n;if(Me(t))n=Jl(t.focus,"next");else{if(t!=null){let s=t.getNodes(),i=s[s.length-1];i&&(n=Ia(i,"next"))}n=n||bs(St(),"previous").getFlipped().insert(rr())}let o=nA(e,n),r=LC(o),a=Mu(r)?RE(r):o;return AE(xE(a)),e.getLatest()}function nA(e,t,n){let o=EC(t,"next");for(let r=o;r;r=NE(r,n))o=r;return $m(o)&&gg(283),o.insert(e.isInline()?rr().append(e):e),EC(Ia(e.getLatest(),"next"),t.direction)}function OW(e,t){let n=t();return e.replace(n),n.append(e),n}function FW(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function BW(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function zW(e){let t=Fe();if(!Me(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let a=o[r],s=a.getKey();if(n.has(s))continue;let i=Sa(a,d=>Ze(d)&&!d.isInline());if(i===null)continue;let l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function HW(e,t){bs(e,"next").insert(t)}var ZC=!(YM||!QM)&&void 0;function UW(e,t=!1){let n=1;if((function(){if(ZC===void 0){let o=document.createElement("div");o.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),ZC=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return ZC})()||t)for(;e;)n*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return n}function KW(e){return e._parentEditor!==null}function $W(e,t){return oA(e,t,null)}function oA(e,t,n){let o=!1;for(let r of tx(e))t(r)?n!==null&&n(r):(o=!0,Ze(r)&&oA(r,t,n||(a=>r.insertAfter(a))),r.remove());return o}function qW(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(Ze(r))for(let a of tx(r))o.push(a);return n}function VW(e){return rA(bs(e,"next"))}function tx(e){return rA(bs(e,"previous"))}function rA(e){return HC({hasNext:PE,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function WW(e){ME(Ia(e,"next")).splice(1,e.getChildren())}function GW(e){let t=o=>Um(o,e),n=(o,r)=>Vm(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}var nt=nx,bye=nt.$descendantsMatching,Sye=nt.$dfs,Iye=nt.$dfsIterator,wye=nt.$filter,Tye=nt.$findMatchingParent,kye=nt.$firstToLastIterator,Pye=nt.$getAdjacentCaret,Rye=nt.$getAdjacentSiblingOrParentSiblingCaret,Lye=nt.$getDepth,aA=nt.$getNearestBlockElementAncestorOrThrow,Eye=nt.$getNearestNodeOfType,Mye=nt.$getNextRightPreorderNode,Aye=nt.$getNextSiblingOrParentSibling,sA=nt.$handleIndentAndOutdent,Nye=nt.$insertFirst,_ye=nt.$insertNodeToNearestRoot,Dye=nt.$insertNodeToNearestRootAtCaret,Oye=nt.$isEditorIsNestedEditor,Fye=nt.$lastToFirstIterator,Bye=nt.$restoreEditorState,zye=nt.$reverseDfs,Hye=nt.$reverseDfsIterator,Uye=nt.$splitNode,Kye=nt.$unwrapAndFilterDescendants,$ye=nt.$unwrapNode,qye=nt.$wrapNodeInElement,Vye=nt.CAN_USE_BEFORE_INPUT,Wye=nt.CAN_USE_DOM,Gye=nt.IS_ANDROID,jye=nt.IS_ANDROID_CHROME,Qye=nt.IS_APPLE,Yye=nt.IS_APPLE_WEBKIT,Xye=nt.IS_CHROME,Jye=nt.IS_FIREFOX,Zye=nt.IS_IOS,eCe=nt.IS_SAFARI,tCe=nt.addClassNamesToElement,nCe=nt.calculateZoomLevel,ox=nt.isBlockDomNode,oCe=nt.isHTMLAnchorElement,iA=nt.isHTMLElement,rCe=nt.isInlineDomNode,aCe=nt.isMimeType,sCe=nt.makeStateWrapper,iCe=nt.markSelection,lCe=nt.mediaFileReader,wa=nt.mergeRegister,Bu=nt.objectKlassEquals,dCe=nt.positionNodeOnRange,cCe=nt.registerNestedElementResolver,uCe=nt.removeClassNamesFromElement,pCe=nt.selectionAlwaysOnDisplay;var rx={};un(rx,{ContentEditable:()=>QW,ContentEditableElement:()=>cA});V();var dA=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function jW({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:a,ariaExpanded:s,ariaInvalid:i,ariaLabel:l,ariaLabelledBy:d,ariaMultiline:u,ariaOwns:p,ariaRequired:f,autoCapitalize:m,className:g,id:h,role:v="textbox",spellCheck:C=!0,style:y,tabIndex:x,"data-testid":w,...I},S){let[k,P]=W(e.isEditable()),T=M(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?e.setRootElement(E):e.setRootElement(null)},[e]),R=K(()=>(function(...E){return D=>{for(let L of E)typeof L=="function"?L(D):L!=null&&(L.current=D)}})(S,T),[T,S]);return dA(()=>(P(e.isEditable()),e.registerEditableListener(E=>{P(E)})),[e]),c("div",{"aria-activedescendant":k?t:void 0,"aria-autocomplete":k?n:"none","aria-controls":k?o:void 0,"aria-describedby":r,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":k&&v==="combobox"?!!s:void 0,...i!=null?{"aria-invalid":i}:{},"aria-label":l,"aria-labelledby":d,"aria-multiline":u,"aria-owns":k?p:void 0,"aria-readonly":!k||void 0,"aria-required":f,autoCapitalize:m,className:g,contentEditable:k,"data-testid":w,id:h,ref:R,role:v,spellCheck:C,style:y,tabIndex:x,...I})}var cA=wn(jW);function lA(e){return e.getEditorState().read(cg(e.isComposing()))}var QW=wn(YW);function YW(e,t){let{placeholder:n,...o}=e,[r]=jt();return b(Ce,{children:[c(cA,{editor:r,...o,ref:t}),n!=null&&c(XW,{editor:r,content:n})]})}function XW({content:e,editor:t}){let n=(function(s){let[i,l]=W(()=>lA(s));return dA(()=>{function d(){let u=lA(s);l(u)}return d(),wa(s.registerUpdateListener(()=>{d()}),s.registerEditableListener(()=>{d()}))},[s]),i})(t),[o,r]=W(t.isEditable());if(fe(()=>(r(t.isEditable()),t.registerEditableListener(s=>{r(s)})),[t]),!n)return null;let a=null;return typeof e=="function"?a=e(o):e!==null&&(a=e),a===null?null:c("div",{"aria-hidden":!0,children:a})}var uA=rx,pA=uA.ContentEditable,CCe=uA.ContentEditableElement;V();var JW=pt(null),ax={didCatch:!1,error:null},hg=class extends oa{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ax}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){let{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(ax))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){let{didCatch:o}=this.state,{resetKeys:r}=this.props;o&&n.error!==null&&ZW(t.resetKeys,r)&&(this.props.onReset?.({next:r,prev:t.resetKeys,reason:"keys"}),this.setState(ax))}render(){let{children:t,fallbackRender:n,FallbackComponent:o,fallback:r}=this.props,{didCatch:a,error:s}=this.state,i=t;if(a){let l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")i=n(l);else if(o)i=Be(o,l);else if(r!==void 0)i=r;else throw s}return Be(JW.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},i)}};function ZW(e=[],t=[]){return e.length!==t.length||e.some((n,o)=>!Object.is(n,t[o]))}var sx={};un(sx,{LexicalErrorBoundary:()=>eG});function eG({children:e,onError:t}){return c(hg,{fallback:c("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}var tG=sx,fA=tG.LexicalErrorBoundary;var bx={};un(bx,{$createHorizontalRuleNode:()=>xx,$isDecoratorTextNode:()=>PA,$isHorizontalRuleNode:()=>NA,AutoFocusExtension:()=>rG,ClearEditorExtension:()=>aG,DecoratorTextExtension:()=>uG,DecoratorTextNode:()=>Uu,EditorStateExtension:()=>xg,HorizontalRuleExtension:()=>SG,HorizontalRuleNode:()=>Ti,INSERT_HORIZONTAL_RULE_COMMAND:()=>xG,InitialStateExtension:()=>MA,LexicalBuilder:()=>sd,NodeSelectionExtension:()=>hx,TabIndentationExtension:()=>IG,applyFormatFromStyle:()=>iG,applyFormatToDom:()=>lG,batch:()=>CA,buildEditorFromExtensions:()=>gG,computed:()=>SA,configExtension:()=>rg,declarePeerDependency:()=>vM,defineExtension:()=>fn,effect:()=>Is,getExtensionDependencyFromEditor:()=>vG,getKnownTypesAndNodes:()=>sG,getPeerDependencyFromEditor:()=>AA,getPeerDependencyFromEditorOrThrow:()=>yG,namedSignals:()=>Sg,registerClearEditor:()=>TA,registerTabIndentation:()=>DA,safeCast:()=>Pr,shallowMergeConfig:()=>lg,signal:()=>ad,untracked:()=>px,watchedSignal:()=>yx});var nG=Symbol.for("preact-signals");function bg(){if(Ss>1)return void Ss--;let e,t=!1;for(;Hu!==void 0;){let n=Hu;for(Hu=void 0,fx++;n!==void 0;){let o=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&xA(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(fx=0,Ss--,t)throw e}function CA(e){if(Ss>0)return e();Ss++;try{return e()}finally{bg()}}var Bt,Hu;function px(e){let t=Bt;Bt=void 0;try{return e()}finally{Bt=t}}var Ss=0,fx=0,Cg=0;function mA(e){if(Bt===void 0)return;let t=e.n;return t===void 0||t.t!==Bt?(t={i:0,S:e,p:Bt.s,n:void 0,t:Bt,e:void 0,x:void 0,r:t},Bt.s!==void 0&&(Bt.s.n=t),Bt.s=t,e.n=t,32&Bt.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Bt.s,t.n=void 0,Bt.s.n=t,Bt.s=t),t):void 0}function ao(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function ad(e,t){return new ao(e,t)}function xA(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function gA(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function bA(e){let t,n=e.s;for(;n!==void 0;){let o=n.p;n.i===-1?(n.S.U(n),o!==void 0&&(o.n=n.n),n.n!==void 0&&(n.n.p=o)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=o}e.s=t}function wi(e,t){ao.call(this,void 0),this.x=e,this.s=void 0,this.g=Cg-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function SA(e,t){return new wi(e,t)}function IA(e){let t=e.u;if(e.u=void 0,typeof t=="function"){Ss++;let n=Bt;Bt=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,vx(e),o}finally{Bt=n,bg()}}}function vx(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,IA(e)}function oG(e){if(Bt!==this)throw new Error("Out-of-order effect");bA(this),Bt=e,this.f&=-2,8&this.f&&vx(this),bg()}function rd(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function Is(e,t){let n=new rd(e,t);try{n.c()}catch(r){throw n.d(),r}let o=n.d.bind(n);return o[Symbol.dispose]=o,o}function Sg(e,t={}){let n={};for(let o in e){let r=t[o],a=ad(r===void 0?e[o]:r);n[o]=a}return n}ao.prototype.brand=nG,ao.prototype.h=function(){return!0},ao.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:px(()=>{var n;(n=this.W)==null||n.call(this)}))},ao.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&px(()=>{var o;(o=this.Z)==null||o.call(this)}))}},ao.prototype.subscribe=function(e){return Is(()=>{let t=this.value,n=Bt;Bt=void 0;try{e(t)}finally{Bt=n}},{name:"sub"})},ao.prototype.valueOf=function(){return this.value},ao.prototype.toString=function(){return this.value+""},ao.prototype.toJSON=function(){return this.value},ao.prototype.peek=function(){let e=Bt;Bt=void 0;try{return this.value}finally{Bt=e}},Object.defineProperty(ao.prototype,"value",{get(){let e=mA(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(fx>100)throw new Error("Cycle detected");this.v=e,this.i++,Cg++,Ss++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{bg()}}}}),wi.prototype=new ao,wi.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cg))return!0;if(this.g=Cg,this.f|=1,this.i>0&&!xA(this))return this.f&=-2,!0;let e=Bt;try{gA(this),Bt=this;let t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Bt=e,bA(this),this.f&=-2,!0},wi.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}ao.prototype.S.call(this,e)},wi.prototype.U=function(e){if(this.t!==void 0&&(ao.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},wi.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(wi.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let e=mA(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),rd.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},rd.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,IA(this),gA(this),Ss++;let e=Bt;return Bt=this,oG.bind(this,e)},rd.prototype.N=function(){2&this.f||(this.f|=2,this.o=Hu,Hu=this)},rd.prototype.d=function(){this.f|=8,1&this.f||vx(this)},rd.prototype.dispose=function(){this.d()};var rG=fn({build:(e,t,n)=>Sg(t),config:Pr({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let o=n.getOutput();return Is(()=>o.disabled.value?void 0:e.registerRootListener(r=>{e.focus(()=>{let a=document.activeElement;r===null||a!==null&&r.contains(a)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function wA(){let e=St(),t=Fe(),n=rr();e.clear(),e.append(n),t!==null&&n.select(),Me(t)&&(t.format=0)}function TA(e,t=wA){return e.registerCommand(Wm,n=>(e.update(t),!0),Yt)}var aG=fn({build:(e,t,n)=>Sg(t),config:Pr({$onClear:wA}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:o}=n.getOutput();return Is(()=>TA(e,o.value))}});function sG(e){let t=new Set,n=new Set;for(let o of kA(e)){let r=typeof o=="function"?o:o.replace;t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function kA(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var ix=hM("format",{parse:e=>typeof e=="number"?e:0}),Uu=class extends So{$config(){return this.config("decorator-text",{extends:So,stateConfigs:[{flat:!0,stateConfig:ix}]})}getFormat(){return Um(this,ix)}getFormatFlags(t,n){return UC(this.getFormat(),t,n)}hasFormat(t){let n=pM[t];return(this.getFormat()&n)!==0}setFormat(t){return Vm(this,ix,t)}toggleFormat(t){let n=this.getFormat(),o=UC(n,t,null);return this.setFormat(o)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}};function PA(e){return e instanceof Uu}function iG(e,t,n){let o=t.fontWeight,r=t.textDecoration.split(" "),a=o==="700"||o==="bold",s=r.includes("line-through"),i=t.fontStyle==="italic",l=r.includes("underline"),d=t.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),s&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),i&&!e.hasFormat("italic")&&e.toggleFormat("italic"),l&&!e.hasFormat("underline")&&e.toggleFormat("underline"),d!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),d!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),n&&!e.hasFormat(n)&&e.toggleFormat(n),e}function lG(e,t,n=cG){for(let[o,r]of Object.entries(n))e.hasFormat(r)&&(t=dG(t,o));return t}function dG(e,t){let n=document.createElement(t);return n.appendChild(e),n}var cG={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},uG=fn({name:"@lexical/extension/DecoratorText",nodes:()=>[Uu],register:(e,t,n)=>e.registerCommand(GE,o=>{let r=Fe();if(AC(r)||Me(r))for(let a of r.getNodes())PA(a)&&a.toggleFormat(o);return!1},nd)});function yx(e,t){let n;return ad(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var xg=fn({build:e=>yx(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"});function Kt(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function RA(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)n[r]=RA(n[r],o[r]);return e}return t}var Cx=0,mx=1,LA=2,lx=3,vg=4,od=5,dx=6,zu=7;function cx(e){return e.id===Cx}function EA(e){return e.id===LA}function pG(e){return(function(t){return t.id===mx})(e)||Kt(305,String(e.id),String(mx)),Object.assign(e,{id:LA})}var fG=new Set,gx=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:Cx}}mergeConfigs(){let t=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):lg;for(let o of this.configs)t=n(t,o);return t}init(t){let n=this.state;EA(n)||Kt(306,String(n.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},a=(function(i,l,d){return Object.assign(i,{config:l,id:lx,registerState:d})})(n,this.mergeConfigs(),o),s;this.state=a,this.extension.init&&(s=this.extension.init(t,a.config,o)),this.state=(function(i,l,d){return Object.assign(i,{id:vg,initResult:l,registerState:d})})(a,s,r)}build(t){let n=this.state,o;n.id!==vg&&Kt(307,String(n.id),String(od)),this.extension.build&&(o=this.extension.build(t,n.config,n.registerState));let r={...n.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(a,s,i){return Object.assign(a,{id:od,output:s,registerState:i})})(n,o,r)}register(t,n){this._signal=n;let o=this.state;o.id!==od&&Kt(308,String(o.id),String(od));let r=this.extension.register&&this.extension.register(t,o.config,o.registerState);return this.state=(function(a){return Object.assign(a,{id:dx})})(o),()=>{let a=this.state;a.id!==zu&&Kt(309,String(o.id),String(zu)),this.state=(function(s){return Object.assign(s,{id:od})})(a),r&&r()}}afterRegistration(t){let n=this.state,o;return n.id!==dx&&Kt(310,String(n.id),String(dx)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(r){return Object.assign(r,{id:zu})})(n),o}getSignal(){return this._signal===void 0&&Kt(311),this._signal}getInitResult(){this.extension.init===void 0&&Kt(312,this.extension.name);let t=this.state;return(function(n){return n.id>=vg})(t)||Kt(313,String(t.id),String(vg)),t.initResult}getInitPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return(function(n){return n.id>=lx})(t)||Kt(314,String(t.id),String(lx)),{config:t.config}}getPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Kt(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Kt(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=zu})(t)||Kt(316,String(t.id),String(zu)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||fG}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(n){return n.id>=od})(t)||Kt(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},hA={tag:Io};function mG(){let e=St();e.isEmpty()&&e.append(rr())}var MA=fn({config:Pr({setOptions:hA,updateOptions:hA}),init:({$initialEditorState:e=mG})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:a}=r;if(IE(a))e.setEditorState(a,n);else if(typeof a=="function")e.update(()=>{a(e)},t);else if(a&&(typeof a=="string"||typeof a=="object")){let s=e.parseEditorState(a);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[lM,og,nM,fM,aM]}),vA=Symbol.for("@lexical/extension/LexicalBuilder");function gG(...e){return sd.fromExtensions(e).buildEditor()}function yA(){}function hG(e){throw e}function yg(e){return Array.isArray(e)?e:[e]}var ux="0.41.0+prod.esm",sd=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ux,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[yg(MA)];for(let o of t)n.push(yg(o));return new e(n)}static maybeFromEditor(t){let n=t[vA];return n&&(n.PACKAGE_VERSION!==ux&&Kt(292,n.PACKAGE_VERSION,ux),n instanceof e||Kt(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Kt(294),n}constructEditor(){let{$initialEditorState:t,onError:n,...o}=this.buildCreateEditorArgs(),r=Object.assign(ag({...o,...n?{onError:a=>{n(a,r)}}:{}}),{[vA]:this});for(let a of this.sortedExtensionReps())a.build(r);return r}buildEditor(){let t=yA;function n(){try{t()}finally{t=yA}}let o=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Vr(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Kt(295,t.name),n}addEdge(t,n,o){let r=this.outgoingConfigEdges.get(t);r?r.set(n,o):this.outgoingConfigEdges.set(t,new Map([[n,o]]));let a=this.incomingEdges.get(n);a?a.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Kt(296);let n=yg(t),[o]=n;typeof o.name!="string"&&Kt(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&Kt(298,o.name),!r){r=new gx(this,o),this.extensionNameMap.set(o.name,r);let a=this.conflicts.get(o.name);typeof a=="string"&&Kt(299,o.name,a);for(let s of o.conflictsWith||[])this.extensionNameMap.has(s)&&Kt(299,o.name,s),this.conflicts.set(s,o.name);for(let s of o.dependencies||[]){let i=yg(s);this.addEdge(o.name,i[0].name,i.slice(1)),this.addExtension(i)}for(let[s,i]of o.peerDependencies||[])this.addEdge(o.name,s,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],n=(o,r)=>{let a=o.state;if(EA(a))return;let s=o.extension.name;var i;cx(a)||Kt(300,s,r||"[unknown]"),cx(i=a)||Kt(304,String(i.id),String(Cx)),a=Object.assign(i,{id:mx}),o.state=a;let l=this.outgoingConfigEdges.get(s);if(l)for(let d of l.keys()){let u=this.extensionNameMap.get(d);u&&n(u,s)}a=pG(a),o.state=a,t.push(o)};for(let o of this.extensionNameMap.values())cx(o.state)&&n(o);for(let o of t)for(let[r,a]of this.outgoingConfigEdges.get(o.extension.name)||[])if(a.length>0){let s=this.extensionNameMap.get(r);if(s)for(let i of a)s.configs.add(i)}for(let[o,...r]of this.roots)if(r.length>0){let a=this.extensionNameMap.get(o.name);a===void 0&&Kt(301,o.name);for(let s of r)a.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let n=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],a=o.signal;for(let s of n){let i=s.register(t,a);i&&r.push(i)}for(let s of n){let i=s.afterRegistration(t);i&&r.push(i)}return Vr(...r)}buildCreateEditorArgs(){let t={},n=new Set,o=new Map,r=new Map,a={},s={},i=this.sortedExtensionReps();for(let u of i){let{extension:p}=u;if(p.onError!==void 0&&(t.onError=p.onError),p.disableEvents!==void 0&&(t.disableEvents=p.disableEvents),p.parentEditor!==void 0&&(t.parentEditor=p.parentEditor),p.editable!==void 0&&(t.editable=p.editable),p.namespace!==void 0&&(t.namespace=p.namespace),p.$initialEditorState!==void 0&&(t.$initialEditorState=p.$initialEditorState),p.nodes)for(let f of kA(p)){if(typeof f!="function"){let m=o.get(f.replace);m&&Kt(302,p.name,f.replace.name,m.extension.name),o.set(f.replace,u)}n.add(f)}if(p.html){if(p.html.export)for(let[f,m]of p.html.export.entries())r.set(f,m);p.html.import&&Object.assign(a,p.html.import)}p.theme&&RA(s,p.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);let l=Object.keys(a).length>0,d=r.size>0;(l||d)&&(t.html={},l&&(t.html.import=a),d&&(t.html.export=r));for(let u of i)u.init(t);return t.onError||(t.onError=hG),t}};function vG(e,t){let n=sd.fromEditor(e).getExtensionRep(t);return n===void 0&&Kt(303,t.name),n.getExtensionDependency()}function AA(e,t){let n=sd.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}function yG(e,t){let n=AA(e,t);return n===void 0&&Kt(291,t),n}var CG=new Set,hx=fn({build(e,t,n){let o=n.getDependency(xg).output,r=ad({watchedNodeKeys:new Map}),a=yx(()=>{},()=>Is(()=>{let s=a.peek(),{watchedNodeKeys:i}=r.value,l,d=!1;o.value.read(()=>{if(Fe())for(let[u,p]of i.entries()){if(p.size===0){i.delete(u);continue}let f=Zl(u),m=f&&f.isSelected()||!1;d=d||m!==(!!s&&s.has(u)),m&&(l=l||new Set,l.add(u))}}),!d&&l&&s&&l.size===s.size||(a.value=l)}));return{watchNodeKey:function(s){let i=SA(()=>(a.value||CG).has(s)),{watchedNodeKeys:l}=r.peek(),d=l.get(s),u=d!==void 0;return d=d||new Set,d.add(i),u||(l.set(s,d),r.value={watchedNodeKeys:l}),i}}},dependencies:[xg],name:"@lexical/extension/NodeSelection"}),xG=gM("INSERT_HORIZONTAL_RULE_COMMAND"),Ti=class e extends So{static getType(){return"horizontalrule"}static clone(t){return new e(t.__key)}static importJSON(t){return xx().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:bG,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){let n=document.createElement("hr");return Ou(n,t.theme.hr),n}getTextContent(){return`
3797
- `}isInline(){return!1}updateDOM(){return!1}};function bG(){return{node:xx()}}function xx(){return fE(Ti)}function NA(e){return e instanceof Ti}var SG=fn({dependencies:[xg,hx],name:"@lexical/extension/HorizontalRule",nodes:()=>[Ti],register(e,t,n){let{watchNodeKey:o}=n.getDependency(hx).output,r=ad({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return Vr(e.registerCommand(FE,s=>{if(SM(s.target)){let i=bE(s.target);if(NA(i))return(function(l,d=!1){let u=Fe(),p=l.isSelected(),f=l.getKey(),m;d&&AC(u)?m=u:(m=mE(),ar(m)),p?m.delete(f):m.add(f)})(i,s.shiftKey),!0}return!1},nd),e.registerMutationListener(Ti,(s,i)=>{CA(()=>{let l=!1,{nodeSelections:d}=r.peek();for(let[u,p]of s.entries())if(p==="destroyed")d.delete(u),l=!0;else{let f=d.get(u),m=e.getElementByKey(u);f?f.domNode.value=m:(l=!0,d.set(u,{domNode:ad(m),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:d})})}),Is(()=>{let s=[];for(let{domNode:i,selectedSignal:l}of r.value.nodeSelections.values())s.push(Is(()=>{let d=i.value;d&&(l.value?Ou(d,a):ig(d,a))}));return Vr(...s)}))}});function _A(e){return e.canBeEmpty()}function DA(e,t,n=_A){return Vr(e.registerCommand(tg,o=>{let r=Fe();if(!Me(r))return!1;o.preventDefault();let a=(function(s){if(s.getNodes().filter(f=>ed(f)&&f.canIndent()).length>0)return!0;let i=s.anchor,l=s.focus,d=l.isBefore(i)?l:i,u=d.getNode(),p=aA(u);if(p.canIndent()){let f=p.getKey(),m=xi();if(m.anchor.set(f,0,"element"),m.focus.set(f,0,"element"),m=LE(m),m.anchor.is(d))return!0}return!1})(r)?o.shiftKey?oM:DC:YE;return e.dispatchCommand(a,void 0)},Yt),e.registerCommand(DC,()=>{let o=typeof t=="number"?t:t?t.peek():null,r=Fe();if(!Me(r))return!1;let a=typeof n=="function"?n:n.peek();return sA(s=>{if(a(s)){let i=s.getIndent()+1;(!o||i<o)&&s.setIndent(i)}})},Gm))}var IG=fn({build:(e,t,n)=>Sg(t),config:Pr({$canIndent:_A,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:o,maxIndent:r,$canIndent:a}=n.getOutput();return Is(()=>{if(!o.value)return DA(e,r,a)})}});var kt=bx,LCe=kt.$createHorizontalRuleNode,ECe=kt.$isDecoratorTextNode,MCe=kt.$isHorizontalRuleNode,ACe=kt.AutoFocusExtension,NCe=kt.ClearEditorExtension,_Ce=kt.DecoratorTextExtension,DCe=kt.DecoratorTextNode,OCe=kt.EditorStateExtension,FCe=kt.HorizontalRuleExtension,BCe=kt.HorizontalRuleNode,zCe=kt.INSERT_HORIZONTAL_RULE_COMMAND,HCe=kt.InitialStateExtension,OA=kt.LexicalBuilder,UCe=kt.NodeSelectionExtension,KCe=kt.TabIndentationExtension,$Ce=kt.applyFormatFromStyle,qCe=kt.applyFormatToDom,FA=kt.batch,VCe=kt.buildEditorFromExtensions,WCe=kt.computed,GCe=kt.configExtension,jCe=kt.declarePeerDependency,QCe=kt.defineExtension,Ku=kt.effect,YCe=kt.getExtensionDependencyFromEditor,XCe=kt.getKnownTypesAndNodes,BA=kt.getPeerDependencyFromEditor,JCe=kt.getPeerDependencyFromEditorOrThrow,Ig=kt.namedSignals,ZCe=kt.registerClearEditor,exe=kt.registerTabIndentation,txe=kt.safeCast,nxe=kt.shallowMergeConfig,oxe=kt.signal,rxe=kt.untracked,axe=kt.watchedSignal;var Sx={};un(Sx,{HistoryExtension:()=>wg,SharedHistoryExtension:()=>kG,createEmptyHistoryState:()=>UA,registerHistory:()=>HA});function wG(e,t,n,o,r){if(e===null||n.size===0&&o.size===0&&!r)return 0;let a=t._selection,s=e._selection;if(r)return 1;if(!(Me(a)&&Me(s)&&s.isCollapsed()&&a.isCollapsed()))return 0;let i=(function(C,y,x){let w=C._nodeMap,I=[];for(let S of y){let k=w.get(S);k!==void 0&&I.push(k)}for(let[S,k]of x){if(!k)continue;let P=w.get(S);P===void 0||Au(P)||I.push(P)}return I})(t,n,o);if(i.length===0)return 0;if(i.length>1){let C=t._nodeMap,y=C.get(a.anchor.key),x=C.get(s.anchor.key);return y&&x&&!e._nodeMap.has(y.__key)&&mt(y)&&y.__text.length===1&&a.anchor.offset===1?2:0}let l=i[0],d=e._nodeMap.get(l.__key);if(!mt(d)||!mt(l)||d.__mode!==l.__mode)return 0;let u=d.__text,p=l.__text;if(u===p)return 0;let f=a.anchor,m=s.anchor;if(f.key!==m.key||f.type!=="text")return 0;let g=f.offset,h=m.offset,v=p.length-u.length;return v===1&&h===g-1?2:v===-1&&h===g+1?3:v===-1&&h===g?4:0}function TG(e,t){let n=Date.now(),o=0,r=Date.now(),a=0,s=null;return(i,l,d,u,p,f)=>{let m=Date.now();if(f.has(zE)&&(r=n,a=o,s=i),f.has(Ym))return o=0,n=m,2;f.has(BE)&&s&&(n=r,o=a,i=s);let g=wG(i,l,u,p,e.isComposing()),h=(()=>{let v=d===null||d.editor===e,C=f.has(jE);if(!C&&v&&f.has(Io))return 0;if(g===1)return 2;if(i===null)return 1;let y=l._selection;if(!(u.size>0||p.size>0))return y!==null?0:2;let x=typeof t=="number"?t:t.peek();return C===!1&&g!==0&&g===o&&m<n+x&&v||u.size===1&&(function(w,I,S){let k=I._nodeMap.get(w),P=S._nodeMap.get(w),T=I._selection,R=S._selection;return!(Me(T)&&Me(R)&&T.anchor.type==="element"&&T.focus.type==="element"&&R.anchor.type==="text"&&R.focus.type==="text"||!mt(k)||!mt(P)||k.__parent!==P.__parent)&&JSON.stringify(I.read(()=>k.exportJSON()))===JSON.stringify(S.read(()=>P.exportJSON()))})(Array.from(u)[0],i,l)?0:1})();return n=m,o=g,h}}function zA(e){e.undoStack=[],e.redoStack=[],e.current=null}function HA(e,t,n){let o=TG(e,n);return wa(e.registerCommand(mM,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(l.length!==0){let d=s.current,u=l.pop();d!==null&&(i.push(d),a.dispatchCommand(Nu,!0)),l.length===0&&a.dispatchCommand(_u,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Ym})}})(e,t),!0),Yt),e.registerCommand(sM,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(i.length!==0){let d=s.current;d!==null&&(l.push(d),a.dispatchCommand(_u,!0));let u=i.pop();i.length===0&&a.dispatchCommand(Nu,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Ym})}})(e,t),!0),Yt),e.registerCommand(Wm,()=>(zA(t),!1),Yt),e.registerCommand(OE,()=>(zA(t),e.dispatchCommand(Nu,!1),e.dispatchCommand(_u,!1),!0),Yt),e.registerUpdateListener(({editorState:a,prevEditorState:s,dirtyLeaves:i,dirtyElements:l,tags:d})=>{let u=t.current,p=t.redoStack,f=t.undoStack,m=u===null?null:u.editorState;if(u!==null&&a===m)return;let g=o(s,a,u,i,l,d);if(g===1)p.length!==0&&(t.redoStack=[],e.dispatchCommand(Nu,!1)),u!==null&&(f.push({...u}),e.dispatchCommand(_u,!0));else if(g===2)return;t.current={editor:e,editorState:a}}))}function UA(){return{current:null,redoStack:[],undoStack:[]}}var wg=fn({build:(e,{delay:t,createInitialHistoryState:n,disabled:o})=>Ig({delay:t,disabled:o,historyState:n(e)}),config:Pr({createInitialHistoryState:UA,delay:300,disabled:typeof window>"u"}),name:"@lexical/history/History",register:(e,t,n)=>{let o=n.getOutput();return Ku(()=>o.disabled.value?void 0:HA(e,o.historyState.value,o.delay))}}),kG=fn({dependencies:[rg(wg,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(e,t,n){let{output:o}=n.getDependency(wg),r=(function(s){return s?BA(s,wg.name):null})(e._parentEditor);if(!r)return()=>{};let a=r.output;return Ku(()=>FA(()=>{o.delay.value=a.delay.value,o.historyState.value=a.historyState.value,o.disabled.value=a.disabled.value}))}});var Tg=Sx,cxe=Tg.HistoryExtension,uxe=Tg.SharedHistoryExtension,kg=Tg.createEmptyHistoryState,KA=Tg.registerHistory;var Ix={};un(Ix,{HistoryPlugin:()=>PG,createEmptyHistoryState:()=>kg});V();function PG({delay:e,externalHistoryState:t}){let[n]=jt();return(function(o,r,a=1e3){let s=K(()=>r||kg(),[r]);$(()=>KA(o,s,a),[a,o,s])})(n,t,e),null}var $A=Ix,qA=$A.HistoryPlugin,VA=$A.createEmptyHistoryState;var wx={};un(wx,{OnChangePlugin:()=>LG});V();var RG=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function LG({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[o]=jt();return RG(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:a,dirtyLeaves:s,prevEditorState:i,tags:l})=>{t&&a.size===0&&s.size===0||e&&l.has(Io)||i.isEmpty()||n(r,o,l)})},[o,e,t,n]),null}var EG=wx,WA=EG.OnChangePlugin;var Tx={};un(Tx,{useLexicalEditable:()=>NG});V();var MG=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function AG(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function NG(){return(function(e){let[t]=jt(),n=K(()=>e(t),[t,e]),[o,r]=W(()=>n.initialValueFn()),a=A(o);return MG(()=>{let{initialValueFn:s,subscribe:i}=n,l=s();return a.current!==l&&(a.current=l,r(l)),i(d=>{a.current=d,r(d)})},[n,e]),o})(AG)}var _G=Tx,GA=_G.useLexicalEditable;var kx={};un(kx,{ReactProviderExtension:()=>DG});var DG=fn({name:"@lexical/react/ReactProvider"});var OG=kx,jA=OG.ReactProviderExtension;var Px={};un(Px,{DragonExtension:()=>FG,registerDragonSupport:()=>QA});function QA(e){let t=window.location.origin,n=o=>{if(o.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let a=o.data;if(typeof a=="string"){let s;try{s=JSON.parse(a)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let l=i.args;if(l){let[d,u,p,f,m]=l;e.update(()=>{let g=Fe();if(Me(g)){let h=g.anchor,v=h.getNode(),C=0,y=0;if(mt(v)&&d>=0&&u>=0&&(C=d,y=d+u,g.setTextNodeRange(v,C,v,y)),C===y&&p===""||(g.insertRawText(p),v=h.getNode()),mt(v)){C=f,y=f+m;let x=v.getTextContentSize();C=C>x?x:C,y=y>x?x:y,g.setTextNodeRange(v,C,v,y)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}var FG=fn({build:(e,t,n)=>Ig(t),config:Pr({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,t,n)=>Ku(()=>n.getOutput().disabled.value?void 0:QA(e))});var YA=Px,XA=YA.DragonExtension,JA=YA.registerDragonSupport;var Rx={};un(Rx,{$generateHtmlFromNodes:()=>zG,$generateNodesFromDOM:()=>BG});function BG(e,t){let n=bM(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let a of n)if(!eN.has(a.nodeName)){let s=tN(a,e,r,!1);s!==null&&(o=o.concat(s))}return(function(a){for(let s of a)s.getNextSibling()instanceof _C&&s.insertAfter(Ci());for(let s of a){let i=s.getChildren();for(let l of i)s.insertBefore(l);s.remove()}})(r),o}function zG(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),o=St().getChildren();for(let r=0;r<o.length;r++)ZA(e,o[r],n,t);return n.innerHTML}function ZA(e,t,n,o=null){let r=o===null||t.isSelected(o),a=Ze(t)&&t.excludeFromCopy("html"),s=t;o!==null&&mt(t)&&(s=mg(o,t,"clone"));let i=Ze(s)?s.getChildren():[],l=CM(e,s.getType()),d;d=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);let{element:u,after:p}=d;if(!u)return!1;let f=document.createDocumentFragment();for(let m=0;m<i.length;m++){let g=i[m],h=ZA(e,g,f,o);!r&&Ze(t)&&h&&t.extractWithChild(g,o,"html")&&(r=!0)}if(r&&!a){if((iA(u)||zC(u))&&u.append(f),n.append(u),p){let m=p.call(s,u);m&&(zC(u)?u.replaceChildren(m):u.replaceWith(m))}}else n.append(f);return r}var eN=new Set(["STYLE","SCRIPT"]);function tN(e,t,n,o,r=new Map,a){let s=[];if(eN.has(e.nodeName))return s;let i=null,l=(function(g,h){let{nodeName:v}=g,C=h._htmlConversions.get(v.toLowerCase()),y=null;if(C!==void 0)for(let x of C){let w=x(g);w!==null&&(y===null||(y.priority||0)<=(w.priority||0))&&(y=w)}return y!==null?y.conversion:null})(e,t),d=l?l(e):null,u=null;if(d!==null){u=d.after;let g=d.node;if(i=Array.isArray(g)?g[g.length-1]:g,i!==null){for(let[,h]of r)if(i=h(i,a),!i)break;i&&s.push(...Array.isArray(g)?g:[i])}d.forChild!=null&&r.set(e.nodeName,d.forChild)}let p=e.childNodes,f=[],m=(i==null||!Si(i))&&(i!=null&&ed(i)||o);for(let g=0;g<p.length;g++)f.push(...tN(p[g],t,n,m,new Map(r),i));return u!=null&&(f=u(f)),ox(e)&&(f=HG(e,f,m?()=>{let g=new _C;return n.push(g),g}:rr)),i==null?f.length>0?s=s.concat(f):ox(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Fu(g.nextSibling)&&Fu(g.previousSibling)})(e)&&(s=s.concat(Ci())):Ze(i)&&i.append(...f),s}function HG(e,t,n){let o=e.style.textAlign,r=[],a=[];for(let s=0;s<t.length;s++){let i=t[s];if(ed(i))o&&!i.getFormat()&&i.setFormat(o),r.push(i);else if(a.push(i),s===t.length-1||s<t.length-1&&ed(t[s+1])){let l=n();l.setFormat(o),l.append(...a),r.push(l),a=[]}}return r}var nN=Rx,oN=nN.$generateHtmlFromNodes,rN=nN.$generateNodesFromDOM;var Ex={};un(Ex,{$generateJSONFromSelectedNodes:()=>dN,$generateNodesFromSerializedNodes:()=>cN,$getClipboardDataFromSelection:()=>pN,$getHtmlContent:()=>sN,$getLexicalContent:()=>iN,$insertDataTransferForPlainText:()=>UG,$insertDataTransferForRichText:()=>KG,$insertGeneratedNodes:()=>Lx,copyToClipboard:()=>$G,setLexicalClipboardDataTransfer:()=>fN});function Pg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function sN(e,t=Fe()){return t==null&&Pg(166),Me(t)&&t.isCollapsed()||t.getNodes().length===0?"":oN(e,t)}function iN(e,t=Fe()){return t==null&&Pg(166),Me(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(dN(e,t))}function UG(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function KG(e,t,n){let o=e.getData("application/x-lexical-editor");if(o)try{let i=JSON.parse(o);if(i.namespace===n._config.namespace&&Array.isArray(i.nodes))return Lx(n,cN(i.nodes),t)}catch(i){console.error(i)}let r=e.getData("text/html"),a=e.getData("text/plain");if(r&&a!==r)try{let i=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:d=>d}).createHTML(l):l})(r),"text/html");return Lx(n,rN(n,i),t)}catch(i){console.error(i)}let s=a||e.getData("text/uri-list");if(s!=null)if(Me(t)){let i=s.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){let d=Fe();if(Me(d)){let u=i[l];u===`
3796
+ `);let l=i.length;if(!mt(o)||r>=l){let d=o.getParent();o.remove(),d==null||d.getChildrenSize()!==0||Au(d)||d.remove(),r-=l+s,o=a}else{let d=o.getKey(),u=e.getEditorState().read(()=>{let m=Zl(d);return mt(m)&&m.isSimpleText()?m.getTextContent():null}),p=l-r,f=i.slice(0,p);if(u!==null&&u!==i){let m=Eu(),g=o;if(o.isSimpleText())o.setTextContent(u);else{let h=kr(u);o.replace(h),g=h}if(Me(m)&&m.isCollapsed()){let h=m.anchor.offset;g.select(h,h)}}else if(o.isSimpleText()){let m=t.key===d,g=t.offset;g<r&&(g=l);let h=m?g-r:0,v=m?g:p;if(m&&h===0){let[C]=o.splitText(h,v);C.remove()}else{let[,C]=o.splitText(h,v);C.remove()}}else{let m=kr(f);o.replace(m)}r=0}}}function J4(e){let t=e.getStyle(),n=AM(t);pg.set(t,n)}function ug(e,t){(Me(e)?e.isCollapsed():mt(e)||Ze(e))||WC(280);let n=fg(Me(e)?e.style:mt(e)?e.getStyle():e.getTextStyle()),o=Object.entries(t).reduce((a,[s,i])=>(typeof i=="function"?a[s]=i(n[s],e):i===null?delete a[s]:a[s]=i,a),{...n}),r=NM(o);Me(e)||mt(e)?e.setStyle(r):e.setTextStyle(r),pg.set(r,o)}function Z4(e,t){if(Me(e)&&e.isCollapsed()){ug(e,t);let o=e.anchor.getNode();Ze(o)&&o.isEmpty()&&ug(o,t)}DM(o=>{ug(o,t)});let n=e.getNodes();if(n.length>0){let o=new Set;for(let r of n){if(!Ze(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let a=r.getKey();o.has(a)||(o.add(a),ug(r,t))}}}function DM(e){let t=Fe();if(!t)return;let n=new Map,o=a=>n.get(a.getKey())||[0,a.getTextContentSize()];if(Me(t))for(let a of uE(t).getTextSlices())a&&n.set(a.caret.origin.getKey(),a.getSliceIndices());let r=t.getNodes();for(let a of r){if(!mt(a)||!a.canHaveFormat())continue;let[s,i]=o(a);i!==s&&(NC(a)||s===0&&i===a.getTextContentSize()?e(a):e(a.splitText(s,i)[s===0?0:1]))}Me(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&OM(t)}function OM(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:a}=t;t.set(n.key,n.offset,n.type),n.set(o,r,a)}}function FM(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function eW(e,t,n=FM){if(e===null)return;let o=e.getStartEndPoints(),r=new Map,a=null;if(o){let[s,i]=o;a=xi(),a.anchor.set(s.key,s.offset,s.type),a.focus.set(i.key,i.offset,i.type);let l=Sa(s.getNode(),Du),d=Sa(i.getNode(),Du);Ze(l)&&r.set(l.getKey(),l),Ze(d)&&r.set(d.getKey(),d)}for(let s of e.getNodes())if(Ze(s)&&Du(s))r.set(s.getKey(),s);else if(o===null){let i=Sa(s,Du);Ze(i)&&r.set(i.getKey(),i)}for(let[s,i]of r){let l=t();n(i,l),i.replace(l,!0),a&&(s===a.anchor.key&&a.anchor.set(l.getKey(),a.anchor.offset,a.anchor.type),s===a.focus.key&&a.focus.set(l.getKey(),a.focus.offset,a.focus.type))}a&&e.is(Fe())&&ar(a)}function MM(e){return e.getNode().isAttached()}function tW(e){let t=e;for(;t!==null&&!Si(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function nW(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,a=e.getNodes(),s=a.length;if(r!==null&&(s===0||s===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let d=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=d.getChildren(),p=t();return p.setFormat(d.getFormatType()),p.setIndent(d.getIndent()),u.forEach(f=>p.append(f)),n&&(p=n.append(p)),void d.replace(p)}let i=null,l=[];for(let d=0;d<s;d++){let u=a[d];Si(u)?(VC(e,l,l.length,t,n),l=[],i=u):i===null||i!==null&&SE(u,i)?l.push(u):(VC(e,l,l.length,t,n),l=[u])}VC(e,l,l.length,t,n)}function VC(e,t,n,o,r=null){if(t.length===0)return;let a=t[0],s=new Map,i=[],l=Ze(a)?a:a.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let d=!1;for(;l!==null;){let g=l.getPreviousSibling();if(g!==null){l=g,d=!0;break}if(l=l.getParentOrThrow(),Si(l))break}let u=new Set;for(let g=0;g<n;g++){let h=t[g];Ze(h)&&h.getChildrenSize()===0&&u.add(h.getKey())}let p=new Set;for(let g=0;g<n;g++){let h=t[g],v=h.getParent();if(v!==null&&v.isInline()&&(v=v.getParent()),v!==null&&TE(h)&&!p.has(h.getKey())){let C=v.getKey();if(s.get(C)===void 0){let y=o();y.setFormat(v.getFormatType()),y.setIndent(v.getIndent()),i.push(y),s.set(C,y),v.getChildren().forEach(x=>{y.append(x),p.add(x.getKey()),Ze(x)&&x.getChildrenKeys().forEach(w=>p.add(w))}),tW(v)}}else if(u.has(h.getKey())){Ze(h)||WC(179);let C=o();C.setFormat(h.getFormatType()),C.setIndent(h.getIndent()),i.push(C),h.remove(!0)}}if(r!==null)for(let g=0;g<i.length;g++){let h=i[g];r.append(h)}let f=null;if(Si(l))if(d)if(r!==null)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h)}else{let g=l.getFirstChild();if(Ze(g)&&(l=g),g===null)if(r)l.append(r);else for(let h=0;h<i.length;h++){let v=i[h];l.append(v),f=v}else if(r!==null)g.insertBefore(r);else for(let h=0;h<i.length;h++){let v=i[h];g.insertBefore(v),f=v}}else if(r)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h),f=h}let m=Eu();Me(m)&&MM(m.anchor)&&MM(m.focus)?ar(m.clone()):f!==null?f.selectEnd():e.dirty=!0}function BM(e){let t=zM(e);return t!==null&&t.writingMode==="vertical-rl"}function zM(e){let t=e.anchor.getNode();return Ze(t)?GC(t):jC(t)}function oW(e,t){let n=BM(e)?!t:t;QC(e)&&(n=!n);let o=Jl(e.focus,n?"previous":"next");if(wE(o))return!1;for(let r of vE(o)){if(Mu(r))return!r.origin.isInline();if(!Ze(r.origin)){if(Km(r.origin))return!0;break}}return!1}function HM(e,t,n,o){e.modify(t?"extend":"move",n,o)}function QC(e){let t=zM(e);return t!==null&&t.direction==="rtl"}function rW(e,t,n){let o=QC(e),r;r=BM(e)||o?!n:n,HM(e,t,r,"character")}function aW(e,t,n){let o=fg(e.getStyle());return o!==null&&o[t]||n}function sW(e,t,n=""){let o=null,r=e.getNodes(),a=e.anchor,s=e.focus,i=e.isBackward(),l=i?s.offset:a.offset,d=i?s.getNode():a.getNode();if(Me(e)&&e.isCollapsed()&&e.style!==""){let u=fg(e.style);if(u!==null&&t in u)return u[t]}for(let u=0;u<r.length;u++){let p=r[u];if((u===0||l!==0||!p.is(d))&&mt(p)){let f=aW(p,t,n);if(o===null)o=f;else if(o!==f){o="";break}}}return o===null?n:o}var iW=_M;var tn=YC,UM=tn.$addNodeStyle,Zve=tn.$cloneWithProperties,eye=tn.$copyBlockFormatIndent,tye=tn.$ensureForwardRangeSelection,nye=tn.$forEachSelectedTextNode,oye=tn.$getComputedStyleForElement,rye=tn.$getComputedStyleForParent,aye=tn.$getSelectionStyleValueForProperty,sye=tn.$isAtNodeEnd,iye=tn.$isParentElementRTL,lye=tn.$isParentRTL,dye=tn.$moveCaretSelection,XC=tn.$moveCharacter,cye=tn.$patchStyleText,uye=tn.$selectAll,pye=tn.$setBlocksType,JC=tn.$shouldOverrideDefaultCharacterSelection,mg=tn.$sliceSelectedTextNodeContent,fye=tn.$trimTextContentFromAnchor,mye=tn.$wrapNodes,gye=tn.createDOMRange,KM=tn.createRectsFromDOMRange,hye=tn.getCSSFromStyleObject,vye=tn.getStyleObjectFromCSS,yye=tn.trimTextContentFromAnchor;var nx={};un(nx,{$descendantsMatching:()=>qW,$dfs:()=>kW,$dfsIterator:()=>JM,$filter:()=>BW,$findMatchingParent:()=>Sa,$firstToLastIterator:()=>VW,$getAdjacentCaret:()=>PW,$getAdjacentSiblingOrParentSiblingCaret:()=>bi,$getDepth:()=>eA,$getNearestBlockElementAncestorOrThrow:()=>AW,$getNearestNodeOfType:()=>MW,$getNextRightPreorderNode:()=>EW,$getNextSiblingOrParentSibling:()=>LW,$handleIndentAndOutdent:()=>zW,$insertFirst:()=>HW,$insertNodeToNearestRoot:()=>DW,$insertNodeToNearestRootAtCaret:()=>nA,$isEditorIsNestedEditor:()=>KW,$lastToFirstIterator:()=>tx,$restoreEditorState:()=>_W,$reverseDfs:()=>RW,$reverseDfsIterator:()=>tA,$splitNode:()=>_E,$unwrapAndFilterDescendants:()=>$W,$unwrapNode:()=>WW,$wrapNodeInElement:()=>OW,CAN_USE_BEFORE_INPUT:()=>vW,CAN_USE_DOM:()=>QM,IS_ANDROID:()=>yW,IS_ANDROID_CHROME:()=>CW,IS_APPLE:()=>xW,IS_APPLE_WEBKIT:()=>bW,IS_CHROME:()=>SW,IS_FIREFOX:()=>YM,IS_IOS:()=>IW,IS_SAFARI:()=>wW,addClassNamesToElement:()=>Ou,calculateZoomLevel:()=>UW,isBlockDomNode:()=>xM,isHTMLAnchorElement:()=>IM,isHTMLElement:()=>sg,isInlineDomNode:()=>Fu,isMimeType:()=>XM,makeStateWrapper:()=>GW,markSelection:()=>jM,mediaFileReader:()=>TW,mergeRegister:()=>Vr,objectKlassEquals:()=>FW,positionNodeOnRange:()=>GM,registerNestedElementResolver:()=>NW,removeClassNamesFromElement:()=>ig,selectionAlwaysOnDisplay:()=>hW});function gg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Rr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,lW=Rr&&"documentMode"in document?document.documentMode:null,VM=Rr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),dW=Rr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),cW=!(!Rr||!("InputEvent"in window)||lW)&&"getTargetRanges"in new window.InputEvent("input"),uW=Rr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pW=Rr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,WM=Rr&&/Android/.test(navigator.userAgent),ex=Rr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),fW=Rr&&WM&&ex,mW=Rr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&VM&&!ex;function Wr(e){return`${e}px`}var gW={attributes:!0,characterData:!0,childList:!0,subtree:!0};function GM(e,t,n){let o=null,r=null,a=null,s=[],i=document.createElement("div");function l(){o===null&&gg(182),r===null&&gg(183);let{left:p,top:f}=r.getBoundingClientRect(),m=KM(e,t);var g,h;i.isConnected||(h=i,(g=r).insertBefore(h,g.firstChild));let v=!1;for(let C=0;C<m.length;C++){let y=m[C],x=s[C]||document.createElement("div"),w=x.style;w.position!=="absolute"&&(w.position="absolute",v=!0);let I=Wr(y.left-p);w.left!==I&&(w.left=I,v=!0);let S=Wr(y.top-f);w.top!==S&&(x.style.top=S,v=!0);let k=Wr(y.width);w.width!==k&&(x.style.width=k,v=!0);let P=Wr(y.height);w.height!==P&&(x.style.height=P,v=!0),x.parentNode!==i&&(i.append(x),v=!0),s[C]=x}for(;s.length>m.length;)s.pop();v&&n(s)}function d(){r=null,o=null,a!==null&&a.disconnect(),a=null,i.remove();for(let p of s)p.remove();s=[]}i.style.position="relative";let u=e.registerRootListener(function p(){let f=e.getRootElement();if(f===null)return d();let m=f.parentElement;if(!sg(m))return d();d(),o=f,r=m,a=new MutationObserver(g=>{let h=e.getRootElement(),v=h&&h.parentElement;if(h!==o||v!==r)return p();for(let C of g)if(!i.contains(C.target))return l()}),a.observe(m,gW),l()});return()=>{u(),d()}}function $M(e,t,n){if(e.type!=="text"&&Ze(t)){let o=t.getDOMSlot(n);return[o.element,o.getFirstChildOffset()+e.offset]}return[yM(n)||n,e.offset]}function jM(e,t){let n=null,o=null,r=null,a=null,s=null,i=null,l=()=>{};function d(u){u.read(()=>{let p=Fe();if(!Me(p))return n=null,r=null,a=null,i=null,l(),void(l=()=>{});let[f,m]=(function(P){let T=P.getStartEndPoints();return P.isBackward()?[T[1],T[0]]:T})(p),g=f.getNode(),h=g.getKey(),v=f.offset,C=m.getNode(),y=C.getKey(),x=m.offset,w=e.getElementByKey(h),I=e.getElementByKey(y),S=n===null||w!==o||v!==r||h!==n.getKey(),k=a===null||I!==s||x!==i||y!==a.getKey();if((S||k)&&w!==null&&I!==null){let P=(function(T,R,E,D,L,O,U){let F=(T._window?T._window.document:document).createRange();return F.setStart(...$M(R,E,D)),F.setEnd(...$M(L,O,U)),F})(e,f,g,w,m,C,I);l(),l=GM(e,P,T=>{if(t===void 0)for(let R of T){let E=R.style;E.background!=="Highlight"&&(E.background="Highlight"),E.color!=="HighlightText"&&(E.color="HighlightText"),E.marginTop!==Wr(-1.5)&&(E.marginTop=Wr(-1.5)),E.paddingTop!==Wr(4)&&(E.paddingTop=Wr(4)),E.paddingBottom!==Wr(0)&&(E.paddingBottom=Wr(0))}else t(T)})}n=g,o=w,r=v,a=C,s=I,i=x})}return d(e.getEditorState()),Vr(e.registerUpdateListener(({editorState:u})=>d(u)),()=>{l()})}function hW(e,t){let n=null,o=()=>{let r=getSelection(),a=r&&r.anchorNode,s=e.getRootElement();a!==null&&s!==null&&s.contains(a)?n!==null&&(n(),n=null):n===null&&(n=jM(e,t))};return document.addEventListener("selectionchange",o),()=>{n!==null&&n(),document.removeEventListener("selectionchange",o)}}var vW=cW,QM=Rr,yW=WM,CW=fW,xW=VM,bW=mW,SW=ex,YM=dW,IW=pW,wW=uW;function XM(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function TW(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let a=[],s=()=>{let{done:i,value:l}=n.next();if(i)return o(a);let d=new FileReader;d.addEventListener("error",r),d.addEventListener("load",()=>{let u=d.result;typeof u=="string"&&a.push({file:l,result:u}),s()}),XM(l,t)?d.readAsDataURL(l):s()};s()})}function kW(e,t){return Array.from(JM(e,t))}function PW(e){return e?e.getAdjacentCaret():null}function RW(e,t){return Array.from(tA(e,t))}function JM(e,t){return ZM("next",e,t)}function qM(e,t){let n=bi(Ia(e,t));return n&&n[0]}function ZM(e,t,n){let o=St(),r=t||o,a=Ze(r)?bs(r,e):Ia(r,e),s=eA(r),i=n?LC(MC(Ia(n,e)))||qM(n,e):qM(r,e),l=s;return HC({hasNext:d=>d!==null,initial:a,map:d=>({depth:l,node:d.origin}),step:d=>{if(d.isSameNodeCaret(i))return null;Mu(d)&&l++;let u=bi(d);return!u||u[0].isSameNodeCaret(i)?null:(l+=u[1],u[0])}})}function LW(e){let t=bi(Ia(e,"next"));return t&&[t[0].origin,t[1]]}function eA(e){let t=-1;for(let n=e;n!==null;n=n.getParent())t++;return t}function EW(e){let t=MC(Ia(e,"previous")),n=bi(t,"root");return n&&n[0].origin}function tA(e,t){return ZM("previous",e,t)}function MW(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function AW(e){let t=Sa(e,n=>Ze(n)&&!n.isInline());return Ze(t)||gg(4,e.__key),t}function NW(e,t,n,o){let r=a=>a instanceof t;return e.registerNodeTransform(t,a=>{let s=(i=>{let l=i.getChildren();for(let p=0;p<l.length;p++){let f=l[p];if(r(f))return null}let d=i,u=i;for(;d!==null;)if(u=d,d=d.getParent(),r(d))return{child:u,parent:d};return null})(a);if(s!==null){let{child:i,parent:l}=s;if(i.is(a)){o(l,a);let d=i.getNextSiblings(),u=d.length;if(l.insertAfter(i),u!==0){let p=n(l);i.insertAfter(p);for(let f=0;f<u;f++)p.append(d[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function _W(e,t){let n=new Map,o=e._pendingEditorState;for(let[a,s]of t._nodeMap)n.set(a,zm(s));o&&(o._nodeMap=n),e._dirtyType=2;let r=t._selection;ar(r===null?null:r.clone())}function DW(e){let t=Fe()||Eu(),n;if(Me(t))n=Jl(t.focus,"next");else{if(t!=null){let s=t.getNodes(),i=s[s.length-1];i&&(n=Ia(i,"next"))}n=n||bs(St(),"previous").getFlipped().insert(rr())}let o=nA(e,n),r=LC(o),a=Mu(r)?RE(r):o;return AE(xE(a)),e.getLatest()}function nA(e,t,n){let o=EC(t,"next");for(let r=o;r;r=NE(r,n))o=r;return $m(o)&&gg(283),o.insert(e.isInline()?rr().append(e):e),EC(Ia(e.getLatest(),"next"),t.direction)}function OW(e,t){let n=t();return e.replace(n),n.append(e),n}function FW(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function BW(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function zW(e){let t=Fe();if(!Me(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let a=o[r],s=a.getKey();if(n.has(s))continue;let i=Sa(a,d=>Ze(d)&&!d.isInline());if(i===null)continue;let l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function HW(e,t){bs(e,"next").insert(t)}var ZC=!(YM||!QM)&&void 0;function UW(e,t=!1){let n=1;if((function(){if(ZC===void 0){let o=document.createElement("div");o.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),ZC=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return ZC})()||t)for(;e;)n*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return n}function KW(e){return e._parentEditor!==null}function $W(e,t){return oA(e,t,null)}function oA(e,t,n){let o=!1;for(let r of tx(e))t(r)?n!==null&&n(r):(o=!0,Ze(r)&&oA(r,t,n||(a=>r.insertAfter(a))),r.remove());return o}function qW(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(Ze(r))for(let a of tx(r))o.push(a);return n}function VW(e){return rA(bs(e,"next"))}function tx(e){return rA(bs(e,"previous"))}function rA(e){return HC({hasNext:PE,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function WW(e){ME(Ia(e,"next")).splice(1,e.getChildren())}function GW(e){let t=o=>Um(o,e),n=(o,r)=>Vm(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}var nt=nx,Iye=nt.$descendantsMatching,wye=nt.$dfs,Tye=nt.$dfsIterator,kye=nt.$filter,Pye=nt.$findMatchingParent,Rye=nt.$firstToLastIterator,Lye=nt.$getAdjacentCaret,Eye=nt.$getAdjacentSiblingOrParentSiblingCaret,Mye=nt.$getDepth,aA=nt.$getNearestBlockElementAncestorOrThrow,Aye=nt.$getNearestNodeOfType,Nye=nt.$getNextRightPreorderNode,_ye=nt.$getNextSiblingOrParentSibling,sA=nt.$handleIndentAndOutdent,Dye=nt.$insertFirst,Oye=nt.$insertNodeToNearestRoot,Fye=nt.$insertNodeToNearestRootAtCaret,Bye=nt.$isEditorIsNestedEditor,zye=nt.$lastToFirstIterator,Hye=nt.$restoreEditorState,Uye=nt.$reverseDfs,Kye=nt.$reverseDfsIterator,$ye=nt.$splitNode,qye=nt.$unwrapAndFilterDescendants,Vye=nt.$unwrapNode,Wye=nt.$wrapNodeInElement,Gye=nt.CAN_USE_BEFORE_INPUT,jye=nt.CAN_USE_DOM,Qye=nt.IS_ANDROID,Yye=nt.IS_ANDROID_CHROME,Xye=nt.IS_APPLE,Jye=nt.IS_APPLE_WEBKIT,Zye=nt.IS_CHROME,eCe=nt.IS_FIREFOX,tCe=nt.IS_IOS,nCe=nt.IS_SAFARI,oCe=nt.addClassNamesToElement,rCe=nt.calculateZoomLevel,ox=nt.isBlockDomNode,aCe=nt.isHTMLAnchorElement,iA=nt.isHTMLElement,sCe=nt.isInlineDomNode,iCe=nt.isMimeType,lCe=nt.makeStateWrapper,dCe=nt.markSelection,cCe=nt.mediaFileReader,wa=nt.mergeRegister,Bu=nt.objectKlassEquals,uCe=nt.positionNodeOnRange,pCe=nt.registerNestedElementResolver,fCe=nt.removeClassNamesFromElement,mCe=nt.selectionAlwaysOnDisplay;var rx={};un(rx,{ContentEditable:()=>QW,ContentEditableElement:()=>cA});V();var dA=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function jW({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:a,ariaExpanded:s,ariaInvalid:i,ariaLabel:l,ariaLabelledBy:d,ariaMultiline:u,ariaOwns:p,ariaRequired:f,autoCapitalize:m,className:g,id:h,role:v="textbox",spellCheck:C=!0,style:y,tabIndex:x,"data-testid":w,...I},S){let[k,P]=W(e.isEditable()),T=M(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?e.setRootElement(E):e.setRootElement(null)},[e]),R=K(()=>(function(...E){return D=>{for(let L of E)typeof L=="function"?L(D):L!=null&&(L.current=D)}})(S,T),[T,S]);return dA(()=>(P(e.isEditable()),e.registerEditableListener(E=>{P(E)})),[e]),c("div",{"aria-activedescendant":k?t:void 0,"aria-autocomplete":k?n:"none","aria-controls":k?o:void 0,"aria-describedby":r,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":k&&v==="combobox"?!!s:void 0,...i!=null?{"aria-invalid":i}:{},"aria-label":l,"aria-labelledby":d,"aria-multiline":u,"aria-owns":k?p:void 0,"aria-readonly":!k||void 0,"aria-required":f,autoCapitalize:m,className:g,contentEditable:k,"data-testid":w,id:h,ref:R,role:v,spellCheck:C,style:y,tabIndex:x,...I})}var cA=wn(jW);function lA(e){return e.getEditorState().read(cg(e.isComposing()))}var QW=wn(YW);function YW(e,t){let{placeholder:n,...o}=e,[r]=jt();return b(Ce,{children:[c(cA,{editor:r,...o,ref:t}),n!=null&&c(XW,{editor:r,content:n})]})}function XW({content:e,editor:t}){let n=(function(s){let[i,l]=W(()=>lA(s));return dA(()=>{function d(){let u=lA(s);l(u)}return d(),wa(s.registerUpdateListener(()=>{d()}),s.registerEditableListener(()=>{d()}))},[s]),i})(t),[o,r]=W(t.isEditable());if(fe(()=>(r(t.isEditable()),t.registerEditableListener(s=>{r(s)})),[t]),!n)return null;let a=null;return typeof e=="function"?a=e(o):e!==null&&(a=e),a===null?null:c("div",{"aria-hidden":!0,children:a})}var uA=rx,pA=uA.ContentEditable,bCe=uA.ContentEditableElement;V();var JW=pt(null),ax={didCatch:!1,error:null},hg=class extends oa{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ax}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){let{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(ax))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){let{didCatch:o}=this.state,{resetKeys:r}=this.props;o&&n.error!==null&&ZW(t.resetKeys,r)&&(this.props.onReset?.({next:r,prev:t.resetKeys,reason:"keys"}),this.setState(ax))}render(){let{children:t,fallbackRender:n,FallbackComponent:o,fallback:r}=this.props,{didCatch:a,error:s}=this.state,i=t;if(a){let l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")i=n(l);else if(o)i=Be(o,l);else if(r!==void 0)i=r;else throw s}return Be(JW.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},i)}};function ZW(e=[],t=[]){return e.length!==t.length||e.some((n,o)=>!Object.is(n,t[o]))}var sx={};un(sx,{LexicalErrorBoundary:()=>eG});function eG({children:e,onError:t}){return c(hg,{fallback:c("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}var tG=sx,fA=tG.LexicalErrorBoundary;var bx={};un(bx,{$createHorizontalRuleNode:()=>xx,$isDecoratorTextNode:()=>PA,$isHorizontalRuleNode:()=>NA,AutoFocusExtension:()=>rG,ClearEditorExtension:()=>aG,DecoratorTextExtension:()=>uG,DecoratorTextNode:()=>Uu,EditorStateExtension:()=>xg,HorizontalRuleExtension:()=>SG,HorizontalRuleNode:()=>Ti,INSERT_HORIZONTAL_RULE_COMMAND:()=>xG,InitialStateExtension:()=>MA,LexicalBuilder:()=>sd,NodeSelectionExtension:()=>hx,TabIndentationExtension:()=>IG,applyFormatFromStyle:()=>iG,applyFormatToDom:()=>lG,batch:()=>CA,buildEditorFromExtensions:()=>gG,computed:()=>SA,configExtension:()=>rg,declarePeerDependency:()=>vM,defineExtension:()=>fn,effect:()=>Is,getExtensionDependencyFromEditor:()=>vG,getKnownTypesAndNodes:()=>sG,getPeerDependencyFromEditor:()=>AA,getPeerDependencyFromEditorOrThrow:()=>yG,namedSignals:()=>Sg,registerClearEditor:()=>TA,registerTabIndentation:()=>DA,safeCast:()=>Pr,shallowMergeConfig:()=>lg,signal:()=>ad,untracked:()=>px,watchedSignal:()=>yx});var nG=Symbol.for("preact-signals");function bg(){if(Ss>1)return void Ss--;let e,t=!1;for(;Hu!==void 0;){let n=Hu;for(Hu=void 0,fx++;n!==void 0;){let o=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&xA(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(fx=0,Ss--,t)throw e}function CA(e){if(Ss>0)return e();Ss++;try{return e()}finally{bg()}}var Bt,Hu;function px(e){let t=Bt;Bt=void 0;try{return e()}finally{Bt=t}}var Ss=0,fx=0,Cg=0;function mA(e){if(Bt===void 0)return;let t=e.n;return t===void 0||t.t!==Bt?(t={i:0,S:e,p:Bt.s,n:void 0,t:Bt,e:void 0,x:void 0,r:t},Bt.s!==void 0&&(Bt.s.n=t),Bt.s=t,e.n=t,32&Bt.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Bt.s,t.n=void 0,Bt.s.n=t,Bt.s=t),t):void 0}function ao(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function ad(e,t){return new ao(e,t)}function xA(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function gA(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function bA(e){let t,n=e.s;for(;n!==void 0;){let o=n.p;n.i===-1?(n.S.U(n),o!==void 0&&(o.n=n.n),n.n!==void 0&&(n.n.p=o)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=o}e.s=t}function wi(e,t){ao.call(this,void 0),this.x=e,this.s=void 0,this.g=Cg-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function SA(e,t){return new wi(e,t)}function IA(e){let t=e.u;if(e.u=void 0,typeof t=="function"){Ss++;let n=Bt;Bt=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,vx(e),o}finally{Bt=n,bg()}}}function vx(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,IA(e)}function oG(e){if(Bt!==this)throw new Error("Out-of-order effect");bA(this),Bt=e,this.f&=-2,8&this.f&&vx(this),bg()}function rd(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function Is(e,t){let n=new rd(e,t);try{n.c()}catch(r){throw n.d(),r}let o=n.d.bind(n);return o[Symbol.dispose]=o,o}function Sg(e,t={}){let n={};for(let o in e){let r=t[o],a=ad(r===void 0?e[o]:r);n[o]=a}return n}ao.prototype.brand=nG,ao.prototype.h=function(){return!0},ao.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:px(()=>{var n;(n=this.W)==null||n.call(this)}))},ao.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&px(()=>{var o;(o=this.Z)==null||o.call(this)}))}},ao.prototype.subscribe=function(e){return Is(()=>{let t=this.value,n=Bt;Bt=void 0;try{e(t)}finally{Bt=n}},{name:"sub"})},ao.prototype.valueOf=function(){return this.value},ao.prototype.toString=function(){return this.value+""},ao.prototype.toJSON=function(){return this.value},ao.prototype.peek=function(){let e=Bt;Bt=void 0;try{return this.value}finally{Bt=e}},Object.defineProperty(ao.prototype,"value",{get(){let e=mA(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(fx>100)throw new Error("Cycle detected");this.v=e,this.i++,Cg++,Ss++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{bg()}}}}),wi.prototype=new ao,wi.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cg))return!0;if(this.g=Cg,this.f|=1,this.i>0&&!xA(this))return this.f&=-2,!0;let e=Bt;try{gA(this),Bt=this;let t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Bt=e,bA(this),this.f&=-2,!0},wi.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}ao.prototype.S.call(this,e)},wi.prototype.U=function(e){if(this.t!==void 0&&(ao.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},wi.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(wi.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let e=mA(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),rd.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},rd.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,IA(this),gA(this),Ss++;let e=Bt;return Bt=this,oG.bind(this,e)},rd.prototype.N=function(){2&this.f||(this.f|=2,this.o=Hu,Hu=this)},rd.prototype.d=function(){this.f|=8,1&this.f||vx(this)},rd.prototype.dispose=function(){this.d()};var rG=fn({build:(e,t,n)=>Sg(t),config:Pr({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let o=n.getOutput();return Is(()=>o.disabled.value?void 0:e.registerRootListener(r=>{e.focus(()=>{let a=document.activeElement;r===null||a!==null&&r.contains(a)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function wA(){let e=St(),t=Fe(),n=rr();e.clear(),e.append(n),t!==null&&n.select(),Me(t)&&(t.format=0)}function TA(e,t=wA){return e.registerCommand(Wm,n=>(e.update(t),!0),Yt)}var aG=fn({build:(e,t,n)=>Sg(t),config:Pr({$onClear:wA}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:o}=n.getOutput();return Is(()=>TA(e,o.value))}});function sG(e){let t=new Set,n=new Set;for(let o of kA(e)){let r=typeof o=="function"?o:o.replace;t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function kA(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var ix=hM("format",{parse:e=>typeof e=="number"?e:0}),Uu=class extends So{$config(){return this.config("decorator-text",{extends:So,stateConfigs:[{flat:!0,stateConfig:ix}]})}getFormat(){return Um(this,ix)}getFormatFlags(t,n){return UC(this.getFormat(),t,n)}hasFormat(t){let n=pM[t];return(this.getFormat()&n)!==0}setFormat(t){return Vm(this,ix,t)}toggleFormat(t){let n=this.getFormat(),o=UC(n,t,null);return this.setFormat(o)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}};function PA(e){return e instanceof Uu}function iG(e,t,n){let o=t.fontWeight,r=t.textDecoration.split(" "),a=o==="700"||o==="bold",s=r.includes("line-through"),i=t.fontStyle==="italic",l=r.includes("underline"),d=t.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),s&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),i&&!e.hasFormat("italic")&&e.toggleFormat("italic"),l&&!e.hasFormat("underline")&&e.toggleFormat("underline"),d!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),d!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),n&&!e.hasFormat(n)&&e.toggleFormat(n),e}function lG(e,t,n=cG){for(let[o,r]of Object.entries(n))e.hasFormat(r)&&(t=dG(t,o));return t}function dG(e,t){let n=document.createElement(t);return n.appendChild(e),n}var cG={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},uG=fn({name:"@lexical/extension/DecoratorText",nodes:()=>[Uu],register:(e,t,n)=>e.registerCommand(GE,o=>{let r=Fe();if(AC(r)||Me(r))for(let a of r.getNodes())PA(a)&&a.toggleFormat(o);return!1},nd)});function yx(e,t){let n;return ad(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var xg=fn({build:e=>yx(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"});function Kt(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function RA(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)n[r]=RA(n[r],o[r]);return e}return t}var Cx=0,mx=1,LA=2,lx=3,vg=4,od=5,dx=6,zu=7;function cx(e){return e.id===Cx}function EA(e){return e.id===LA}function pG(e){return(function(t){return t.id===mx})(e)||Kt(305,String(e.id),String(mx)),Object.assign(e,{id:LA})}var fG=new Set,gx=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:Cx}}mergeConfigs(){let t=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):lg;for(let o of this.configs)t=n(t,o);return t}init(t){let n=this.state;EA(n)||Kt(306,String(n.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},a=(function(i,l,d){return Object.assign(i,{config:l,id:lx,registerState:d})})(n,this.mergeConfigs(),o),s;this.state=a,this.extension.init&&(s=this.extension.init(t,a.config,o)),this.state=(function(i,l,d){return Object.assign(i,{id:vg,initResult:l,registerState:d})})(a,s,r)}build(t){let n=this.state,o;n.id!==vg&&Kt(307,String(n.id),String(od)),this.extension.build&&(o=this.extension.build(t,n.config,n.registerState));let r={...n.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(a,s,i){return Object.assign(a,{id:od,output:s,registerState:i})})(n,o,r)}register(t,n){this._signal=n;let o=this.state;o.id!==od&&Kt(308,String(o.id),String(od));let r=this.extension.register&&this.extension.register(t,o.config,o.registerState);return this.state=(function(a){return Object.assign(a,{id:dx})})(o),()=>{let a=this.state;a.id!==zu&&Kt(309,String(o.id),String(zu)),this.state=(function(s){return Object.assign(s,{id:od})})(a),r&&r()}}afterRegistration(t){let n=this.state,o;return n.id!==dx&&Kt(310,String(n.id),String(dx)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(r){return Object.assign(r,{id:zu})})(n),o}getSignal(){return this._signal===void 0&&Kt(311),this._signal}getInitResult(){this.extension.init===void 0&&Kt(312,this.extension.name);let t=this.state;return(function(n){return n.id>=vg})(t)||Kt(313,String(t.id),String(vg)),t.initResult}getInitPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return(function(n){return n.id>=lx})(t)||Kt(314,String(t.id),String(lx)),{config:t.config}}getPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Kt(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Kt(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=zu})(t)||Kt(316,String(t.id),String(zu)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||fG}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(n){return n.id>=od})(t)||Kt(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},hA={tag:Io};function mG(){let e=St();e.isEmpty()&&e.append(rr())}var MA=fn({config:Pr({setOptions:hA,updateOptions:hA}),init:({$initialEditorState:e=mG})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:a}=r;if(IE(a))e.setEditorState(a,n);else if(typeof a=="function")e.update(()=>{a(e)},t);else if(a&&(typeof a=="string"||typeof a=="object")){let s=e.parseEditorState(a);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[lM,og,nM,fM,aM]}),vA=Symbol.for("@lexical/extension/LexicalBuilder");function gG(...e){return sd.fromExtensions(e).buildEditor()}function yA(){}function hG(e){throw e}function yg(e){return Array.isArray(e)?e:[e]}var ux="0.41.0+prod.esm",sd=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ux,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[yg(MA)];for(let o of t)n.push(yg(o));return new e(n)}static maybeFromEditor(t){let n=t[vA];return n&&(n.PACKAGE_VERSION!==ux&&Kt(292,n.PACKAGE_VERSION,ux),n instanceof e||Kt(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Kt(294),n}constructEditor(){let{$initialEditorState:t,onError:n,...o}=this.buildCreateEditorArgs(),r=Object.assign(ag({...o,...n?{onError:a=>{n(a,r)}}:{}}),{[vA]:this});for(let a of this.sortedExtensionReps())a.build(r);return r}buildEditor(){let t=yA;function n(){try{t()}finally{t=yA}}let o=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Vr(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Kt(295,t.name),n}addEdge(t,n,o){let r=this.outgoingConfigEdges.get(t);r?r.set(n,o):this.outgoingConfigEdges.set(t,new Map([[n,o]]));let a=this.incomingEdges.get(n);a?a.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Kt(296);let n=yg(t),[o]=n;typeof o.name!="string"&&Kt(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&Kt(298,o.name),!r){r=new gx(this,o),this.extensionNameMap.set(o.name,r);let a=this.conflicts.get(o.name);typeof a=="string"&&Kt(299,o.name,a);for(let s of o.conflictsWith||[])this.extensionNameMap.has(s)&&Kt(299,o.name,s),this.conflicts.set(s,o.name);for(let s of o.dependencies||[]){let i=yg(s);this.addEdge(o.name,i[0].name,i.slice(1)),this.addExtension(i)}for(let[s,i]of o.peerDependencies||[])this.addEdge(o.name,s,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],n=(o,r)=>{let a=o.state;if(EA(a))return;let s=o.extension.name;var i;cx(a)||Kt(300,s,r||"[unknown]"),cx(i=a)||Kt(304,String(i.id),String(Cx)),a=Object.assign(i,{id:mx}),o.state=a;let l=this.outgoingConfigEdges.get(s);if(l)for(let d of l.keys()){let u=this.extensionNameMap.get(d);u&&n(u,s)}a=pG(a),o.state=a,t.push(o)};for(let o of this.extensionNameMap.values())cx(o.state)&&n(o);for(let o of t)for(let[r,a]of this.outgoingConfigEdges.get(o.extension.name)||[])if(a.length>0){let s=this.extensionNameMap.get(r);if(s)for(let i of a)s.configs.add(i)}for(let[o,...r]of this.roots)if(r.length>0){let a=this.extensionNameMap.get(o.name);a===void 0&&Kt(301,o.name);for(let s of r)a.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let n=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],a=o.signal;for(let s of n){let i=s.register(t,a);i&&r.push(i)}for(let s of n){let i=s.afterRegistration(t);i&&r.push(i)}return Vr(...r)}buildCreateEditorArgs(){let t={},n=new Set,o=new Map,r=new Map,a={},s={},i=this.sortedExtensionReps();for(let u of i){let{extension:p}=u;if(p.onError!==void 0&&(t.onError=p.onError),p.disableEvents!==void 0&&(t.disableEvents=p.disableEvents),p.parentEditor!==void 0&&(t.parentEditor=p.parentEditor),p.editable!==void 0&&(t.editable=p.editable),p.namespace!==void 0&&(t.namespace=p.namespace),p.$initialEditorState!==void 0&&(t.$initialEditorState=p.$initialEditorState),p.nodes)for(let f of kA(p)){if(typeof f!="function"){let m=o.get(f.replace);m&&Kt(302,p.name,f.replace.name,m.extension.name),o.set(f.replace,u)}n.add(f)}if(p.html){if(p.html.export)for(let[f,m]of p.html.export.entries())r.set(f,m);p.html.import&&Object.assign(a,p.html.import)}p.theme&&RA(s,p.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);let l=Object.keys(a).length>0,d=r.size>0;(l||d)&&(t.html={},l&&(t.html.import=a),d&&(t.html.export=r));for(let u of i)u.init(t);return t.onError||(t.onError=hG),t}};function vG(e,t){let n=sd.fromEditor(e).getExtensionRep(t);return n===void 0&&Kt(303,t.name),n.getExtensionDependency()}function AA(e,t){let n=sd.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}function yG(e,t){let n=AA(e,t);return n===void 0&&Kt(291,t),n}var CG=new Set,hx=fn({build(e,t,n){let o=n.getDependency(xg).output,r=ad({watchedNodeKeys:new Map}),a=yx(()=>{},()=>Is(()=>{let s=a.peek(),{watchedNodeKeys:i}=r.value,l,d=!1;o.value.read(()=>{if(Fe())for(let[u,p]of i.entries()){if(p.size===0){i.delete(u);continue}let f=Zl(u),m=f&&f.isSelected()||!1;d=d||m!==(!!s&&s.has(u)),m&&(l=l||new Set,l.add(u))}}),!d&&l&&s&&l.size===s.size||(a.value=l)}));return{watchNodeKey:function(s){let i=SA(()=>(a.value||CG).has(s)),{watchedNodeKeys:l}=r.peek(),d=l.get(s),u=d!==void 0;return d=d||new Set,d.add(i),u||(l.set(s,d),r.value={watchedNodeKeys:l}),i}}},dependencies:[xg],name:"@lexical/extension/NodeSelection"}),xG=gM("INSERT_HORIZONTAL_RULE_COMMAND"),Ti=class e extends So{static getType(){return"horizontalrule"}static clone(t){return new e(t.__key)}static importJSON(t){return xx().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:bG,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){let n=document.createElement("hr");return Ou(n,t.theme.hr),n}getTextContent(){return`
3797
+ `}isInline(){return!1}updateDOM(){return!1}};function bG(){return{node:xx()}}function xx(){return fE(Ti)}function NA(e){return e instanceof Ti}var SG=fn({dependencies:[xg,hx],name:"@lexical/extension/HorizontalRule",nodes:()=>[Ti],register(e,t,n){let{watchNodeKey:o}=n.getDependency(hx).output,r=ad({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return Vr(e.registerCommand(FE,s=>{if(SM(s.target)){let i=bE(s.target);if(NA(i))return(function(l,d=!1){let u=Fe(),p=l.isSelected(),f=l.getKey(),m;d&&AC(u)?m=u:(m=mE(),ar(m)),p?m.delete(f):m.add(f)})(i,s.shiftKey),!0}return!1},nd),e.registerMutationListener(Ti,(s,i)=>{CA(()=>{let l=!1,{nodeSelections:d}=r.peek();for(let[u,p]of s.entries())if(p==="destroyed")d.delete(u),l=!0;else{let f=d.get(u),m=e.getElementByKey(u);f?f.domNode.value=m:(l=!0,d.set(u,{domNode:ad(m),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:d})})}),Is(()=>{let s=[];for(let{domNode:i,selectedSignal:l}of r.value.nodeSelections.values())s.push(Is(()=>{let d=i.value;d&&(l.value?Ou(d,a):ig(d,a))}));return Vr(...s)}))}});function _A(e){return e.canBeEmpty()}function DA(e,t,n=_A){return Vr(e.registerCommand(tg,o=>{let r=Fe();if(!Me(r))return!1;o.preventDefault();let a=(function(s){if(s.getNodes().filter(f=>ed(f)&&f.canIndent()).length>0)return!0;let i=s.anchor,l=s.focus,d=l.isBefore(i)?l:i,u=d.getNode(),p=aA(u);if(p.canIndent()){let f=p.getKey(),m=xi();if(m.anchor.set(f,0,"element"),m.focus.set(f,0,"element"),m=LE(m),m.anchor.is(d))return!0}return!1})(r)?o.shiftKey?oM:DC:YE;return e.dispatchCommand(a,void 0)},Yt),e.registerCommand(DC,()=>{let o=typeof t=="number"?t:t?t.peek():null,r=Fe();if(!Me(r))return!1;let a=typeof n=="function"?n:n.peek();return sA(s=>{if(a(s)){let i=s.getIndent()+1;(!o||i<o)&&s.setIndent(i)}})},Gm))}var IG=fn({build:(e,t,n)=>Sg(t),config:Pr({$canIndent:_A,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:o,maxIndent:r,$canIndent:a}=n.getOutput();return Is(()=>{if(!o.value)return DA(e,r,a)})}});var kt=bx,MCe=kt.$createHorizontalRuleNode,ACe=kt.$isDecoratorTextNode,NCe=kt.$isHorizontalRuleNode,_Ce=kt.AutoFocusExtension,DCe=kt.ClearEditorExtension,OCe=kt.DecoratorTextExtension,FCe=kt.DecoratorTextNode,BCe=kt.EditorStateExtension,zCe=kt.HorizontalRuleExtension,HCe=kt.HorizontalRuleNode,UCe=kt.INSERT_HORIZONTAL_RULE_COMMAND,KCe=kt.InitialStateExtension,OA=kt.LexicalBuilder,$Ce=kt.NodeSelectionExtension,qCe=kt.TabIndentationExtension,VCe=kt.applyFormatFromStyle,WCe=kt.applyFormatToDom,FA=kt.batch,GCe=kt.buildEditorFromExtensions,jCe=kt.computed,QCe=kt.configExtension,YCe=kt.declarePeerDependency,XCe=kt.defineExtension,Ku=kt.effect,JCe=kt.getExtensionDependencyFromEditor,ZCe=kt.getKnownTypesAndNodes,BA=kt.getPeerDependencyFromEditor,exe=kt.getPeerDependencyFromEditorOrThrow,Ig=kt.namedSignals,txe=kt.registerClearEditor,nxe=kt.registerTabIndentation,oxe=kt.safeCast,rxe=kt.shallowMergeConfig,axe=kt.signal,sxe=kt.untracked,ixe=kt.watchedSignal;var Sx={};un(Sx,{HistoryExtension:()=>wg,SharedHistoryExtension:()=>kG,createEmptyHistoryState:()=>UA,registerHistory:()=>HA});function wG(e,t,n,o,r){if(e===null||n.size===0&&o.size===0&&!r)return 0;let a=t._selection,s=e._selection;if(r)return 1;if(!(Me(a)&&Me(s)&&s.isCollapsed()&&a.isCollapsed()))return 0;let i=(function(C,y,x){let w=C._nodeMap,I=[];for(let S of y){let k=w.get(S);k!==void 0&&I.push(k)}for(let[S,k]of x){if(!k)continue;let P=w.get(S);P===void 0||Au(P)||I.push(P)}return I})(t,n,o);if(i.length===0)return 0;if(i.length>1){let C=t._nodeMap,y=C.get(a.anchor.key),x=C.get(s.anchor.key);return y&&x&&!e._nodeMap.has(y.__key)&&mt(y)&&y.__text.length===1&&a.anchor.offset===1?2:0}let l=i[0],d=e._nodeMap.get(l.__key);if(!mt(d)||!mt(l)||d.__mode!==l.__mode)return 0;let u=d.__text,p=l.__text;if(u===p)return 0;let f=a.anchor,m=s.anchor;if(f.key!==m.key||f.type!=="text")return 0;let g=f.offset,h=m.offset,v=p.length-u.length;return v===1&&h===g-1?2:v===-1&&h===g+1?3:v===-1&&h===g?4:0}function TG(e,t){let n=Date.now(),o=0,r=Date.now(),a=0,s=null;return(i,l,d,u,p,f)=>{let m=Date.now();if(f.has(zE)&&(r=n,a=o,s=i),f.has(Ym))return o=0,n=m,2;f.has(BE)&&s&&(n=r,o=a,i=s);let g=wG(i,l,u,p,e.isComposing()),h=(()=>{let v=d===null||d.editor===e,C=f.has(jE);if(!C&&v&&f.has(Io))return 0;if(g===1)return 2;if(i===null)return 1;let y=l._selection;if(!(u.size>0||p.size>0))return y!==null?0:2;let x=typeof t=="number"?t:t.peek();return C===!1&&g!==0&&g===o&&m<n+x&&v||u.size===1&&(function(w,I,S){let k=I._nodeMap.get(w),P=S._nodeMap.get(w),T=I._selection,R=S._selection;return!(Me(T)&&Me(R)&&T.anchor.type==="element"&&T.focus.type==="element"&&R.anchor.type==="text"&&R.focus.type==="text"||!mt(k)||!mt(P)||k.__parent!==P.__parent)&&JSON.stringify(I.read(()=>k.exportJSON()))===JSON.stringify(S.read(()=>P.exportJSON()))})(Array.from(u)[0],i,l)?0:1})();return n=m,o=g,h}}function zA(e){e.undoStack=[],e.redoStack=[],e.current=null}function HA(e,t,n){let o=TG(e,n);return wa(e.registerCommand(mM,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(l.length!==0){let d=s.current,u=l.pop();d!==null&&(i.push(d),a.dispatchCommand(Nu,!0)),l.length===0&&a.dispatchCommand(_u,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Ym})}})(e,t),!0),Yt),e.registerCommand(sM,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(i.length!==0){let d=s.current;d!==null&&(l.push(d),a.dispatchCommand(_u,!0));let u=i.pop();i.length===0&&a.dispatchCommand(Nu,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Ym})}})(e,t),!0),Yt),e.registerCommand(Wm,()=>(zA(t),!1),Yt),e.registerCommand(OE,()=>(zA(t),e.dispatchCommand(Nu,!1),e.dispatchCommand(_u,!1),!0),Yt),e.registerUpdateListener(({editorState:a,prevEditorState:s,dirtyLeaves:i,dirtyElements:l,tags:d})=>{let u=t.current,p=t.redoStack,f=t.undoStack,m=u===null?null:u.editorState;if(u!==null&&a===m)return;let g=o(s,a,u,i,l,d);if(g===1)p.length!==0&&(t.redoStack=[],e.dispatchCommand(Nu,!1)),u!==null&&(f.push({...u}),e.dispatchCommand(_u,!0));else if(g===2)return;t.current={editor:e,editorState:a}}))}function UA(){return{current:null,redoStack:[],undoStack:[]}}var wg=fn({build:(e,{delay:t,createInitialHistoryState:n,disabled:o})=>Ig({delay:t,disabled:o,historyState:n(e)}),config:Pr({createInitialHistoryState:UA,delay:300,disabled:typeof window>"u"}),name:"@lexical/history/History",register:(e,t,n)=>{let o=n.getOutput();return Ku(()=>o.disabled.value?void 0:HA(e,o.historyState.value,o.delay))}}),kG=fn({dependencies:[rg(wg,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(e,t,n){let{output:o}=n.getDependency(wg),r=(function(s){return s?BA(s,wg.name):null})(e._parentEditor);if(!r)return()=>{};let a=r.output;return Ku(()=>FA(()=>{o.delay.value=a.delay.value,o.historyState.value=a.historyState.value,o.disabled.value=a.disabled.value}))}});var Tg=Sx,pxe=Tg.HistoryExtension,fxe=Tg.SharedHistoryExtension,kg=Tg.createEmptyHistoryState,KA=Tg.registerHistory;var Ix={};un(Ix,{HistoryPlugin:()=>PG,createEmptyHistoryState:()=>kg});V();function PG({delay:e,externalHistoryState:t}){let[n]=jt();return(function(o,r,a=1e3){let s=K(()=>r||kg(),[r]);$(()=>KA(o,s,a),[a,o,s])})(n,t,e),null}var $A=Ix,qA=$A.HistoryPlugin,VA=$A.createEmptyHistoryState;var wx={};un(wx,{OnChangePlugin:()=>LG});V();var RG=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function LG({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[o]=jt();return RG(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:a,dirtyLeaves:s,prevEditorState:i,tags:l})=>{t&&a.size===0&&s.size===0||e&&l.has(Io)||i.isEmpty()||n(r,o,l)})},[o,e,t,n]),null}var EG=wx,WA=EG.OnChangePlugin;var Tx={};un(Tx,{useLexicalEditable:()=>NG});V();var MG=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function AG(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function NG(){return(function(e){let[t]=jt(),n=K(()=>e(t),[t,e]),[o,r]=W(()=>n.initialValueFn()),a=A(o);return MG(()=>{let{initialValueFn:s,subscribe:i}=n,l=s();return a.current!==l&&(a.current=l,r(l)),i(d=>{a.current=d,r(d)})},[n,e]),o})(AG)}var _G=Tx,GA=_G.useLexicalEditable;var kx={};un(kx,{ReactProviderExtension:()=>DG});var DG=fn({name:"@lexical/react/ReactProvider"});var OG=kx,jA=OG.ReactProviderExtension;var Px={};un(Px,{DragonExtension:()=>FG,registerDragonSupport:()=>QA});function QA(e){let t=window.location.origin,n=o=>{if(o.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let a=o.data;if(typeof a=="string"){let s;try{s=JSON.parse(a)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let l=i.args;if(l){let[d,u,p,f,m]=l;e.update(()=>{let g=Fe();if(Me(g)){let h=g.anchor,v=h.getNode(),C=0,y=0;if(mt(v)&&d>=0&&u>=0&&(C=d,y=d+u,g.setTextNodeRange(v,C,v,y)),C===y&&p===""||(g.insertRawText(p),v=h.getNode()),mt(v)){C=f,y=f+m;let x=v.getTextContentSize();C=C>x?x:C,y=y>x?x:y,g.setTextNodeRange(v,C,v,y)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}var FG=fn({build:(e,t,n)=>Ig(t),config:Pr({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,t,n)=>Ku(()=>n.getOutput().disabled.value?void 0:QA(e))});var YA=Px,XA=YA.DragonExtension,JA=YA.registerDragonSupport;var Rx={};un(Rx,{$generateHtmlFromNodes:()=>zG,$generateNodesFromDOM:()=>BG});function BG(e,t){let n=bM(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let a of n)if(!eN.has(a.nodeName)){let s=tN(a,e,r,!1);s!==null&&(o=o.concat(s))}return(function(a){for(let s of a)s.getNextSibling()instanceof _C&&s.insertAfter(Ci());for(let s of a){let i=s.getChildren();for(let l of i)s.insertBefore(l);s.remove()}})(r),o}function zG(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),o=St().getChildren();for(let r=0;r<o.length;r++)ZA(e,o[r],n,t);return n.innerHTML}function ZA(e,t,n,o=null){let r=o===null||t.isSelected(o),a=Ze(t)&&t.excludeFromCopy("html"),s=t;o!==null&&mt(t)&&(s=mg(o,t,"clone"));let i=Ze(s)?s.getChildren():[],l=CM(e,s.getType()),d;d=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);let{element:u,after:p}=d;if(!u)return!1;let f=document.createDocumentFragment();for(let m=0;m<i.length;m++){let g=i[m],h=ZA(e,g,f,o);!r&&Ze(t)&&h&&t.extractWithChild(g,o,"html")&&(r=!0)}if(r&&!a){if((iA(u)||zC(u))&&u.append(f),n.append(u),p){let m=p.call(s,u);m&&(zC(u)?u.replaceChildren(m):u.replaceWith(m))}}else n.append(f);return r}var eN=new Set(["STYLE","SCRIPT"]);function tN(e,t,n,o,r=new Map,a){let s=[];if(eN.has(e.nodeName))return s;let i=null,l=(function(g,h){let{nodeName:v}=g,C=h._htmlConversions.get(v.toLowerCase()),y=null;if(C!==void 0)for(let x of C){let w=x(g);w!==null&&(y===null||(y.priority||0)<=(w.priority||0))&&(y=w)}return y!==null?y.conversion:null})(e,t),d=l?l(e):null,u=null;if(d!==null){u=d.after;let g=d.node;if(i=Array.isArray(g)?g[g.length-1]:g,i!==null){for(let[,h]of r)if(i=h(i,a),!i)break;i&&s.push(...Array.isArray(g)?g:[i])}d.forChild!=null&&r.set(e.nodeName,d.forChild)}let p=e.childNodes,f=[],m=(i==null||!Si(i))&&(i!=null&&ed(i)||o);for(let g=0;g<p.length;g++)f.push(...tN(p[g],t,n,m,new Map(r),i));return u!=null&&(f=u(f)),ox(e)&&(f=HG(e,f,m?()=>{let g=new _C;return n.push(g),g}:rr)),i==null?f.length>0?s=s.concat(f):ox(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Fu(g.nextSibling)&&Fu(g.previousSibling)})(e)&&(s=s.concat(Ci())):Ze(i)&&i.append(...f),s}function HG(e,t,n){let o=e.style.textAlign,r=[],a=[];for(let s=0;s<t.length;s++){let i=t[s];if(ed(i))o&&!i.getFormat()&&i.setFormat(o),r.push(i);else if(a.push(i),s===t.length-1||s<t.length-1&&ed(t[s+1])){let l=n();l.setFormat(o),l.append(...a),r.push(l),a=[]}}return r}var nN=Rx,oN=nN.$generateHtmlFromNodes,rN=nN.$generateNodesFromDOM;var Ex={};un(Ex,{$generateJSONFromSelectedNodes:()=>dN,$generateNodesFromSerializedNodes:()=>cN,$getClipboardDataFromSelection:()=>pN,$getHtmlContent:()=>sN,$getLexicalContent:()=>iN,$insertDataTransferForPlainText:()=>UG,$insertDataTransferForRichText:()=>KG,$insertGeneratedNodes:()=>Lx,copyToClipboard:()=>$G,setLexicalClipboardDataTransfer:()=>fN});function Pg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function sN(e,t=Fe()){return t==null&&Pg(166),Me(t)&&t.isCollapsed()||t.getNodes().length===0?"":oN(e,t)}function iN(e,t=Fe()){return t==null&&Pg(166),Me(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(dN(e,t))}function UG(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function KG(e,t,n){let o=e.getData("application/x-lexical-editor");if(o)try{let i=JSON.parse(o);if(i.namespace===n._config.namespace&&Array.isArray(i.nodes))return Lx(n,cN(i.nodes),t)}catch(i){console.error(i)}let r=e.getData("text/html"),a=e.getData("text/plain");if(r&&a!==r)try{let i=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:d=>d}).createHTML(l):l})(r),"text/html");return Lx(n,rN(n,i),t)}catch(i){console.error(i)}let s=a||e.getData("text/uri-list");if(s!=null)if(Me(t)){let i=s.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){let d=Fe();if(Me(d)){let u=i[l];u===`
3798
3798
  `||u===`\r
3799
- `?d.insertParagraph():u===" "?d.insertNodes([hE()]):d.insertText(u)}}}else t.insertRawText(s)}function Lx(e,t,n){e.dispatchCommand(dM,{nodes:t,selection:n})||(n.insertNodes(t),(function(o){if(Me(o)&&o.isCollapsed()){let r=o.anchor,a=null,s=Jl(r,"previous");if(s)if($m(s))a=s.origin;else{let i=yE(s,bs(St(),"next").getFlipped());for(let l of i){if(mt(l.origin)){a=l.origin;break}if(Ze(l.origin)&&!l.origin.isInline())break}}if(a&&mt(a)){let i=a.getFormat(),l=a.getStyle();o.format===i&&o.style===l||(o.format=i,o.style=l,o.dirty=!0)}}})(n))}function lN(e,t,n,o=[]){let r=t===null||n.isSelected(t),a=Ze(n)&&n.excludeFromCopy("html"),s=n;t!==null&&mt(s)&&(s=mg(t,s,"clone"));let i=Ze(s)?s.getChildren():[],l=(function(d){let u=d.exportJSON(),p=d.constructor;if(u.type!==p.getType()&&Pg(58,p.name),Ze(d)){let f=u.children;Array.isArray(f)||Pg(59,p.name)}return u})(s);mt(s)&&s.getTextContentSize()===0&&(r=!1);for(let d=0;d<i.length;d++){let u=i[d],p=lN(e,t,u,l.children);!r&&Ze(n)&&p&&n.extractWithChild(u,t,"clone")&&(r=!0)}if(r&&!a)o.push(l);else if(Array.isArray(l.children))for(let d=0;d<l.children.length;d++){let u=l.children[d];o.push(u)}return r}function dN(e,t){let n=[],o=St().getChildren();for(let r=0;r<o.length;r++)lN(e,t,o[r],n);return{namespace:e._config.namespace,nodes:n}}function cN(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=EE(o);mt(r)&&UM(r),t.push(r)}return t}var id=null;async function $G(e,t,n){if(id!==null)return!1;if(t!==null)return new Promise((d,u)=>{e.update(()=>{d(aN(e,t,n))})});let o=e.getRootElement(),r=e._window||window,a=r.document,s=BC(r);if(o===null||s===null)return!1;let i=a.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(a.createTextNode("#")),o.append(i);let l=new Range;return l.setStart(i,0),l.setEnd(i,1),s.removeAllRanges(),s.addRange(l),new Promise((d,u)=>{let p=e.registerCommand(jm,f=>(Bu(f,ClipboardEvent)&&(p(),id!==null&&(r.clearTimeout(id),id=null),d(aN(e,f,n))),!0),Gm);id=r.setTimeout(()=>{p(),id=null,d(!1)},50),a.execCommand("copy"),i.remove()})}function aN(e,t,n){if(n===void 0){let r=BC(e._window),a=Fe();if(!a||a.isCollapsed()||!r)return!1;let s=r.anchorNode,i=r.focusNode;if(s!==null&&i!==null&&!wM(e,s,i))return!1;n=pN(a)}t.preventDefault();let o=t.clipboardData;return o!==null&&(fN(o,n),!0)}var uN=[["text/html",sN],["application/x-lexical-editor",iN]];function pN(e=Fe()){let t={"text/plain":e?e.getTextContent():""};if(e){let n=Hm();for(let[o,r]of uN){let a=r(n,e);a!==null&&(t[o]=a)}}return t}function fN(e,t){for(let[n]of uN)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}var Gr=Ex,Bxe=Gr.$generateJSONFromSelectedNodes,zxe=Gr.$generateNodesFromSerializedNodes,Hxe=Gr.$getClipboardDataFromSelection,mN=Gr.$getHtmlContent,Uxe=Gr.$getLexicalContent,Mx=Gr.$insertDataTransferForPlainText,Kxe=Gr.$insertDataTransferForRichText,$xe=Gr.$insertGeneratedNodes,qxe=Gr.copyToClipboard,Vxe=Gr.setLexicalClipboardDataTransfer;var Ax={};un(Ax,{PlainTextExtension:()=>YG,registerPlainText:()=>vN});var ki=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,qG=ki&&"documentMode"in document?document.documentMode:null,VG=ki&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),WG=!(!ki||!("InputEvent"in window)||qG)&&"getTargetRanges"in new window.InputEvent("input"),GG=ki&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gN=ki&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,jG=ki&&/^(?=.*Chrome).*/i.test(navigator.userAgent),QG=ki&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&VG&&!jG;function hN(e,t){t.update(()=>{if(e!==null){let n=Bu(e,KeyboardEvent)?null:e.clipboardData,o=Fe();if(o!==null&&!o.isCollapsed()&&n!=null){e.preventDefault();let r=mN(t);r!==null&&n.setData("text/html",r),n.setData("text/plain",o.getTextContent())}}})}function vN(e){return wa(e.registerCommand(Qm,t=>{let n=Fe();return!!Me(n)&&(n.deleteCharacter(t),!0)},Yt),e.registerCommand($E,t=>{let n=Fe();return!!Me(n)&&(n.deleteWord(t),!0)},Yt),e.registerCommand(KE,t=>{let n=Fe();return!!Me(n)&&(n.deleteLine(t),!0)},Yt),e.registerCommand(HE,t=>{let n=Fe();if(!Me(n))return!1;if(typeof t=="string")n.insertText(t);else{let o=t.dataTransfer;if(o!=null)Mx(o,n);else{let r=t.data;r&&n.insertText(r)}}return!0},Yt),e.registerCommand(iM,()=>{let t=Fe();return!!Me(t)&&(t.removeText(),!0)},Yt),e.registerCommand(OC,t=>{let n=Fe();return!!Me(n)&&(n.insertLineBreak(t),!0)},Yt),e.registerCommand(QE,()=>{let t=Fe();return!!Me(t)&&(t.insertLineBreak(),!0)},Yt),e.registerCommand(Xm,t=>{let n=Fe();if(!Me(n))return!1;let o=t,r=o.shiftKey;return!!JC(n,!0)&&(o.preventDefault(),XC(n,r,!0),!0)},Yt),e.registerCommand(Jm,t=>{let n=Fe();if(!Me(n))return!1;let o=t,r=o.shiftKey;return!!JC(n,!1)&&(o.preventDefault(),XC(n,r,!1),!0)},Yt),e.registerCommand(Zm,t=>{let n=Fe();return!!Me(n)&&(!gN||navigator.language!=="ko-KR")&&(t.preventDefault(),e.dispatchCommand(Qm,!0))},Yt),e.registerCommand(ZE,t=>{let n=Fe();return!!Me(n)&&(t.preventDefault(),e.dispatchCommand(Qm,!1))},Yt),e.registerCommand(eg,t=>{let n=Fe();if(!Me(n))return!1;if(t!==null){if((gN||GG||QG)&&WG)return!1;t.preventDefault()}return e.dispatchCommand(OC,!1)},Yt),e.registerCommand(cM,()=>(qm(),!0),Yt),e.registerCommand(jm,t=>{let n=Fe();return!!Me(n)&&(hN(t,e),!0)},Yt),e.registerCommand(UE,t=>{let n=Fe();return!!Me(n)&&((function(o,r){hN(o,r),r.update(()=>{let a=Fe();Me(a)&&a.removeText()})})(t,e),!0)},Yt),e.registerCommand(ng,t=>{let n=Fe();return!!Me(n)&&((function(o,r){o.preventDefault(),r.update(()=>{let a=Fe(),s=Bu(o,ClipboardEvent)?o.clipboardData:null;s!=null&&Me(a)&&Mx(s,a)},{tag:rM})})(t,e),!0)},Yt),e.registerCommand(VE,t=>{let n=Fe();return!!Me(n)&&(t.preventDefault(),!0)},Yt),e.registerCommand(qE,t=>{let n=Fe();return!!Me(n)&&(t.preventDefault(),!0)},Yt))}var YG=fn({conflictsWith:["@lexical/rich-text"],dependencies:[XA],name:"@lexical/plain-text",register:vN});var yN=Ax,Jxe=yN.PlainTextExtension,CN=yN.registerPlainText;var _x={};un(_x,{PlainTextPlugin:()=>ej});V();var Rg=Hd(Gc(),1);function XG(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Nx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function JG({editor:e,ErrorBoundary:t}){return(function(n,o){let[r,a]=W(()=>n.getDecorators());return Nx(()=>n.registerDecoratorListener(s=>{(0,Rg.flushSync)(()=>{a(s)})}),[n]),$(()=>{a(n.getDecorators())},[n]),K(()=>{let s=[],i=Object.keys(r);for(let l=0;l<i.length;l++){let d=i[l],u=c(o,{onError:f=>n._onError(f),children:c($h,{fallback:null,children:r[d]})}),p=n.getElementByKey(d);p!==null&&s.push((0,Rg.createPortal)(u,p,d))}return s},[o,r,n])})(e,t)}function ZG({editor:e,ErrorBoundary:t}){return(function(n){let o=OA.maybeFromEditor(n);if(o&&o.hasExtensionByName(jA.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&XG(320,r);return!0}return!1})(e)?null:c(JG,{editor:e,ErrorBoundary:t})}function xN(e){return e.getEditorState().read(cg(e.isComposing()))}function ej({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=jt();return(function(r){Nx(()=>wa(CN(r),JA(r)),[r])})(o),b(Ce,{children:[e,c(tj,{content:t}),c(ZG,{editor:o,ErrorBoundary:n})]})}function tj({content:e}){let[t]=jt(),n=(function(r){let[a,s]=W(()=>xN(r));return Nx(()=>{function i(){let l=xN(r);s(l)}return i(),wa(r.registerUpdateListener(()=>{i()}),r.registerEditableListener(()=>{i()}))},[r]),a})(t),o=GA();return n?typeof e=="function"?e(o):e:null}var nj=_x,bN=nj.PlainTextPlugin;V();var oj=new RegExp(`^(?:${Kc})?$`);function rj(e,t){return Number.isFinite(t)?Math.max(0,Math.min(e.length,Math.floor(t))):e.length}function SN(e,t,n=xl){let o=rj(e,t),r=e.lastIndexOf(`
3799
+ `?d.insertParagraph():u===" "?d.insertNodes([hE()]):d.insertText(u)}}}else t.insertRawText(s)}function Lx(e,t,n){e.dispatchCommand(dM,{nodes:t,selection:n})||(n.insertNodes(t),(function(o){if(Me(o)&&o.isCollapsed()){let r=o.anchor,a=null,s=Jl(r,"previous");if(s)if($m(s))a=s.origin;else{let i=yE(s,bs(St(),"next").getFlipped());for(let l of i){if(mt(l.origin)){a=l.origin;break}if(Ze(l.origin)&&!l.origin.isInline())break}}if(a&&mt(a)){let i=a.getFormat(),l=a.getStyle();o.format===i&&o.style===l||(o.format=i,o.style=l,o.dirty=!0)}}})(n))}function lN(e,t,n,o=[]){let r=t===null||n.isSelected(t),a=Ze(n)&&n.excludeFromCopy("html"),s=n;t!==null&&mt(s)&&(s=mg(t,s,"clone"));let i=Ze(s)?s.getChildren():[],l=(function(d){let u=d.exportJSON(),p=d.constructor;if(u.type!==p.getType()&&Pg(58,p.name),Ze(d)){let f=u.children;Array.isArray(f)||Pg(59,p.name)}return u})(s);mt(s)&&s.getTextContentSize()===0&&(r=!1);for(let d=0;d<i.length;d++){let u=i[d],p=lN(e,t,u,l.children);!r&&Ze(n)&&p&&n.extractWithChild(u,t,"clone")&&(r=!0)}if(r&&!a)o.push(l);else if(Array.isArray(l.children))for(let d=0;d<l.children.length;d++){let u=l.children[d];o.push(u)}return r}function dN(e,t){let n=[],o=St().getChildren();for(let r=0;r<o.length;r++)lN(e,t,o[r],n);return{namespace:e._config.namespace,nodes:n}}function cN(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=EE(o);mt(r)&&UM(r),t.push(r)}return t}var id=null;async function $G(e,t,n){if(id!==null)return!1;if(t!==null)return new Promise((d,u)=>{e.update(()=>{d(aN(e,t,n))})});let o=e.getRootElement(),r=e._window||window,a=r.document,s=BC(r);if(o===null||s===null)return!1;let i=a.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(a.createTextNode("#")),o.append(i);let l=new Range;return l.setStart(i,0),l.setEnd(i,1),s.removeAllRanges(),s.addRange(l),new Promise((d,u)=>{let p=e.registerCommand(jm,f=>(Bu(f,ClipboardEvent)&&(p(),id!==null&&(r.clearTimeout(id),id=null),d(aN(e,f,n))),!0),Gm);id=r.setTimeout(()=>{p(),id=null,d(!1)},50),a.execCommand("copy"),i.remove()})}function aN(e,t,n){if(n===void 0){let r=BC(e._window),a=Fe();if(!a||a.isCollapsed()||!r)return!1;let s=r.anchorNode,i=r.focusNode;if(s!==null&&i!==null&&!wM(e,s,i))return!1;n=pN(a)}t.preventDefault();let o=t.clipboardData;return o!==null&&(fN(o,n),!0)}var uN=[["text/html",sN],["application/x-lexical-editor",iN]];function pN(e=Fe()){let t={"text/plain":e?e.getTextContent():""};if(e){let n=Hm();for(let[o,r]of uN){let a=r(n,e);a!==null&&(t[o]=a)}}return t}function fN(e,t){for(let[n]of uN)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}var Gr=Ex,Hxe=Gr.$generateJSONFromSelectedNodes,Uxe=Gr.$generateNodesFromSerializedNodes,Kxe=Gr.$getClipboardDataFromSelection,mN=Gr.$getHtmlContent,$xe=Gr.$getLexicalContent,Mx=Gr.$insertDataTransferForPlainText,qxe=Gr.$insertDataTransferForRichText,Vxe=Gr.$insertGeneratedNodes,Wxe=Gr.copyToClipboard,Gxe=Gr.setLexicalClipboardDataTransfer;var Ax={};un(Ax,{PlainTextExtension:()=>YG,registerPlainText:()=>vN});var ki=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,qG=ki&&"documentMode"in document?document.documentMode:null,VG=ki&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),WG=!(!ki||!("InputEvent"in window)||qG)&&"getTargetRanges"in new window.InputEvent("input"),GG=ki&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gN=ki&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,jG=ki&&/^(?=.*Chrome).*/i.test(navigator.userAgent),QG=ki&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&VG&&!jG;function hN(e,t){t.update(()=>{if(e!==null){let n=Bu(e,KeyboardEvent)?null:e.clipboardData,o=Fe();if(o!==null&&!o.isCollapsed()&&n!=null){e.preventDefault();let r=mN(t);r!==null&&n.setData("text/html",r),n.setData("text/plain",o.getTextContent())}}})}function vN(e){return wa(e.registerCommand(Qm,t=>{let n=Fe();return!!Me(n)&&(n.deleteCharacter(t),!0)},Yt),e.registerCommand($E,t=>{let n=Fe();return!!Me(n)&&(n.deleteWord(t),!0)},Yt),e.registerCommand(KE,t=>{let n=Fe();return!!Me(n)&&(n.deleteLine(t),!0)},Yt),e.registerCommand(HE,t=>{let n=Fe();if(!Me(n))return!1;if(typeof t=="string")n.insertText(t);else{let o=t.dataTransfer;if(o!=null)Mx(o,n);else{let r=t.data;r&&n.insertText(r)}}return!0},Yt),e.registerCommand(iM,()=>{let t=Fe();return!!Me(t)&&(t.removeText(),!0)},Yt),e.registerCommand(OC,t=>{let n=Fe();return!!Me(n)&&(n.insertLineBreak(t),!0)},Yt),e.registerCommand(QE,()=>{let t=Fe();return!!Me(t)&&(t.insertLineBreak(),!0)},Yt),e.registerCommand(Xm,t=>{let n=Fe();if(!Me(n))return!1;let o=t,r=o.shiftKey;return!!JC(n,!0)&&(o.preventDefault(),XC(n,r,!0),!0)},Yt),e.registerCommand(Jm,t=>{let n=Fe();if(!Me(n))return!1;let o=t,r=o.shiftKey;return!!JC(n,!1)&&(o.preventDefault(),XC(n,r,!1),!0)},Yt),e.registerCommand(Zm,t=>{let n=Fe();return!!Me(n)&&(!gN||navigator.language!=="ko-KR")&&(t.preventDefault(),e.dispatchCommand(Qm,!0))},Yt),e.registerCommand(ZE,t=>{let n=Fe();return!!Me(n)&&(t.preventDefault(),e.dispatchCommand(Qm,!1))},Yt),e.registerCommand(eg,t=>{let n=Fe();if(!Me(n))return!1;if(t!==null){if((gN||GG||QG)&&WG)return!1;t.preventDefault()}return e.dispatchCommand(OC,!1)},Yt),e.registerCommand(cM,()=>(qm(),!0),Yt),e.registerCommand(jm,t=>{let n=Fe();return!!Me(n)&&(hN(t,e),!0)},Yt),e.registerCommand(UE,t=>{let n=Fe();return!!Me(n)&&((function(o,r){hN(o,r),r.update(()=>{let a=Fe();Me(a)&&a.removeText()})})(t,e),!0)},Yt),e.registerCommand(ng,t=>{let n=Fe();return!!Me(n)&&((function(o,r){o.preventDefault(),r.update(()=>{let a=Fe(),s=Bu(o,ClipboardEvent)?o.clipboardData:null;s!=null&&Me(a)&&Mx(s,a)},{tag:rM})})(t,e),!0)},Yt),e.registerCommand(VE,t=>{let n=Fe();return!!Me(n)&&(t.preventDefault(),!0)},Yt),e.registerCommand(qE,t=>{let n=Fe();return!!Me(n)&&(t.preventDefault(),!0)},Yt))}var YG=fn({conflictsWith:["@lexical/rich-text"],dependencies:[XA],name:"@lexical/plain-text",register:vN});var yN=Ax,ebe=yN.PlainTextExtension,CN=yN.registerPlainText;var _x={};un(_x,{PlainTextPlugin:()=>ej});V();var Rg=Hd(Gc(),1);function XG(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Nx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?fe:$;function JG({editor:e,ErrorBoundary:t}){return(function(n,o){let[r,a]=W(()=>n.getDecorators());return Nx(()=>n.registerDecoratorListener(s=>{(0,Rg.flushSync)(()=>{a(s)})}),[n]),$(()=>{a(n.getDecorators())},[n]),K(()=>{let s=[],i=Object.keys(r);for(let l=0;l<i.length;l++){let d=i[l],u=c(o,{onError:f=>n._onError(f),children:c($h,{fallback:null,children:r[d]})}),p=n.getElementByKey(d);p!==null&&s.push((0,Rg.createPortal)(u,p,d))}return s},[o,r,n])})(e,t)}function ZG({editor:e,ErrorBoundary:t}){return(function(n){let o=OA.maybeFromEditor(n);if(o&&o.hasExtensionByName(jA.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&XG(320,r);return!0}return!1})(e)?null:c(JG,{editor:e,ErrorBoundary:t})}function xN(e){return e.getEditorState().read(cg(e.isComposing()))}function ej({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=jt();return(function(r){Nx(()=>wa(CN(r),JA(r)),[r])})(o),b(Ce,{children:[e,c(tj,{content:t}),c(ZG,{editor:o,ErrorBoundary:n})]})}function tj({content:e}){let[t]=jt(),n=(function(r){let[a,s]=W(()=>xN(r));return Nx(()=>{function i(){let l=xN(r);s(l)}return i(),wa(r.registerUpdateListener(()=>{i()}),r.registerEditableListener(()=>{i()}))},[r]),a})(t),o=GA();return n?typeof e=="function"?e(o):e:null}var nj=_x,bN=nj.PlainTextPlugin;V();var oj=new RegExp(`^(?:${Kc})?$`);function rj(e,t){return Number.isFinite(t)?Math.max(0,Math.min(e.length,Math.floor(t))):e.length}function SN(e,t,n=xl){let o=rj(e,t),r=e.lastIndexOf(`
3800
3800
  `,Math.max(0,o-1))+1,a=/^\/(\S*)$/.exec(e.slice(r,o));if(a)return{kind:"slash-command",query:a[1]??"",rangeStart:r,rangeEnd:o};let s=o;for(;s>0&&!n(e[s-1]??"");)s-=1;let i=e.slice(s,o),l={query:i.slice(1),rangeStart:s,rangeEnd:o};if(i.startsWith("$"))return{kind:"skill",...l};if(i.startsWith("@"))return{kind:"path",...l};if(!i.startsWith("/"))return null;let d=o;for(;d<e.length&&!n(e[d]??"");)d+=1;return oj.test(e.slice(s+1,d))?{kind:"slash-skill",...l}:null}var aj=/(^|\s)@(?:"((?:\\.|[^"\\])*)"|([^\s@"]+))(?=\s)/g,sj=512,ij=new RegExp(`(^|\\s)\\[((?:\\\\.|[^\\]\\\\]){0,${sj}})\\]\\(([^)\\s]+)\\)(?=\\s)`,"g"),lj=/^[A-Za-z][A-Za-z0-9+.-]*:/,dj=/^[A-Za-z]:[\\/]/,cj=/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*(?:\/[^\s@"]+)*$/;function uj(e){let t=[];for(let n of e.matchAll(ij)){let o=n[0],r=n[1]??"",a=(n[2]??"").replace(/\\(.)/g,"$1"),s=n[3]??"",i=s;try{i=decodeURIComponent(s)}catch{}let l=Math.max(i.lastIndexOf("/"),i.lastIndexOf("\\")),d=l>=0?i.slice(l+1):i,u=lj.test(i)&&!dj.test(i);if(!i||u||a!==d)continue;let p=(n.index??0)+r.length,f=p+o.length-r.length;t.push({type:"mention",value:i,source:e.slice(p,f),start:p,end:f})}for(let n of e.matchAll(aj)){let o=n[0],r=n[1]??"",a=n[2],s=a!==void 0?a.replace(/\\(.)/g,"$1"):n[3]??"";if(!s||a===void 0&&cj.test(s))continue;let i=(n.index??0)+r.length,l=i+o.length-r.length;t.push({type:"mention",value:s,source:e.slice(i,l),start:i,end:l})}return t}function $u(e,t={}){let n=uj(e);for(let o of vv(e))o.sigil!=="$"||o.end>=e.length||n.push({type:"skill",value:o.name,source:e.slice(o.start,o.end),start:o.start,end:o.end});for(let o of t.preserveTrailingFrom??[])o.end===e.length&&e.slice(o.start,o.end)===o.source&&!n.some(r=>r.type===o.type&&r.start===o.start&&r.end===o.end)&&n.push(o);return[...n].sort((o,r)=>o.start-r.start)}function pj(e){return e.replace(/\r\n/g,`
3801
3801
  `).replace(/^\n+|\n+$/g,"")}function fj(e){return pj(e.text).length>0}function IN(e){return!fj(e)}function mj(e,t){return e.lineStart===e.lineEnd?t("pendingContext.terminalLine",{line:e.lineStart}):t("pendingContext.terminalLines",{start:e.lineStart,end:e.lineEnd})}function wN(e,t){return t("pendingContext.terminalLabel",{terminal:e.terminalLabel,range:mj(e,t)})}function TN(e,t,n){return e<=n&&n<t}function kN(e,t){if(!t)return;let n=e[e.length-1];if(n&&n.type==="text"){n.text+=t;return}e.push({type:"text",text:t})}function PN(e,t){let n=0;for(let o=0;o<e.length;o+=1)if(e[o]===ra){if(o>n&&t({type:"text",text:e.slice(n,o),promptOffset:n})===!0||t({type:"terminal-context",promptOffset:o})===!0)return!0;n=o+1}return n<e.length&&t({type:"text",text:e.slice(n),promptOffset:n})===!0}function gj(e,t){return PN(e,n=>n.type!=="text"?!1:t(n.text,n.promptOffset))}function hj(e,t){return gj(e,(n,o)=>{for(let r of $u(n))if(r.type==="mention"&&t(r,o)===!0)return!0;return!1})}function vj(e){let t=[];if(!e)return t;let n=$u(e),o=0;for(let r of n)r.start<o||(r.start>o&&kN(t,e.slice(o,r.start)),r.type==="mention"?t.push({type:"mention",path:r.value,source:r.source}):t.push({type:"skill",name:r.value}),o=r.end);return o<e.length&&kN(t,e.slice(o)),t}function Dx(e,t,n){return!e||t>=n?!1:hj(e,(o,r)=>{let a=r+o.start,s=r+o.end,i=a-1,l=s;return!!(i>=0&&/\s/.test(e[i]??"")&&TN(t,n,i)||l<e.length&&/\s/.test(e[l]??"")&&TN(t,n,l))})}function Ta(e,t=[]){if(!e)return[];let n=[],o=0;return PN(e,r=>r.type==="text"?(n.push(...vj(r.text)),!1):(n.push({type:"terminal-context",context:t[o]??null}),o+=1,!1)),n}function LN(e){return e.isMobileViewport?null:e.modifierKey&&e.shiftKey?e.isDraftThread?"background":null:e.shiftKey?null:e.modifierKey?"steer":"foreground"}var RN=e=>e.type!=="text";function EN(e,t){return Number.isFinite(t)?Math.max(0,Math.min(e.length,Math.floor(t))):e.length}function Ox(e){return xl(e)||e===ra}function Uo(e,t){let n=EN(e,t),o=Ta(e);if(o.length===0)return n;let r=n,a=0;for(let s of o){if(s.type==="mention"){let l=s.source.length;if(r<=1)return a+(r===0?0:l);r-=1,a+=l;continue}if(s.type==="skill"){let l=s.name.length+1;if(r<=1)return a+(r===0?0:l);r-=1,a+=l;continue}if(s.type==="terminal-context"){if(r<=1)return a+r;r-=1,a+=1;continue}let i=s.text.length;if(r<=i)return a+r;r-=i,a+=i}return a}function MN(e){return e.type==="text"?e.text.length:1}function AN(e,t){let n=e.reduce((o,r)=>o+MN(r),0);return Number.isFinite(t)?Math.max(0,Math.min(n,Math.floor(t))):n}function ir(e,t){return AN(Ta(e),t)}function Gn(e,t){let n=EN(e,t),o=Ta(e);if(o.length===0)return n;let r=n,a=0;for(let s of o){if(s.type==="mention"){let l=s.source.length;if(r===0)return a;if(r<=l)return a+1;r-=l,a+=1;continue}if(s.type==="skill"){let l=s.name.length+1;if(r===0)return a;if(r<=l)return a+1;r-=l,a+=1;continue}if(s.type==="terminal-context"){if(r<=1)return a+r;r-=1,a+=1;continue}let i=s.text.length;if(r<=i)return a+r;r-=i,a+=i}return a}function ld(e,t,n){let o=Ta(e);if(!o.some(RN))return!1;let r=AN(o,t),a=0;for(let s of o){if(RN(s)&&(n==="left"&&r===a+1||n==="right"&&r===a))return!0;a+=MN(s)}return!1}function wo(e,t){return SN(e,t,Ox)}function NN(e,t,n,o){let r=Math.max(0,Math.min(e.length,t)),a=Math.max(r,Math.min(e.length,n));return{text:`${e.slice(0,r)}${o}${e.slice(a)}`,cursor:r+o.length}}function _N(e){return e.map(t=>[t.id,t.threadId,t.terminalId,t.terminalLabel,t.lineStart,t.lineEnd,t.createdAt,t.text].join("")).join("")}function DN(e){return e.map(t=>[t.name,t.displayName??"",t.shortDescription??"",t.description??"",t.path,t.scope??"",t.enabled?"1":"0"].join("")).join("")}function ON(e){let t=0;return e.getEditorState().read(()=>{let n=Fe();Me(n)&&!n.isCollapsed()&&(t=n.getTextContent().length)}),t}function FN(e){e.update(()=>{let t=Fe();Me(t)&&!t.isCollapsed()&&t.removeText()})}V();V();function yj(e){return(e.comment??e.text).replace(/\s+/g," ").trim()}var dd=class e extends So{__quote;__source;static getType(){return"composer-quote"}static clone(t){return new e(t.__quote,t.__source,t.__key)}static importJSON(t){return Lg(t.quote,t.source).updateFromJSON(t)}constructor(t,n,o){super(o),this.__quote=t,this.__source=n}exportJSON(){return{...super.exportJSON(),quote:this.__quote,source:this.__source,type:"composer-quote",version:1}}createDOM(){let t=document.createElement("span");return t.className=hr,t}updateDOM(){return!1}getTextContent(){return this.__source}isInline(){return!0}decorate(){return c(Cj,{nodeKey:this.getKey(),quote:this.__quote,source:this.__source})}};function Lg(e,t){return xs(new dd(e,t))}function Cj(e){let{t}=Q(),[n]=jt(),o=Bo(),r=o?.data.assistantQuotes??null,[a,s]=W(!1),[i,l]=W(e.quote.comment??""),[d,u]=xt(Yp,o?.threadKey??"",null);$(()=>{d===null||d!==e.source||(u(null),l(e.quote.comment??""),s(!0))},[d,e.quote.comment,e.source,u]);let p=yj(e.quote),f=()=>{if(s(!1),r===null)return;let m=r.withComment(e.quote,i),g=r.serialize(m);g!==null&&n.update(()=>{let h=Zl(e.nodeKey);h instanceof dd&&h.replace(Lg(m,g))})};return b(fo,{open:a,onOpenChange:m=>{m&&l(e.quote.comment??""),s(m)},children:[c(go,{render:b("span",{className:Zo,contentEditable:!1,spellCheck:!1,role:"button",tabIndex:-1,"data-composer-quote-chip":"true","aria-label":t("composer.quote.chipLabel",{text:p}),children:[c(ia,{"aria-hidden":"true",className:vo}),c("span",{className:yo,children:p})]})}),c(mo,{side:"top",align:"start",className:"w-96 max-w-[calc(100vw-2rem)]",children:b("div",{className:"flex flex-col gap-2",children:[c("div",{className:"line-clamp-6 whitespace-pre-wrap border-l-2 border-border ps-2 text-muted-foreground text-sm",children:e.quote.text}),c(wI,{value:i,autoFocus:!0,rows:3,placeholder:t("composer.quote.commentPlaceholder"),"aria-label":t("composer.quote.commentLabel"),onChange:m=>l(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),f())}}),b("div",{className:"flex justify-end gap-2",children:[c(Y,{size:"sm",variant:"ghost",onClick:()=>s(!1),children:t("composer.cancel")}),c(Y,{size:"sm",onClick:f,disabled:r===null,children:t("composer.quote.saveComment")})]})]})})]})}var qu=class e extends So{__reference;__source;static getType(){return"composer-thread-reference"}static clone(t){return new e(t.__reference,t.__source,t.__key)}static importJSON(t){return Fx(t.reference,t.source).updateFromJSON(t)}constructor(t,n,o){super(o),this.__reference=t,this.__source=n}exportJSON(){return{...super.exportJSON(),reference:this.__reference,source:this.__source,type:"composer-thread-reference",version:1}}createDOM(){let t=document.createElement("span");return t.className=hr,t}updateDOM(){return!1}getTextContent(){return this.__source}isInline(){return!0}decorate(){return c(xj,{reference:this.__reference})}};function Fx(e,t){return xs(new qu(e,t))}function xj(e){let{t}=Q(),n=Bo(),r=Ur()(e.reference.title),a=b("span",{className:Zo,contentEditable:!1,spellCheck:!1,"data-composer-thread-reference-chip":"true","aria-label":t("composer.threadReference.chipLabel",{title:r}),children:[c(sa,{"aria-hidden":"true",className:vo}),c("span",{className:yo,children:r})]});return b(Ne,{children:[c(De,{render:a}),c(_e,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:c(ff,{reference:e.reference,useMachineLabel:n?.data.threadReferences?.useMachineLabel})})]})}var Bx=[dd,qu];function Eg(e){return Bx.some(t=>e instanceof t)}function bj(e){return{collect:t=>[...e.assistantQuotes.collect(t).map(n=>({start:n.start,end:n.end,createNode:()=>Lg(n.quote,n.source)})),...(e.threadReferences?.collect(t)??[]).map(n=>({start:n.start,end:n.end,createNode:()=>Fx(n.reference,n.source)}))].toSorted((n,o)=>n.start-o.start)}}function Pi(){let e=Bo()?.data??null,t=K(()=>e===null?null:bj(e),[e]),n=A(t);return n.current=t,n}var cd=new Map,Sj=32;function BN(e,t){for(cd.delete(e),cd.set(e,t);cd.size>Sj;){let n=cd.keys().next().value;if(n===void 0)break;cd.delete(n)}}function Ij(e){return{anchor:e.length,focus:e.length}}function ka(e,t,n){let o=cd.get(e);if(o)return BN(e,o),o;let r={cursor:n?.cursor??t.length,expandedCursor:n?.expandedCursor??t.length,selection:n?{anchor:n.cursor,focus:n.cursor}:Ij(t),history:VA()};return BN(e,r),r}function ud(e,t,n){let o=ka(e,t);o.cursor=n.cursor,o.expandedCursor=n.expandedCursor,o.selection=n.selection}function zN(e,t,n,o){let r=ka(e,t);r.cursor=n,r.expandedCursor=o}function HN(e,t){let n=e.current,o=[...e.undoStack],r=[...e.redoStack];t(),e.current=n,e.undoStack.splice(0,e.undoStack.length,...o),e.redoStack.splice(0,e.redoStack.length,...r)}function wj(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>=0?e.slice(t+1):e}function Tj(e){return e.replaceAll("\\","\\\\").replaceAll("[","\\[").replaceAll("]","\\]")}function kj(e){return encodeURI(e).replaceAll("(","%28").replaceAll(")","%29").replaceAll("#","%23").replaceAll("?","%3F").replaceAll("\\","%5C")}function Ri(e){return`[${Tj(wj(e))}](${kj(e)})`}V();function zx(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)}function UN(e){let t=zx(e);return t.startsWith(".")&&!t.slice(1).includes(".")?"directory":t.includes(".")?"file":"directory"}V();V();var KN=pt(null),pd=KN.Provider;function Rt(){let e=Dt(KN);if(e===null)throw new Error("Composer API has not been provided.");return e}var Mg=de(function(t){let n=Rt().pierreIcons,o=n.useSpriteReady();Ud(n.ensureSprite,[n]);let r=K(()=>n.resolveForEntry(t.pathValue,t.kind),[n,t.kind,t.pathValue]);return o?c("svg",{"aria-hidden":"true","data-file-icon":r.symbolId,className:G("size-4 shrink-0",t.className),children:c("use",{href:`#${r.symbolId}`})}):t.kind==="directory"?c(qa,{className:G("size-4 shrink-0 text-icon-muted",t.className)}):c(rc,{className:G("size-4 shrink-0 text-icon-muted",t.className)})});var $N=Zo;function qN(e){return b(Ce,{children:[c(Mg,{pathValue:e.path,kind:UN(e.path),theme:e.theme,className:vo}),c("span",{className:e.selectable?dT:yo,children:e.label})]})}function Ag(e){return c("span",{className:$N,contentEditable:!1,spellCheck:!1,"data-composer-mention-chip":"true",children:c(qN,{path:e.path,label:zx(e.path),theme:e.theme})})}function Ng(e){return b("span",{className:cT,contentEditable:!1,spellCheck:!1,"data-composer-skill-chip":"true",children:[c("span",{"aria-hidden":"true",className:vo,dangerouslySetInnerHTML:{__html:uT}}),c("span",{className:yo,children:e.label})]})}function VN(e){let{label:t,tooltipText:n,expired:o=!1}=e;return b(Ne,{children:[c(De,{render:b("span",{className:G(Zo,o&&"border-destructive/35 bg-destructive/8 text-destructive-foreground"),"data-terminal-context-expired":o?"true":void 0,children:[c(Do,{className:G(vo,"size-icon-1",o&&"opacity-100")}),c("span",{className:yo,children:t})]})}),c(_e,{side:"top",className:"max-w-80 whitespace-pre-wrap leading-tight",children:n})]})}function WN({context:e}){let{t}=Q(),n=wN(e,t),o=IN(e),r=o?t("pendingContext.terminalExpired",{label:n}):e.text;return c(VN,{label:n,tooltipText:r,expired:o})}function Pj(e){let t=[];for(let n of e.split(/[\s:_-]+/))n.length!==0&&t.push(n.charAt(0).toUpperCase()+n.slice(1));return t.join(" ")}function Rj(e){return e.replaceAll("\\","/")}function Ko(e){let t=e.displayName?.trim();return t||Pj(e.name)}function Hx(e,t){return t?e.filter(bl):[]}function GN(e,t){let n=new Set(t.map(o=>o.name.trim().toLowerCase()));return e.filter(o=>!n.has(o.name.trim().toLowerCase()))}function jN(e){let t=Rj(e.path);if(t.includes("/.codex/plugins/")||t.includes("/.agents/plugins/"))return"app";switch(e.scope?.trim().toLowerCase()){case"repo":case"repository":return"repo";case"project":case"workspace":case"local":return"project";case"user":case"personal":return"personal";case"system":return"system";case void 0:case"":return"other";default:return"other"}}var _g=pt({onRemoveTerminalContext:()=>{}});function Lj(e){let t=c(Ag,{path:e.path,theme:Nj()});return b(Ne,{children:[c(De,{render:t}),c(_e,{side:"top",className:"max-w-120 whitespace-normal leading-tight wrap-anywhere",children:e.path})]})}var Li=class e extends So{__path;__source;static getType(){return"composer-mention"}static clone(t){return new e(t.__path,t.__source,t.__key)}static importJSON(t){return Vu(t.path,t.source).updateFromJSON(t)}constructor(t,n=Ri(t),o){super(o),this.__path=t,this.__source=n}exportJSON(){return{...super.exportJSON(),path:this.__path,source:this.__source,type:"composer-mention",version:1}}createDOM(){let t=document.createElement("span");return t.className=hr,t}updateDOM(){return!1}getTextContent(){return this.__source}isInline(){return!0}decorate(){return c(Lj,{path:this.__path})}};function Vu(e,t){return xs(new Li(e,t))}function Ej(e){let t=e.shortDescription?.trim();return t||e.description?.trim()||null}function Ei(e){return new Map(e.map(t=>[t.name,{label:Ko(t),description:Ej(t)}]))}function Mj(e){let t=c(Ng,{label:e.skillLabel});return e.skillDescription?b(Ne,{children:[c(De,{render:t}),c(_e,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:e.skillDescription})]}):t}var fd=class e extends So{__skillName;__skillLabel;__skillDescription;static getType(){return"composer-skill"}static clone(t){return new e(t.__skillName,t.__skillLabel,t.__skillDescription,t.__key)}static importJSON(t){return Ux(t.skillName,t.skillLabel??t.skillName,t.skillDescription??null).updateFromJSON(t)}constructor(t,n,o,r){super(r);let a=t.startsWith("$")?t.slice(1):t;this.__skillName=a,this.__skillLabel=n,this.__skillDescription=o}exportJSON(){return{...super.exportJSON(),skillName:this.__skillName,skillLabel:this.__skillLabel,...this.__skillDescription?{skillDescription:this.__skillDescription}:{},type:"composer-skill",version:1}}createDOM(){let t=document.createElement("span");return t.className=hr,t}updateDOM(){return!1}getTextContent(){return`$${this.__skillName}`}isInline(){return!0}decorate(){return c(Mj,{skillLabel:this.__skillLabel,skillDescription:this.__skillDescription})}};function Ux(e,t,n){return xs(new fd(e,t,n))}function Aj(e){return c(WN,{context:e.context})}var jr=class e extends So{__context;static getType(){return"composer-terminal-context"}static clone(t){return new e(t.__context,t.__key)}static importJSON(t){return Kx(t.context)}constructor(t,n){super(n),this.__context=t}exportJSON(){return{...super.exportJSON(),context:this.__context,type:"composer-terminal-context",version:1}}createDOM(){let t=document.createElement("span");return t.className=hr,t}updateDOM(){return!1}getTextContent(){return ra}isInline(){return!0}decorate(){return c(Aj,{context:this.__context})}};function Kx(e){return xs(new jr(e))}function Lr(e){return e instanceof Li||e instanceof fd||e instanceof jr||Eg(e)}function Nj(){return document.documentElement.classList.contains("dark")?"dark":"light"}function Gu(e,t){return Number.isFinite(t)?Math.max(0,Math.min(e.length,Math.floor(t))):e.length}function Dg(e){return Eg(e)?e.getTextContentSize():1}function YN(e){return e.getTextContentSize()}function _j(e,t,n){return t+(n>0?Dg(e):0)}function Dj(e,t,n){return t+(n>0?YN(e):0)}function Oj(e,t){let n=e.getParent();if(!n||!Ze(n))return null;let o=e.getIndexWithinParent();return t.value===0?{key:n.getKey(),offset:o,type:"element"}:t.value===Dg(e)?{key:n.getKey(),offset:o+1,type:"element"}:(t.value-=Dg(e),null)}function Og(e){return Lr(e)?Dg(e):mt(e)?e.getTextContentSize():td(e)?1:Ze(e)?e.getChildren().reduce((t,n)=>t+Og(n),0):0}function $x(e){return Lr(e)?YN(e):mt(e)?e.getTextContentSize():td(e)?1:Ze(e)?e.getChildren().reduce((t,n)=>t+$x(n),0):0}function md(e,t){let n=0,o=e;for(;o;){let r=o.getParent();if(!r||!Ze(r))break;let a=r.getChildren(),s=o.getIndexWithinParent();for(let i=0;i<s;i+=1){let l=a[i];l&&(n+=Og(l))}o=r}if(mt(e))return n+Math.min(t,e.getTextContentSize());if(Lr(e))return _j(e,n,t);if(td(e))return n+Math.min(t,1);if(Ze(e)){let r=e.getChildren(),a=Math.max(0,Math.min(t,r.length));for(let s=0;s<a;s+=1){let i=r[s];i&&(n+=Og(i))}return n}return n}function Wu(e,t){let n=0,o=e;for(;o;){let r=o.getParent();if(!r||!Ze(r))break;let a=r.getChildren(),s=o.getIndexWithinParent();for(let i=0;i<s;i+=1){let l=a[i];l&&(n+=$x(l))}o=r}if(mt(e))return n+Math.min(t,e.getTextContentSize());if(Lr(e))return Dj(e,n,t);if(td(e))return n+Math.min(t,1);if(Ze(e)){let r=e.getChildren(),a=Math.max(0,Math.min(t,r.length));for(let s=0;s<a;s+=1){let i=r[s];i&&(n+=$x(i))}return n}return n}function Fg(e,t){if(Lr(e))return Oj(e,t);if(mt(e)){let n=e.getTextContentSize();return t.value<=n?{key:e.getKey(),offset:t.value,type:"text"}:(t.value-=n,null)}if(td(e)){let n=e.getParent();if(!n)return null;let o=e.getIndexWithinParent();return t.value===0?{key:n.getKey(),offset:o,type:"element"}:t.value===1?{key:n.getKey(),offset:o+1,type:"element"}:(t.value-=1,null)}if(Ze(e)){let n=e.getChildren();for(let o of n){let r=Fg(o,t);if(r)return r}if(t.value===0)return{key:e.getKey(),offset:n.length,type:"element"}}return null}function ju(){return St().getChildren().reduce((n,o)=>n+Og(o),0)}function Pa(e){let t=St(),n=ju(),r={value:Math.max(0,Math.min(e,n))},a=Fg(t,r)??{key:t.getKey(),offset:t.getChildren().length,type:"element"},s=xi();s.anchor.set(a.key,a.offset,a.type),s.focus.set(a.key,a.offset,a.type),ar(s)}function gd(e,t){let n=St(),o=ju(),r=Math.max(0,Math.min(e,o)),a=Math.max(0,Math.min(t,o)),s={value:r},i={value:a},l=Fg(n,s)??{key:n.getKey(),offset:n.getChildren().length,type:"element"},d=Fg(n,i)??{key:n.getKey(),offset:n.getChildren().length,type:"element"},u=xi();u.anchor.set(l.key,l.offset,l.type),u.focus.set(d.key,d.offset,d.type),ar(u)}function qx(e){if(!Me(e))return null;let t=e.anchor.getNode(),n=e.focus.getNode(),o=Wu(t,e.anchor.offset),r=Wu(n,e.focus.offset);return{start:Math.min(o,r),end:Math.max(o,r)}}function Vx(e){return Me(e)?e.getNodes().some(t=>Lr(t)):!1}function Mi(e){let t=Fe();if(!Me(t)||!t.isCollapsed())return e;let n=t.anchor.getNode(),o=md(n,t.anchor.offset),r=ju();return Math.max(0,Math.min(o,r))}function Wx(e){let t=Fe();if(!Me(t)||!t.isCollapsed())return e;let n=t.anchor.getNode(),o=Wu(n,t.anchor.offset),r=St().getTextContent().length;return Math.max(0,Math.min(o,r))}function Bg(e){let t=Fe();return Me(t)?{anchor:md(t.anchor.getNode(),t.anchor.offset),focus:md(t.focus.getNode(),t.focus.offset)}:e}function QN(e,t){let n=t.split(`
3802
3802
  `);for(let o=0;o<n.length;o+=1){let r=n[o]??"";r.length>0&&e.append(kr(r)),o<n.length-1&&e.append(Ci())}}function Fj(e,t,n){let o=0;for(let r of n?.collect(t)??[])QN(e,t.slice(o,r.start)),e.append(r.createNode()),o=r.end;QN(e,t.slice(o))}function Qu(e,t,n,o){let r=St();r.clear();let a=rr();r.append(a);let s=Ta(e,t);for(let i of s){if(i.type==="mention"){a.append(Vu(i.path,i.source));continue}if(i.type==="skill"){let l=n.get(i.name);a.append(Ux(i.name,l?.label??Ko({name:i.name}),l?.description??null));continue}if(i.type==="terminal-context"){i.context&&a.append(Kx(i.context));continue}Fj(a,i.text,o)}}function zg(e){return e instanceof jr?[e.__context.id]:Ze(e)?e.getChildren().flatMap(t=>zg(t)):[]}V();function hd(e){return/mac|iphone|ipad|ipod/i.test(e)}function Ai(){let e=globalThis.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n of e)t+=n.toString(16).padStart(2,"0");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function XN(e,t){return e.registerCommand(ng,n=>{if(!(n instanceof ClipboardEvent)||n.clipboardData===null||n.clipboardData.files.length>0)return!1;let o=n.clipboardData.getData("text/plain");if(o.length===0)return!1;let r=t.readLinkChips?.()?.collect(o)??[],a=$u(`${o}
@@ -3810,7 +3810,7 @@ ${H.prompt}`:H.prompt,se=X!==J;if(se&&(r.current=X,d(l,X),a.current?.syncCursor(
3810
3810
  `,s=[...n.map(i=>`-${i}`),...o.map(i=>`+${i}`)];return`${r}${a}${s.join(`
3811
3811
  `)}
3812
3812
  `}function l2(e){if(e.length===0)return[];let t=e.split(`
3813
- `);return t.at(-1)===""?t.slice(0,-1):t}function m2(e){let t=new Map;return e.map(n=>{let o=t.get(n.path)??0;return t.set(n.path,o+1),o===0?n.path:`${n.path}#${o}`})}function g2(e){return{additions:e.additions??0,deletions:e.deletions??0}}V();V();var jNe=(()=>{try{return!1}catch{return!1}})(),h2=/(?=^From [a-f0-9]+ .+$)/m,hS=/(?=^diff --git)/gm;var v2=/^(---|\+\+\+)\s+([^\t\r\n]+)/,y2=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,C2=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,x2=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;var YY={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},QNe={...YY,hunkLineCount:1};var YNe=Object.freeze({fromStart:0,fromEnd:0});function vS(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var XY=new TextEncoder,JY=new TextDecoder("utf-8",{ignoreBOM:!0}),ZY=/[\uD800-\uDFFF]/,yS=1024,Nd=new Uint8Array(yS);function b2(){Nd.length!==yS&&(Nd=new Uint8Array(yS))}function mn(e){if(e.length===0)return e;if(ZY.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Nd.length<t&&(Nd=new Uint8Array(t));let{written:n}=XY.encodeInto(e,Nd);return JY.decode(Nd.subarray(0,n))}function I2(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let o=t.hunkContent[n];if(o.type!=="change")continue;let r=tX(e,o);r!=null&&(t.hunkContent.splice(n,1,...r),n+=r.length-1)}eX(t,e)}}function eX(e,t){let{hunkContent:n}=e;for(let o=1;o<n.length;o++){let r=n[o],a=n[o-1];if(r.type!=="change"||r.additions>0&&r.deletions>0||a.type!=="context")continue;let s=r.additions>0,i=s?t.additionLines:t.deletionLines,l=s?r.additionLineIndex:r.deletionLineIndex,d=s?r.additions:r.deletions,u=i[l]??"";if(u.trim()!=="")continue;let p=!0;for(let v=1;v<d;v++)if(i[l+v]!==u){p=!1;break}if(!p)continue;let f=0;for(;f<a.lines&&t.additionLines[a.additionLineIndex+a.lines-1-f]===u;)f++;if(f===0)continue;r.additionLineIndex-=f,r.deletionLineIndex-=f;let m=r.additionLineIndex+r.additions,g=r.deletionLineIndex+r.deletions,h=n[o+1];h?.type==="context"?(h.lines+=f,h.additionLineIndex=m,h.deletionLineIndex=g):n.splice(o+1,0,{type:"context",lines:f,additionLineIndex:m,deletionLineIndex:g}),a.lines-=f,a.lines===0&&(n.splice(o-1,1),o--)}}function tX(e,t){let{deletions:n,additions:o,deletionLineIndex:r,additionLineIndex:a}=t,s=Math.min(n,o),i=Math.abs(o-n);if(s===0||i===0||s*(i+1)>4096)return null;let l=[];for(let h=0;h<n;h++)l.push(S2(e.deletionLines[r+h]??""));let d=[];for(let h=0;h<o;h++)d.push(S2(e.additionLines[a+h]??""));let u=o>n,p=0,f=-1;for(let h=0;h<=i;h++){let v=0;for(let C=0;C<s;C++)v+=oX(l[C+(u?0:h)],d[C+(u?h:0)]);h===0?f=v+s*.5:v>f&&(f=v,p=h)}if(p===0)return null;let m=[],g=(h,v,C,y)=>{(h>0||v>0)&&m.push({type:"change",deletions:h,additions:v,deletionLineIndex:C,additionLineIndex:y})};return u?(g(0,p,r,a),g(s,s,r,a+p),g(0,o-s-p,r+s,a+p+s)):(g(p,0,r,a),g(s,s,r+p,a),g(n-s-p,0,r+p+s,a+s)),m}var nX=/\s+/g;function S2(e){return e.replace(nX,"")}function oX(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),o=Math.min(e.length,t.length);if(o===0)return 0;let r=0;for(;r<o&&e[r]===t[r];)r++;let a=0;for(;a<o-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return(r+a)/n}function rX(e,t,n){try{return aX(e,t,n)}finally{b2()}}function aX(e,t,n=!1){let o=mX(e),r=o?lX(e):dX(e),a,s=[];for(let i of r){if(o&&!hS.test(i)){if(a==null)a=mn(i);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",i)}continue}else if(!o&&!cX(i)){if(a==null)a=mn(i);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",i)}continue}let l=sX(i,{cacheKey:t!=null?`${t}-${s.length}`:void 0,isGitDiff:o,throwOnError:n});l!=null&&s.push(l)}return{patchMetadata:a,files:s}}function sX(e,{cacheKey:t,isGitDiff:n=hS.test(e),oldFile:o,newFile:r,throwOnError:a=!1}={}){let s=0,i=A2(e,"@@ "),l,d=o==null||r==null,u=0,p=0;for(let f of i){let m=L2(f),g=m[0];if(g==null){if(a)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",f);continue}let h=M2(g),v=0,C=0;if(h==null||l==null){if(l!=null){if(a)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",f);continue}l={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&o!=null&&r!=null?w2(r.contents):[],deletionLines:!d&&o!=null&&r!=null?w2(o.contents):[],cacheKey:P2(t)},l.additionLines.length===1&&r?.contents===""&&(l.additionLines.length=0),l.deletionLines.length===1&&o?.contents===""&&(l.deletionLines.length=0);for(let T of m){if(T.startsWith("diff --git")){let E=T.trim().match(C2),D=E?.[1]??E?.[2],L=E?.[3]??E?.[4];if(D==null||L==null){if(a)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",T);continue}l.name=mn(L.trim()),D!==L&&(l.prevName=mn(D.trim()));continue}let R=T.startsWith("---")||T.startsWith("+++")?T.match(n?y2:v2):null;if(R!=null){let[,E,D]=R;if(E==="---"&&D!=="/dev/null"){let L=mn(D.trim());l.prevName=L,l.name=L}else E==="+++"&&D!=="/dev/null"&&(l.name=mn(D.trim()))}else if(n){if(T.startsWith("new mode ")&&(l.mode=mn(T.slice(8).trim())),T.startsWith("old mode ")&&(l.prevMode=mn(T.slice(8).trim())),T.startsWith("new file mode")&&(l.type="new",l.mode=mn(T.slice(13).trim())),T.startsWith("deleted file mode")&&(l.type="deleted",l.mode=mn(T.slice(17).trim())),T.startsWith("similarity index")&&(T.startsWith("similarity index 100%")?l.type="rename-pure":l.type="rename-changed"),T.startsWith("index ")){let[,E,D,L]=T.trim().match(x2)??[];E!=null&&(l.prevObjectId=mn(E)),D!=null&&(l.newObjectId=mn(D)),L!=null&&(l.mode=mn(L))}T.startsWith("rename from ")&&(l.prevName=mn(T.slice(12).trim())),T.startsWith("rename to ")&&(l.name=mn(T.slice(10).trim()))}}continue}let y,x;for(;m.length>0&&(m[m.length-1]===`
3813
+ `);return t.at(-1)===""?t.slice(0,-1):t}function m2(e){let t=new Map;return e.map(n=>{let o=t.get(n.path)??0;return t.set(n.path,o+1),o===0?n.path:`${n.path}#${o}`})}function g2(e){return{additions:e.additions??0,deletions:e.deletions??0}}V();V();var YNe=(()=>{try{return!1}catch{return!1}})(),h2=/(?=^From [a-f0-9]+ .+$)/m,hS=/(?=^diff --git)/gm;var v2=/^(---|\+\+\+)\s+([^\t\r\n]+)/,y2=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,C2=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,x2=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;var YY={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},XNe={...YY,hunkLineCount:1};var JNe=Object.freeze({fromStart:0,fromEnd:0});function vS(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var XY=new TextEncoder,JY=new TextDecoder("utf-8",{ignoreBOM:!0}),ZY=/[\uD800-\uDFFF]/,yS=1024,Nd=new Uint8Array(yS);function b2(){Nd.length!==yS&&(Nd=new Uint8Array(yS))}function mn(e){if(e.length===0)return e;if(ZY.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Nd.length<t&&(Nd=new Uint8Array(t));let{written:n}=XY.encodeInto(e,Nd);return JY.decode(Nd.subarray(0,n))}function I2(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let o=t.hunkContent[n];if(o.type!=="change")continue;let r=tX(e,o);r!=null&&(t.hunkContent.splice(n,1,...r),n+=r.length-1)}eX(t,e)}}function eX(e,t){let{hunkContent:n}=e;for(let o=1;o<n.length;o++){let r=n[o],a=n[o-1];if(r.type!=="change"||r.additions>0&&r.deletions>0||a.type!=="context")continue;let s=r.additions>0,i=s?t.additionLines:t.deletionLines,l=s?r.additionLineIndex:r.deletionLineIndex,d=s?r.additions:r.deletions,u=i[l]??"";if(u.trim()!=="")continue;let p=!0;for(let v=1;v<d;v++)if(i[l+v]!==u){p=!1;break}if(!p)continue;let f=0;for(;f<a.lines&&t.additionLines[a.additionLineIndex+a.lines-1-f]===u;)f++;if(f===0)continue;r.additionLineIndex-=f,r.deletionLineIndex-=f;let m=r.additionLineIndex+r.additions,g=r.deletionLineIndex+r.deletions,h=n[o+1];h?.type==="context"?(h.lines+=f,h.additionLineIndex=m,h.deletionLineIndex=g):n.splice(o+1,0,{type:"context",lines:f,additionLineIndex:m,deletionLineIndex:g}),a.lines-=f,a.lines===0&&(n.splice(o-1,1),o--)}}function tX(e,t){let{deletions:n,additions:o,deletionLineIndex:r,additionLineIndex:a}=t,s=Math.min(n,o),i=Math.abs(o-n);if(s===0||i===0||s*(i+1)>4096)return null;let l=[];for(let h=0;h<n;h++)l.push(S2(e.deletionLines[r+h]??""));let d=[];for(let h=0;h<o;h++)d.push(S2(e.additionLines[a+h]??""));let u=o>n,p=0,f=-1;for(let h=0;h<=i;h++){let v=0;for(let C=0;C<s;C++)v+=oX(l[C+(u?0:h)],d[C+(u?h:0)]);h===0?f=v+s*.5:v>f&&(f=v,p=h)}if(p===0)return null;let m=[],g=(h,v,C,y)=>{(h>0||v>0)&&m.push({type:"change",deletions:h,additions:v,deletionLineIndex:C,additionLineIndex:y})};return u?(g(0,p,r,a),g(s,s,r,a+p),g(0,o-s-p,r+s,a+p+s)):(g(p,0,r,a),g(s,s,r+p,a),g(n-s-p,0,r+p+s,a+s)),m}var nX=/\s+/g;function S2(e){return e.replace(nX,"")}function oX(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),o=Math.min(e.length,t.length);if(o===0)return 0;let r=0;for(;r<o&&e[r]===t[r];)r++;let a=0;for(;a<o-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return(r+a)/n}function rX(e,t,n){try{return aX(e,t,n)}finally{b2()}}function aX(e,t,n=!1){let o=mX(e),r=o?lX(e):dX(e),a,s=[];for(let i of r){if(o&&!hS.test(i)){if(a==null)a=mn(i);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",i)}continue}else if(!o&&!cX(i)){if(a==null)a=mn(i);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",i)}continue}let l=sX(i,{cacheKey:t!=null?`${t}-${s.length}`:void 0,isGitDiff:o,throwOnError:n});l!=null&&s.push(l)}return{patchMetadata:a,files:s}}function sX(e,{cacheKey:t,isGitDiff:n=hS.test(e),oldFile:o,newFile:r,throwOnError:a=!1}={}){let s=0,i=A2(e,"@@ "),l,d=o==null||r==null,u=0,p=0;for(let f of i){let m=L2(f),g=m[0];if(g==null){if(a)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",f);continue}let h=M2(g),v=0,C=0;if(h==null||l==null){if(l!=null){if(a)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",f);continue}l={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&o!=null&&r!=null?w2(r.contents):[],deletionLines:!d&&o!=null&&r!=null?w2(o.contents):[],cacheKey:P2(t)},l.additionLines.length===1&&r?.contents===""&&(l.additionLines.length=0),l.deletionLines.length===1&&o?.contents===""&&(l.deletionLines.length=0);for(let T of m){if(T.startsWith("diff --git")){let E=T.trim().match(C2),D=E?.[1]??E?.[2],L=E?.[3]??E?.[4];if(D==null||L==null){if(a)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",T);continue}l.name=mn(L.trim()),D!==L&&(l.prevName=mn(D.trim()));continue}let R=T.startsWith("---")||T.startsWith("+++")?T.match(n?y2:v2):null;if(R!=null){let[,E,D]=R;if(E==="---"&&D!=="/dev/null"){let L=mn(D.trim());l.prevName=L,l.name=L}else E==="+++"&&D!=="/dev/null"&&(l.name=mn(D.trim()))}else if(n){if(T.startsWith("new mode ")&&(l.mode=mn(T.slice(8).trim())),T.startsWith("old mode ")&&(l.prevMode=mn(T.slice(8).trim())),T.startsWith("new file mode")&&(l.type="new",l.mode=mn(T.slice(13).trim())),T.startsWith("deleted file mode")&&(l.type="deleted",l.mode=mn(T.slice(17).trim())),T.startsWith("similarity index")&&(T.startsWith("similarity index 100%")?l.type="rename-pure":l.type="rename-changed"),T.startsWith("index ")){let[,E,D,L]=T.trim().match(x2)??[];E!=null&&(l.prevObjectId=mn(E)),D!=null&&(l.newObjectId=mn(D)),L!=null&&(l.mode=mn(L))}T.startsWith("rename from ")&&(l.prevName=mn(T.slice(12).trim())),T.startsWith("rename to ")&&(l.name=mn(T.slice(10).trim()))}}continue}let y,x;for(;m.length>0&&(m[m.length-1]===`
3814
3814
  `||m[m.length-1]==="\r"||m[m.length-1]===`\r
3815
3815
  `||m[m.length-1]==="");)m.pop();let{additionStart:w,deletionStart:I}=h;u=d?u:I-1,p=d?p:w-1;let S={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:h.additionCount,additionStart:w,additionLines:v,deletionCount:h.deletionCount,deletionStart:I,deletionLines:C,deletionLineIndex:u,additionLineIndex:p,hunkContent:[],hunkContext:P2(h.hunkContext),hunkSpecs:mn(g),noEOFCRAdditions:!1,noEOFCRDeletions:!1},k=0,P=0;for(let T=1;T<m.length;T++){let R=m[T];if(k>=S.additionCount&&P>=S.deletionCount&&!R.startsWith("\\")){if(a&&uX(R)&&!pX(R))throw Error("parsePatchContent: hunk has more lines than expected");break}let E=R[0];if(E!=="+"&&E!=="-"&&E!==" "&&E!=="\\"){if(a)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${E}", full line: "${R}"`),console.error("processFile: invalid rawLine:",R);continue}let D=gX(E);if(D==="addition"){if(a&&k>=S.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");let L=CS(R);(y==null||y.type!=="change")&&(y=xS("change",u,p),S.hunkContent.push(y)),p++,k++,d&&l.additionLines.push(L),y.additions++,v++,x="addition"}else if(D==="deletion"){if(a&&P>=S.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");let L=CS(R);(y==null||y.type!=="change")&&(y=xS("change",u,p),S.hunkContent.push(y)),u++,P++,d&&l.deletionLines.push(L),y.deletions++,C++,x="deletion"}else if(D==="context"){if(a&&(P>=S.deletionCount||k>=S.additionCount))throw Error("parsePatchContent: hunk has too many context lines");let L=CS(R);(y==null||y.type!=="context")&&(y=xS("context",u,p),S.hunkContent.push(y)),p++,u++,k++,P++,d&&(l.deletionLines.push(L),l.additionLines.push(L)),y.lines++,x="context"}else if(D==="metadata"&&y!=null){if(y.type==="context"?(S.noEOFCRAdditions=!0,S.noEOFCRDeletions=!0):x==="deletion"?S.noEOFCRDeletions=!0:x==="addition"&&(S.noEOFCRAdditions=!0),d&&(x==="addition"||x==="context")){let L=l.additionLines.length-1;L>=0&&(l.additionLines[L]=vS(l.additionLines[L]))}if(d&&(x==="deletion"||x==="context")){let L=l.deletionLines.length-1;L>=0&&(l.deletionLines[L]=vS(l.deletionLines[L]))}}}if(a&&(k!==S.additionCount||P!==S.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");S.additionLines=v,S.deletionLines=C,S.collapsedBefore=Math.max(S.additionStart-1-s,0),l.hunks.push(S),s=S.additionStart+S.additionCount-1;for(let T of S.hunkContent)T.type==="context"?(S.splitLineCount+=T.lines,S.unifiedLineCount+=T.lines):(S.splitLineCount+=Math.max(T.additions,T.deletions),S.unifiedLineCount+=T.deletions+T.additions);S.splitLineStart=l.splitLineCount+S.collapsedBefore,S.unifiedLineStart=l.unifiedLineCount+S.collapsedBefore,l.splitLineCount+=S.collapsedBefore+S.splitLineCount,l.unifiedLineCount+=S.collapsedBefore+S.unifiedLineCount}if(l!=null){if(a&&d&&!n&&l.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(l.hunks.length>0&&!d&&l.additionLines.length>0&&l.deletionLines.length>0){let f=l.hunks[l.hunks.length-1],m=f.additionStart+f.additionCount-1,g=l.additionLines.length,h=Math.max(g-m,0);l.splitLineCount+=h,l.unifiedLineCount+=h}return n||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type="rename-changed":l.type="rename-pure":(o==null||o.contents==="")&&r!=null&&r.contents!==""?l.type="new":o!=null&&o.contents!==""&&(r==null||r.contents==="")&&(l.type="deleted")),l.type!=="rename-pure"&&l.type!=="rename-changed"&&(l.prevName=void 0),I2(l),l}}function R2(e,t,n=!1){let o=[],r=iX(e)?e.split(h2):[e];for(let a of r)try{o.push(rX(a,t!=null?`${t}-${o.length}`:void 0,n))}catch(s){if(n)throw s;console.error(s)}return o}function iX(e){return e.startsWith("From ")||e.includes(`
3816
3816
  From `)}function w2(e){let t=L2(e);for(let n=0;n<t.length;n++)t[n]=mn(t[n]);return t}function L2(e){if(e.length===0)return[""];let t=[],n=0;for(;;){let o=e.indexOf(`
@@ -3823,7 +3823,7 @@ From `)}function w2(e){let t=L2(e);for(let n=0;n<t.length;n++)t[n]=mn(t[n]);retu
3823
3823
  diff --git`)}function A2(e,t){if(e.length===0)return[""];let n=`
3824
3824
  ${t}`,o=e.startsWith(t)?0:k2(e,n,0);if(o===-1)return[e];let r=[];o>0&&r.push(e.slice(0,o));let a=o;for(;;){let s=k2(e,n,a+1);if(s===-1)break;r.push(e.slice(a,s)),a=s}return r.push(e.slice(a)),r}function k2(e,t,n){let o=e.indexOf(t,n);return o===-1?-1:o+1}function P2(e){return e==null?e:mn(e)}function gX(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function CS(e){let t=e.slice(1);return mn(t===""?`
3825
3825
  `:t)}function xS(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}var N2={light:"vscode-light-modern",dark:"vscode-dark-modern"};function D2(e){return e==="dark"?N2.dark:N2.light}var O2=2166136261,F2=16777619,hX=2654435769,vX=2246822507;function _2(e,t=O2,n=F2){let o=t>>>0;for(let r=0;r<e.length;r+=1)o^=e.charCodeAt(r),o=Math.imul(o,n)>>>0;return o>>>0}function yX(e,t="diff-panel"){let n=e.trim(),o=_2(n,O2,F2).toString(36),r=_2(n,hX,vX).toString(36);return`${t}:${n.length}:${o}:${r}`}function SS(e){if(!e.isPartial)return e;let t=0,n=0,o=e.hunks.map(r=>{let a={...r,splitLineStart:t,unifiedLineStart:n};return t+=r.splitLineCount,n+=r.unifiedLineCount,a});return{...e,hunks:o,splitLineCount:t,unifiedLineCount:n,...e.cacheKey?{cacheKey:`${e.cacheKey}:compact-partial`}:{}}}function B2(e,t="diff-panel",n={}){if(!e)return null;let o=e.trim();if(o.length===0)return null;try{let a=R2(o,yX(o,t)).flatMap(s=>n.compactPartialHunkOffsets?s.files.map(SS):s.files);return a.length>0?{kind:"files",files:a}:{kind:"raw",text:o,reason:"Unsupported diff format. Showing raw patch."}}catch{return{kind:"raw",text:o,reason:"Failed to parse patch. Showing raw patch."}}}function z2(e){let t=e.cacheKey;return t?t.endsWith(":hydrated")?t.slice(0,-9):t:`${e.prevName??"none"}:${e.name}`}function H2({fileChange:e,onOpenDiff:t}){let{t:n}=Q(),[o,r]=W(!1),a=K(()=>f2(e),[e]),s=g2(e);return b("div",{className:"min-w-0",children:[b("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[c("span",{className:"min-w-0 shrink truncate font-mono text-ui-sm text-foreground/85",children:e.path}),c("span",{className:"shrink-0 font-mono text-ui-sm text-muted-foreground tabular-nums",children:n("approval.diff.stat",{additions:s.additions,deletions:s.deletions})}),a===null?c("span",{className:"text-ui-sm text-muted-foreground",children:e.omitted==="too-large"?n("approval.diff.tooLarge"):n("approval.diff.unavailable")}):b(Y,{size:"micro",variant:"ghost-muted",className:"font-normal","aria-expanded":o,onClick:()=>r(i=>!i),children:[o?c(qt,{className:"size-3 shrink-0"}):c(yn,{className:"size-3 shrink-0"}),c("span",{children:n(o?"approval.diff.hide":"approval.diff.show")})]}),t?c(Y,{size:"micro",variant:"ghost-muted",className:"font-normal",onClick:()=>t(e.path),children:n("approval.diff.open")}):null]}),o&&a!==null?c(CX,{path:e.path,unifiedDiff:a}):null]})}function CX({path:e,unifiedDiff:t}){let n=Rt().theme.useResolvedTheme(),o=K(()=>{let r=B2(t,`approval:${n}`,{compactPartialHunkOffsets:!0});return r?.kind==="files"?r.files.map(a=>({id:z2(SS(a)),type:"diff",fileDiff:a,collapsed:!1})):[]},[n,t]);return o.length===0?c("pre",{"aria-label":e,className:"mt-1 max-h-56 overflow-auto rounded-md border border-border/60 bg-background/60 p-2 font-mono text-ui-sm leading-relaxed text-muted-foreground/90 [scrollbar-width:thin]",tabIndex:0,children:t}):c("div",{className:"mt-1 overflow-hidden rounded-md border border-border/60",children:c(FI,{className:"max-h-56 overflow-auto [scrollbar-gutter:stable]",items:o,options:{diffStyle:"unified",lineDiffType:"none",overflow:"wrap",theme:D2(n),themeType:n,stickyHeaders:!1}})})}var xX="block max-h-20 min-w-0 overflow-auto whitespace-pre font-mono text-ui-sm text-foreground/85 [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5",U2=de(function({approval:t,pendingCount:n,onOpenDiff:o,actions:r,className:a}){let{t:s}=Q(),i=d2(t),{body:l}=i,d=m2(i.fileChanges);return c(Hp,{state:"pending",className:a,title:c2(i,s),meta:n>1?`1/${n}`:void 0,actions:r,children:b("div",{"aria-label":u2(i.kind,s),className:"flex min-w-0 flex-col gap-1",role:"group",children:[l.shape==="none"?null:c("code",{"aria-label":p2(l.shape,s),className:G(xX,l.shape==="path"||l.shape==="url"?"truncate":null),"data-approval-detail":"complete",tabIndex:0,children:l.shape==="command"?l.command:l.shape==="path"?l.path:l.shape==="url"?l.url:l.shape==="query"?l.query:l.text}),i.description===null?null:c("span",{className:"min-w-0 text-ui-sm text-muted-foreground",children:i.description}),i.fileChanges.map((u,p)=>c(H2,{fileChange:u,onOpenDiff:o},d[p])),i.args.length===0?null:b("details",{className:"min-w-0","data-approval-args":"true",children:[c("summary",{className:"cursor-[var(--control-cursor)] text-ui-sm text-muted-foreground",children:s("approval.body.detailsSummary")}),c("dl",{"aria-label":s("approval.body.argumentsLabel"),className:"mt-1 grid max-h-32 min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5 overflow-auto rounded-md border border-border/60 bg-background/60 p-2 text-ui-sm [scrollbar-width:thin]",tabIndex:0,children:i.args.map(u=>b("div",{className:"col-span-2 grid grid-cols-subgrid",children:[c("dt",{className:"font-mono text-muted-foreground",children:u.name}),c("dd",{className:"min-w-0 font-mono whitespace-pre-wrap wrap-break-word text-foreground/85",children:u.value})]},u.name))})]})]})})});var mp=de(function(t){return c(U2,{...t})});V();var gp=de(function(t){let{t:n}=Q(),[o,r]=W(!1),[a,s]=W(!1),i=t.decision,l=i.requestId;if(l===null)return null;let d=p=>p.key===void 0?p.text:n(p.key,{...p.params,defaultValue:p.text}),u=i.askedBy.kind==="plugin"?i.askedBy.pluginId:null;return b("div",{className:G("flex min-w-0 flex-col gap-1 px-3 py-1.5 sm:px-4",t.className),"data-composer-pending-decision":"true",children:[b("div",{className:"flex min-w-0 items-baseline gap-2",children:[c("span",{className:"min-w-0 flex-1 truncate text-ui-sm font-medium text-foreground",children:d(i.title)}),u===null?null:c("span",{className:"shrink-0 font-mono text-ui-2xs text-muted-foreground",children:u})]}),i.body.map((p,f)=>c("span",{className:"min-w-0 text-ui-sm text-muted-foreground",children:d(p)},`${String(f)}:${p.key??p.text}`)),i.detail===null?null:c("button",{type:"button",className:"min-w-0 truncate text-left font-mono text-ui-sm text-muted-foreground",onClick:()=>r(p=>!p),children:o?i.detail.text.slice(0,4e3):i.detail.text.split(`
3826
- `)[0]}),c("div",{className:"flex min-w-0 flex-wrap items-center gap-1 pt-0.5",children:i.options.map(p=>c(Y,{size:"xs",variant:p.tone==="primary"?"default":p.tone==="danger"?"destructive":"outline",disabled:a,onClick:()=>{s(!0),t.onRespond(l,p.id)},children:d(p.label)},p.id))})]})});function bX(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function IS(e,t){if(t?.attachmentsBlocked)return null;let n=bX(t?.customAnswer);if(e.allowFreeform!==!1&&n)return n;let o=Jx(e,t?.selectedOptionLabels),r=e.allowFreeform!==!1&&(t?.attachmentCount??0)>0;return e.multiSelect?o.length>0?o:r?"":null:o[0]??(r?"":null)}function SX(e,t){let n={};for(let o of e){let r=IS(o,t[o.id]);if(r===null)return null;n[o.id]=r}return n}function IX(e,t){return e.reduce((n,o)=>IS(o,t[o.id])!==null?n+1:n,0)}function K2(e,t,n){let o=e.length===0?0:Math.max(0,Math.min(n,e.length-1)),r=e[o]??null,a=r?t[r.id]:void 0,s=r?IS(r,a):null,i=r?.allowFreeform===!1?"":a?.customAnswer??"",l=IX(e,t),d=e.length===0?!0:o>=e.length-1;return{questionIndex:o,activeQuestion:r,activeDraft:a,selectedOptionLabels:r?Jx(r,a?.selectedOptionLabels):[],customAnswer:i,resolvedAnswer:s,usingCustomAnswer:i.trim().length>0,answeredQuestionCount:l,isLastQuestion:d,isComplete:SX(e,t)!==null,canAdvance:s!==null}}var wX={approve:{label:"pendingUserInput.planApprove",description:"pendingUserInput.planApproveHint"},revise:{label:"pendingUserInput.planRevise",description:"pendingUserInput.planReviseHint"},stop:{label:"pendingUserInput.planStop",description:"pendingUserInput.planStopHint"}};function $2(e,t,n){if(n.displayKind==="acknowledge")return{label:e("pendingUserInput.acknowledge"),description:e("pendingUserInput.continueHint")};let o=t.kind==="plan"&&n.planAction!==void 0?wX[n.planAction]:void 0;return o===void 0?{label:n.label,description:n.description??""}:{label:e(o.label),description:e(o.description)}}V();var Mh=de(function({pendingUserInputs:t,respondingRequestIds:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s,shortcuts:i=!0}){if(t.length===0)return null;let l=t[0];return l?c(TX,{prompt:l,isResponding:n.includes(l.requestId),answers:o,questionIndex:r,onToggleOption:a,onAdvance:s,shortcuts:i},l.requestId):null}),TX=de(function({prompt:t,isResponding:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s,shortcuts:i}){let{t:l}=Q(),d=Rt(),u=K2(t.questions,o,r),p=u.activeQuestion,f=A(null),m=A(s),[g,h]=W(null),[v,C]=W(null),y=v!==null&&v===p?.id;$(()=>{m.current=s},[s]),$(()=>{if(!(!p||p.multiSelect||!g)){if(g.questionId!==p.id){h(null);return}u.customAnswer.trim().length===0&&u.selectedOptionLabels.includes(g.optionLabel)&&h(null)}},[p,g,u.customAnswer,u.selectedOptionLabels]),$(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);let x=M((k,P)=>{if(p?.multiSelect){a(k,P);return}h({questionId:k,optionLabel:P}),a(k,P),f.current!==null&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>{f.current=null,m.current()},200)},[p,a]);if(d.pane.useKeydown(k=>{if(!i||!p||n||y||k.metaKey||k.ctrlKey||k.altKey||k.isComposing||k.keyCode===229||rs(k.target))return;let P=Nv(k.key,p.options.length);if(P===null)return;let T=p.options[P];T&&(k.preventDefault(),x(p.id,xd(T)))},{target:"document"}),!p)return null;let w=u.customAnswer.trim().length>0,I=g?.questionId===p.id?g.optionLabel:null,S=I!==null?[I]:w?[]:u.selectedOptionLabels;return b(Hp,{state:"pending",className:"px-3 py-2 sm:px-4",title:p.header,meta:t.questions.length>1?`${r+1}/${t.questions.length}`:void 0,collapse:{collapsed:y,onCollapsedChange:k=>{C(k?p.id:null)},hint:p.question,toggleLabel:l(y?"pendingUserInput.showQuestion":"pendingUserInput.hideQuestion")},children:[c("div",{className:"max-h-[min(45vh,28rem)] overflow-y-auto overscroll-contain break-words text-chat text-foreground","data-pending-user-input-body":p.kind??"question",tabIndex:0,children:p.kind==="plan"?c(eo,{text:p.question,cwd:void 0,isStreaming:!1}):c("p",{className:"whitespace-pre-wrap font-medium",children:p.question})}),p.multiSelect?c("p",{className:"text-chat-row text-muted-foreground",children:l("pendingUserInput.selectOneOrMore")}):null,c(MI,{mode:p.multiSelect?"multiple":"single","aria-label":p.header,disabled:n,selected:S,onToggle:k=>{x(p.id,k)},onReselect:k=>{x(p.id,k)},options:p.options.map((k,P)=>{let T=$2(l,p,k);return{value:xd(k),label:T.label,...T.description&&T.description!==T.label?{description:T.description}:{},...i&&P<9?{trailing:c(pl,{children:P+1})}:{}}})},p.id)]})});V();var q2=de(function({planTitle:t}){let{t:n}=Q();return c("div",{className:"px-3 py-2 sm:px-4",children:b("div",{className:"flex flex-wrap items-center gap-2",children:[c("span",{className:"text-xs font-medium text-muted-foreground",children:n("plan.ready")}),t?c("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground/85",children:t}):null]})})});function V2(e){if(e.occupant.kind!=="approval")return null;let{approval:t}=e.occupant;return c(Lh,{requestId:t.requestId,isResponding:e.respondingRequestIds.includes(t.requestId),options:t.options,keybindings:e.keybindings,declineReasonRelay:t.declineReasonRelay,onRespondToApproval:e.onRespondToApproval})}function W2(e){return e.occupant.kind!=="user-input"?null:c(Mh,{pendingUserInputs:[e.occupant.userInput],respondingRequestIds:e.respondingRequestIds,answers:e.activePendingDraftAnswers,questionIndex:e.activePendingQuestionIndex,onToggleOption:e.onSelectActivePendingUserInputOption,onAdvance:e.onAdvanceActivePendingUserInput})}var G2={approval:{expanded:e=>e.occupant.kind!=="approval"?null:c(mp,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:V2(e),className:"px-3 py-2 sm:px-4"}),collapsed:e=>e.occupant.kind!=="approval"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(mp,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:V2(e),className:"px-3 pt-2 pb-3 sm:px-4"})})},decision:{expanded:e=>e.occupant.kind!=="decision"?null:c(gp,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision}),collapsed:e=>e.occupant.kind!=="decision"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(gp,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision,className:"pt-2 pb-3"})})},"user-input":{expanded:W2,collapsed:e=>b("div",{"data-chat-composer-collapsed-controls":"true",children:[W2(e),e.collapsedPendingRow]})},"plan-follow-up":{expanded:e=>e.activeProposedPlan===null?null:c(q2,{planTitle:a2(e.activeProposedPlan.planMarkdown)??null},e.activeProposedPlan.id),collapsed:null}};function j2(e,t){let n=G2[e.occupant.kind],o=t?n.collapsed:n.expanded;return o===null?null:o(e)}var rDe=Object.keys(G2);function Q2(e){let{composerOccupant:t,showComposerTopDrawer:n,hasBlockingComposerTopDrawer:o,isTasksDrawerOpen:r,isComposerCollapsedMobile:a,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,badges:y,pendingPrimaryAction:x,isSendBusy:w,sendDisabledReason:I,environmentUnavailable:S,noProviderAvailable:k,projectSelectionRequired:P,previousUserInputQuestion:T,handleInterruptPrimaryAction:R,handleImplementPlanInNewThreadPrimaryAction:E}=e,{inlineTasksBadge:D,inlineStashBadge:L,visibleTasksProgress:O,visibleTaskSteps:U,dismissTasks:F,toggleTasksDrawer:_}=y;return b(Ce,{children:[n&&(!r||o)?c("div",{className:"chat-composer-top-drawer","data-chat-composer-top-drawer":"true","data-variant":t?.kind==="approval"?"warning":"info","data-occupant":t?.kind??"none",children:t===null?null:j2({occupant:t,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,collapsedPendingRow:c(r2,{activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,inlineTasksBadge:D,inlineStashBadge:L,pendingPrimaryAction:x,isSendBusy:w,sendDisabledReason:I,isEnvironmentUnavailable:S!==null||k||P,onPreviousActivePendingUserInputQuestion:T,handleInterruptPrimaryAction:R,handleImplementPlanInNewThreadPrimaryAction:E})},a)}):null,r&&!o&&O&&U?c(xD,{onDismiss:F,onCollapse:_,progress:O,steps:U}):null]})}function Y2(e,t){return{images:e.images,terminalContexts:e.terminalContexts,elementContexts:e.elementContexts,browserAnnotations:e.browserAnnotations,reviewComments:e.reviewComments,nonPersistedImageIds:e.nonPersistedImageIds,activeProvider:e.activeProvider,nativeModeByProvider:e.nativeModeByProvider,selectedPluginActionKey:e.selectedPluginActionKey,promptHasText:e.prompt.trim().length>0,hasSendableContent:t({prompt:e.prompt,imageCount:e.images.length,terminalContexts:e.terminalContexts,elementContextCount:e.elementContexts.length+e.browserAnnotations.length+e.reviewComments.length}).hasSendableContent}}function X2(e){let t=e.draft.useStore;return{setComposerDraftPrompt:t(n=>n.setPrompt),setComposerDraftNativeMode:t(n=>n.setNativeMode),addComposerDraftImage:t(n=>n.addImage),addComposerDraftImages:t(n=>n.addImages),removeComposerDraftImage:t(n=>n.removeImage),insertComposerDraftTerminalContext:t(n=>n.insertTerminalContext),removeComposerDraftElementContext:t(n=>n.removeElementContext),removeComposerDraftBrowserAnnotation:t(n=>n.removeBrowserAnnotation),removeComposerDraftReviewComment:t(n=>n.removeReviewComment),clearComposerDraftPromptAndImages:t(n=>n.clearComposerPromptAndImages)}}V();function J2(e){let{onComposerPaste:t,submitComposer:n,exitShellCommandMode:o}=e,r=A({onComposerPaste:t,submitComposer:n,exitShellCommandMode:o});r.current={onComposerPaste:t,submitComposer:n,exitShellCommandMode:o};let a=M(l=>{r.current.onComposerPaste(l)},[]),s=M((l,d)=>{r.current.submitComposer(l,d)},[]),i=M(()=>r.current.exitShellCommandMode(),[]);return{handleComposerPaste:a,handleComposerSubmit:s,handleUnclaimedEscape:i}}V();var Z2=pt(null);function eB({children:e}){let{data:t,target:n,threadKey:o}=Co(),r=t.useComposerStatus({target:n,threadKey:o});return c(Z2.Provider,{value:r,children:e})}function tB(){let e=Dt(Z2);if(e===null)throw new Error("Composer status has not been provided.");return e}var nB=de(function(t){let n=A_(),{data:o,target:r,threadKey:a}=Co(),{activePendingApproval:s,pendingUserInputs:i,activePendingProgress:l,activePendingResolvedAnswers:d,activePendingIsResponding:u,activePendingDraftAnswers:p,activePendingQuestionIndex:f,questionAttachmentsSupported:m,respondingRequestIds:g,occupants:h,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,changeUserInputCustomAnswer:x,advanceUserInput:w,previousUserInputQuestion:I}=o.useComposerPending({target:r,threadKey:a}),{runtimeMode:S,interactionMode:k,lockedProvider:P,providerStatuses:T,activeProjectDefaultModelSelection:R,projectId:E,activeThreadModelSelection:D,activeThreadActualModel:L}=o.useComposerModelContext(r),{activeThreadId:O,activeThread:U,isLocalDraftThread:F,projectSelectionRequired:_,phase:j,isSendBusy:N,sendDisabledReason:z,groupSendDisabledReason:re,unavailableAgentInstanceId:H=null,noAgentChosen:te=!1,environmentUnavailable:q,compactDisabled:J,compactDisabledReason:X}=tB(),{t:se}=Q(),{composerDraftTarget:ce,environmentId:ee,attachmentUploadsCapabilityKnown:ne,supportsAttachmentUploads:ke,routeKind:xe,routeThreadRef:be,draftId:le,forceExpandedOnMobile:Ie,settings:he,keybindings:ie,terminalOpen:Re,gitCwd:ge,promptRef:pe,composerRef:qe,composerImagesRef:ue,composerTerminalContextsRef:Ue,composerElementContextsRef:Xe,sendContextRef:ht,onSend:Qe,onInterrupt:it,interruptArmed:ae=!1,stopping:Le=!1,onCompactContext:Ae,onImplementPlanInNewThread:Ke,onProviderInstanceSelect:gt,onModelSelectionChosen:Wt,handleRuntimeModeChange:Pt,handleInteractionModeChange:oe,handleNativeModeChange:ye,focusComposer:Ee,setThreadError:Ye}=t,Lt=o.useComposerPlan(r),It=Lt.proposedPlan,dn=Lt.tasksProgress,zt=Lt.taskSteps,lt=i.length===0&&k==="plan"&&It!==null,st=A(null),{pendingPrimaryAction:At,onSelectActivePendingUserInputOption:Gt,onRespondToApproval:Nt,onRespondToComposerDecision:nn,onAdvanceActivePendingUserInput:Zt}=cD({t:se,threadId:r.threadId,setThreadError:Ye,promptRef:pe,promptInputRef:st,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,advanceUserInput:w,activePendingProgress:l,activePendingIsResponding:u,activePendingResolvedAnswers:d}),at=t.api,{limits:en}=t.attachments,Pe=at.draft.useThreadDraftSelector(ce,Mo=>Y2(Mo,at.chat.deriveComposerSendState)),Ve=i[0]??null,{questionAttachmentTarget:ft,attachmentTarget:dt,attachmentDocumentKey:vt}=aD({supported:m,attachments:t.attachments,environmentId:ee,threadId:O,requestId:Ve?.requestId??null,question:l?.activeQuestion??null,responding:u,composerDraftTarget:ce}),wt=at.draft.useThreadDraftSelector(dt,rD),Et=wt.images,Xt=Pe.terminalContexts,cn=Pe.elementContexts,Xn=Pe.browserAnnotations,an=Pe.reviewComments,Wo=wt.nonPersistedImageIds,Hn=at.uploads.useStore(Mo=>Mo.uploadsByImageId),Po=!ne&&Et.length>0?se("attachments.capabilityUnknown"):ke?H_({imageIds:Et.map(Mo=>Mo.id),uploadsByImageId:Hn,environmentId:ee},se):null,{setComposerDraftPrompt:we,setComposerDraftNativeMode:ct,addComposerDraftImage:_t,addComposerDraftImages:yt,removeComposerDraftImage:Sn,insertComposerDraftTerminalContext:gn,removeComposerDraftElementContext:on,removeComposerDraftBrowserAnnotation:rn,removeComposerDraftReviewComment:Un,clearComposerDraftPromptAndImages:sn}=X2(at);$(()=>{if(ne){if(!ke){for(let Mo of Et)at.uploads.release(Mo.id);return}at.draft.restoreAttachments();for(let Mo of Et)at.uploads.start({environmentId:ee,image:Mo})}},[ne,Et,ee,ke]);let Ro=l!==null,Go=UD({api:at,t:se,settings:he,composerDraft:Pe,composerDraftTarget:ce,environmentId:ee,gitCwd:ge,routeKind:xe,threadId:r.threadId,activeThread:U,isLocalDraftThread:F,unavailableAgentInstanceId:H,agentNotChosen:te,runtimeMode:S,lockedProvider:P,providerStatuses:T,projectId:E,activeProjectDefaultModelSelection:R,activeThreadModelSelection:D,actualModel:L,compactDisabledReason:X,externalSendDisabledReason:z,attachmentBlockReason:Po,answeringQuestion:Ro,setComposerDraftNativeMode:ct,handleNativeModeChange:ye,onProviderInstanceSelect:gt,onModelSelectionChosen:Wt}),{selectedInstanceId:Ps,noProviderAvailable:Rs,selectedProvider:Ge,selectedModel:Xr,selectedModelChoice:Jr,sendDisabledReason:Fa,isSendDisabled:qi,setModelSendBlockShown:Ba,isModelSendBlocked:jo}=Go,io=z_(ee,ce),[Zr,ea]=W(!1),[Vi,Dn]=W(null),[ta,Wi]=W(null),[je,Lo]=W(!1),[Gi,ji]=W(!1),[Dd,Qi]=W(null),[za,na]=W({key:0,active:!1}),Yi=A(io);fe(()=>{Yi.current!==io&&(Yi.current=io,ea(!1),Dn(null),Lo(!1),ji(!1),Qi(null),na({key:za.key,active:!1}))},[io,za.key]);let lo=Zf("max-sm"),Qo=A(null),Od=A(null),Ha=A(null),Ls=A(null),Ht=A(new Map),{isComposerCollapsedMobile:Eo,blurMobileComposerAfterSend:vp,expandMobileComposer:Fd,scheduleComposerCollapseCheck:Bh,handleFormFocusCapture:zh}=dD({isMobileViewport:lo,forceExpandedOnMobile:Ie,composerEditorRef:Qo,composerSurfaceRef:Ls,composerFormRef:Ha}),Es=M(()=>{ea(!0)},[]),Hh=M(Mo=>{oe(Mo)},[oe]),Yo=s!==null,ot=l?.activeQuestion?.allowFreeform===!1,Ot=h[0]??null,{showTopDrawer:hn,showCollapsedPromptRow:Jn,hasBlocking:Bd}=B_(Ot?.kind??null,Eo),QB=lt||l!==null,{isComposerFooterCompact:YB,isComposerPrimaryActionsCompact:XB}=$_(Ha,QB),JB=GD({routeKind:xe,routeThreadRef:be,draftId:le,selectedProvider:Ge,selectedInstanceId:Ps,selectedModel:Xr,selectedModelChoice:Jr});$(()=>{Dn(null)},[cn,Xn,an,Xt,Xr,Go.selectedModelOptionsForDispatch,Ge]),lD({composerImages:Et,composerImagesRef:ue,composerTerminalContexts:Xt,composerTerminalContextsRef:Ue,composerElementContexts:cn,composerElementContextsRef:Xe});let ZB=vD({activeThreadId:O,isLocalDraftThread:F,isPluginComposer:Go.isPluginComposer,isComposerApprovalState:Yo,hasPendingProgress:l!==null,hasPendingAction:At!==null,memberMentions:o.memberMentions,target:r,promptRef:pe}),Ms=hD({api:at,t:se,limits:en,composerDraftTarget:ce,composerDraft:Pe,composerDocumentKey:io,promptRef:pe,promptInputRef:st,pendingImageCompressionsRef:Ht,setComposerDraftPrompt:we,setModelSendBlockShown:Ba,onSend:Qe,onCompactContext:Ae,blurMobileComposerAfterSend:vp,isMobileViewport:lo,isComposerApprovalState:Yo,activePendingApproval:s,activePendingProgress:l,activePendingResolvedAnswers:d,pendingUserInputCount:i.length,activeThreadId:O,phase:j,isSendBusy:N,environmentUnavailable:q,compactDisabled:J,noProviderAvailable:Rs,isSendDisabled:qi,sendDisabledReason:Fa,groupSendDisabledReason:re,isGroupSend:ZB,isModelSendBlocked:jo,showPlanFollowUpPrompt:lt}),zd=tD({api:at,t:se,limits:en,promptRef:pe,promptInputRef:st,composerEditorRef:Qo,composerImagesRef:ue,composerDraftTarget:ce,setComposerDraftPrompt:we,addComposerDraftImages:yt,clearComposerDraftPromptAndImages:sn,setIsStashMenuOpen:Lo,setStashPulse:na,isComposerCollapsedMobile:Eo,expandMobileComposer:Fd,keybindings:ie,terminalOpen:Re,isComposerModelPickerOpen:Zr,hasPendingUserInputs:i.length>0,isComposerApprovalState:Yo,projectSelectionRequired:_,answeringQuestion:Ro}),Uh=bD({activeThreadId:O,activeThread:U,activeTasksProgress:dn,activeTaskSteps:zt,isTasksDrawerOpen:Gi,setIsTasksDrawerOpen:ji,dismissedTasksTurnId:Dd,setDismissedTasksTurnId:Qi,stashQueue:zd.stashQueue,isStashMenuOpen:je,stashPulse:za,toggleInlineStashMenu:zd.toggleInlineStashMenu,isComposerApprovalState:Yo,externalDrawerAttached:n,showComposerTopDrawer:hn,isComposerCollapsedMobile:Eo,hasBlockingComposerTopDrawer:Bd}),ez=M(Mo=>{Dn(null),Ms.revalidatePromptLength(Mo),Lo(!1)},[Ms.revalidatePromptLength]),{addComposerImages:NS,removeComposerImage:tz,onComposerAttachmentInputChange:nz}=oD({api:at,t:se,limits:en,setThreadError:Ye,activeThreadId:O,answerQuestionsFirst:i.length>0&&ft===null,attachmentTarget:dt,attachmentDocumentKey:vt,supportsAttachmentUploads:ke,attachmentUploadsCapabilityKnown:ne,pendingImageCompressionsRef:Ht,addComposerDraftImage:_t,addComposerDraftImages:yt,removeComposerDraftImage:Sn}),{onComposerPaste:oz,insertComposerTextAtEnd:rz,addDroppedFolders:az,isDragOverComposer:sz,composerMentionDragHandlers:iz,onComposerMentionDragLeaveCapture:lz}=eD({api:at,t:se,addComposerImages:NS,attachments:t.attachments,promptRef:pe,promptInputRef:st,composerEditorRef:Qo,composerFormRef:Ha,composerThreadKey:a,attachmentDocumentKey:vt,attachmentImagesRef:ue,limits:en,supportsAttachmentUploads:ke,attachmentUploadsCapabilityKnown:ne,composerDocumentKey:io,isComposerApprovalState:Yo,pasteBlocked:i.length>0&&ft===null,hasPendingUserInputs:i.length>0,projectSelectionRequired:_,environmentId:ee}),_S=M(()=>{it()},[it]),DS=M(()=>{Ke()},[Ke]),{handleComposerPaste:dz,handleComposerSubmit:cz,handleUnclaimedEscape:uz}=J2({onComposerPaste:oz,submitComposer:Ms.submitComposerOrShellCommand,exitShellCommandMode:Ms.exitShellCommandMode});return iD({composerRef:qe,sendContextRef:ht,api:at,t:se,limits:en,composerData:o,refs:{composerEditorRef:Qo,promptInputRef:st,promptRef:pe,composerImagesRef:ue,composerTerminalContextsRef:Ue,composerElementContextsRef:Xe},composerDraftTarget:ce,activeThread:U,addComposerImages:NS,addDroppedFolders:az,focusComposer:Ee,insertComposerTextAtEnd:rz,insertComposerDraftTerminalContext:gn,composerBrowserAnnotations:Xn,composerReviewComments:an,isComposerApprovalState:Yo,pendingUserInputCount:i.length,projectSelectionRequired:_,noProviderAvailable:Rs,modelState:Go,handleRuntimeModeChange:Pt,runtimeMode:S,setIsComposerModelPickerOpen:ea,setProviderInputSubmissionError:Dn}),c(o2,{formRef:Ha,onSubmit:Ms.submitComposerOrShellCommand,onFocusCapture:zh,onBlurCapture:Bh,dragHandlers:iz,onDragLeaveCapture:lz,badges:Uh,stashQueueLength:zd.stashQueue.length,isStashMenuOpen:je,stashPulse:za,toggleStashMenu:zd.toggleStashMenu,drawers:c(Q2,{composerOccupant:Ot,showComposerTopDrawer:hn,hasBlockingComposerTopDrawer:Bd,isTasksDrawerOpen:Gi,isComposerCollapsedMobile:Eo,respondingRequestIds:g,keybindings:ie,onRespondToApproval:Nt,onRespondToDecision:nn,activePendingDraftAnswers:p,activePendingQuestionIndex:f,onSelectActivePendingUserInputOption:Gt,onAdvanceActivePendingUserInput:Zt,activeProposedPlan:It,activePendingProgress:l,isPendingUserInputChoiceOnly:ot,expandMobileComposer:Fd,badges:Uh,pendingPrimaryAction:At,isSendBusy:N,sendDisabledReason:Fa,environmentUnavailable:q,noProviderAvailable:Rs,projectSelectionRequired:_,previousUserInputQuestion:I,handleInterruptPrimaryAction:_S,handleImplementPlanInNewThreadPrimaryAction:DS}),children:c(n2,{props:t,composerDraft:Pe,model:Go,traits:JB,submit:Ms,stash:zd,badges:Uh,uploadsByImageId:Hn,composerImages:Et,nonPersistedComposerImageIds:Wo,removeComposerImage:tz,removeComposerDraftBrowserAnnotation:rn,removeComposerDraftReviewComment:Un,removeComposerDraftElementContext:on,onComposerAttachmentInputChange:nz,surfaceRef:Ls,composerAttachmentInputRef:Od,promptInputRef:st,composerEditorRef:Qo,composerMenuAnchor:ta,setComposerMenuAnchor:Wi,composerDocumentKey:io,isComposerCollapsedMobile:Eo,expandMobileComposer:Fd,isDragOverComposer:sz,isComposerApprovalState:Yo,showCollapsedMobilePromptRow:Jn,activePendingProgress:l,pendingUserInputs:i,changeUserInputCustomAnswer:x,pendingPrimaryAction:At,approvalDetail:s?.detail??null,handleComposerPaste:dz,handleComposerSubmit:cz,onPromptEdited:ez,handleUnclaimedEscape:uz,openModelPicker:Es,switchInteractionMode:Hh,providerInputSubmissionError:Vi,isStashMenuOpen:je,isComposerFooterCompact:YB,isComposerPrimaryActionsCompact:XB,isMobileViewport:lo,isComposerModelPickerOpen:Zr,setIsComposerModelPickerOpen:ea,showPlanFollowUpPrompt:lt,compactDisabled:J,compactThreadContext:Ms.compactThreadContext,status:{projectSelectionRequired:_,groupSendDisabledReason:re,isSendBusy:N,environmentUnavailable:q,interruptArmed:ae,stopping:Le,agentNotChosen:te,unavailableAgentInstanceId:H,lockedProvider:P,phase:j,activeThread:U,interactionMode:k,runtimeMode:S},actions:{previousUserInputQuestion:I,handleInterruptPrimaryAction:_S,handleImplementPlanInNewThreadPrimaryAction:DS}})})});function oB(e){let{composerRef:t,...n}=e;return c(pd,{value:n.api,children:c(nB,{...n,composerRef:t})})}function _d({section:e,resetKey:t,children:n}){return c(Tl,{resetKey:t,fallback:o=>kX(e,o),children:n})}function kX(e,t){return c(PX,{section:e,error:t})}function PX({section:e,error:t}){let{t:n}=et();return b("div",{role:"status","data-conversation-section-error":e,className:e==="composer"||e==="queue"?"pointer-events-auto mx-auto flex w-full max-w-3xl items-start gap-2 rounded-lg border border-destructive/30 bg-background px-3 py-2 text-sm":"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",children:[c(Jt,{"aria-hidden":!0,className:"size-4 shrink-0 text-destructive-foreground"}),b("div",{className:"min-w-0",children:[c("p",{className:"font-medium text-foreground",children:n(`timeline.sectionUnavailable.${e}`)}),c("p",{className:"whitespace-pre-wrap break-words text-muted-foreground",children:n("timeline.sectionUnavailableHint",{reason:t.message})})]})]})}function rB({hostVersion:e,scopeClass:t}){let{t:n}=et();return b("div",{role:"status","data-conversation-host-data-mismatch":!0,className:G("flex min-h-0 min-w-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",t),children:[c(Jt,{"aria-hidden":!0,className:"size-5 text-destructive-foreground"}),c("p",{className:"font-medium text-foreground",children:n("timeline.hostDataMismatchTitle")}),c("p",{className:"max-w-md text-muted-foreground",children:n("timeline.hostDataMismatchDescription",{host:e??0,plugin:Kd})})]})}V();function aB(e){let t=Tn();$(()=>{let n=e.current;if(!n)return;let o=r=>{let a=r.detail?.reference;a&&t.openThread({environmentId:a.environmentId,threadId:a.threadId})};return n.addEventListener(Ji,o),()=>n.removeEventListener(Ji,o)},[t,e])}function sB({data:e,target:t,slots:n,children:o}){return c(GI,{data:e,target:t,children:c(Ev,{value:n,children:o})})}function iB(e){let{data:t}=e;return t?.version!==Kd?c(rB,{hostVersion:t?.version??null,scopeClass:e.scopeClass}):c(Mp.Provider,{value:e.scope.active,children:c(EX,{...e,data:t})})}var RX=de(function({threadKey:t,onModeChange:n,summaryContext:o}){let[r]=xt("turn-navigator",t,null),a=M(s=>{n("chat"),r?.onSelect(s)},[n,r]);return r===null?null:c(aw,{...r,placement:"inline",onSelect:a,summaryContext:o})});function LX({slots:e,children:t}){let{data:n,target:o,threadKey:r}=Co(),a=n.useComposerPending({target:o,threadKey:r});return e?.renderSlotChain("conversation.composer",{occupants:a.occupants},t)??t}function EX(e){let{scope:t,mode:n,timeline:o,trajectory:r,composer:a,data:s}=e,[,i]=xt("turn-navigator",t.threadKey,null),l=a.draftHero.active,d=a.sessionActions,u=a.terminalControl,p=a.agentsControl,{mode:f,onModeChange:m}=n,g=K(()=>({data:s,target:{environmentId:t.environmentId,threadId:t.threadId},threadKey:t.threadKey,openTrajectory:()=>m("trajectory"),onOpenFileDiff:o.onOpenFileDiff}),[s,t.environmentId,t.threadId,t.threadKey,m,o.onOpenFileDiff]),h=K(()=>l?b(Ce,{children:[d,c("div",{className:"min-w-0 flex-1"}),u]}):b(Ce,{children:[d,c(KI,{mode:f,onModeChange:m}),c("div",{className:"min-w-0 flex-1"}),u,p,c(RX,{threadKey:t.threadKey,onModeChange:m,summaryContext:g})]}),[l,d,u,p,f,m,t.threadKey,g]),{belowSlot:v,teamDock:C,draftHero:y,onOverlayElementChange:x,sessionActions:w,terminalControl:I,agentsControl:S,contextStrip:k,...P}=a,T=c(oB,{...P,attachments:e.attachments,firstRow:h}),R=K(()=>({environmentId:t.environmentId,threadId:t.threadId}),[t.environmentId,t.threadId]),[E,D]=W(null),L=M(xe=>D(xe?{key:t.threadKey,value:xe}:null),[t.threadKey]),O=E?.key===t.threadKey?E.value:null,[U,F]=xt("trajectory-reveal",t.threadKey,null),_=M(xe=>{n.onModeChange("chat"),F(be=>({rowId:xe,nonce:(be?.nonce??0)+1}))},[n,F]),j=M(()=>F(null),[F]),N=A(null);aB(N);let{t:z}=Q(),re=A(a.api);re.current=a.api;let H=M(xe=>re.current.notify.warning(z(`timeline.quote.${xe}`)),[z]),te=M(()=>re.current.notify.warning(z("forkRelations.messageMissing")),[z]),[q,J]=xt("timeline-quote-reveal",t.threadKey,null);$(()=>{let xe=N.current;if(!xe)return;let be=le=>{let Ie=le.detail?.quote;if(Ie){if(Ie.environmentId!==R.environmentId||Ie.threadId!==R.threadId){H("otherThread");return}n.onModeChange("chat"),J({quote:Ie})}};return xe.addEventListener(wp,be),()=>xe.removeEventListener(wp,be)},[n,J,R.environmentId,R.threadId,H]);let X=M(xe=>{J(null),xe==="message-missing"&&H("messageMissing"),xe==="passage-missing"&&H("passageMissing")},[J,H]),se=K(()=>({data:s,target:R,threadKey:t.threadKey}),[s,R,t.threadKey]),{controlRef:ce,...ee}=o,ne=s.useChatWindow({target:R,threadKey:t.threadKey,visible:t.visible&&n.mode==="chat"}),ke=vk({inputKey:t.threadKey,visible:t.visible,endInset:o.contentInsetEndAdjustment,derive:e.derive,onReturnToLatest:ne.onReturnToLatest,controlRef:ce});return c(sB,{slots:a.slots,data:s,target:R,children:b("div",{ref:N,className:G("relative flex min-h-0 min-w-0 flex-1 flex-col",e.scopeClass),"data-conversation-surface":!0,children:[s.useMessageReveal?c(MX,{read:s.useMessageReveal,target:R,onChange:L,active:t.active&&t.visible,onModeChange:n.onModeChange},t.threadKey):null,c(AX,{data:s,target:R,threadKey:t.threadKey,environmentId:t.environmentId,threadId:t.threadId,slots:a.slots}),c(iw,{data:s,target:R,threadKey:t.threadKey,surfaceRef:N}),c($I,{chat:b(_d,{section:"chat",resetKey:t.threadKey,children:[c(uk,{data:s,target:R,visible:t.visible,...ee,paneActive:t.active,liveFollowEnabled:ke.liveFollowEnabled,scrollerRef:ke.bindTimelineHandle,onRowsChange:ke.onRowsChange,onIsAtEndChange:ke.onIsAtEndChange,onManualNavigation:ke.onManualNavigation,onDisclosureNavigation:ke.onDisclosureNavigation,loadEarlier:ne.loadEarlier,loadLater:ne.loadLater,pagingBlockedByInteraction:ne.pagingBlockedByInteraction,restoringHistory:ne.restoringHistory??!1,onVisibleTurnRangeChange:ne.onVisibleTurnRangeChange,onReturnToLatest:ne.loadLater===null?null:ke.returnToEnd,onTurnNavigatorChange:i,revealMessageRequest:U,messageReveal:t.active?O:null,onMessageRevealMissing:te,revealQuoteRequest:q,onRevealQuoteDone:X,onRevealMessageHandled:j}),c(fk,{data:s,target:R,bottomInset:o.contentInsetEndAdjustment,showScrollToEnd:ke.showScrollToEnd,onScrollToEnd:ke.returnToEnd})]},"chat"),mode:n.mode,trajectory:c(_d,{section:"trajectory",resetKey:t.threadKey,children:c(Ek,{data:s,target:R,inputKey:t.threadKey,paneVisible:t.visible&&n.mode==="trajectory",timestampFormat:r.timestampFormat,onOpenInChat:_,onOpenFileDiff:o.onOpenFileDiff})},"trajectory"),visible:t.visible}),c(F_,{api:a.api,data:s,draftId:a.draftId,target:R,threadKey:t.threadKey,belowSlot:a.belowSlot,teamDock:a.teamDock,composer:c(_d,{section:"composer",resetKey:t.threadKey,children:c(Bf,{value:se,children:c(eB,{children:c(LX,{slots:a.slots,children:T})})})}),draftHero:a.draftHero,slots:a.slots,environmentId:t.environmentId,threadId:t.threadId,onOverlayElementChange:a.onOverlayElementChange,questions:c(_d,{section:"composer",resetKey:t.threadKey,children:c(T_,{data:s,target:R})}),queue:c(_d,{section:"queue",resetKey:t.threadKey,children:c(w_,{data:s,target:R,inputKey:t.threadKey,attachments:e.attachments})})})]})})}function MX({read:e,target:t,onChange:n,active:o,onModeChange:r}){let a=e(t);return $(()=>{n(a)},[a,n]),$(()=>()=>n(null),[n]),$(()=>{o&&a.request&&r("chat")},[o,a.request,r]),null}function AX(e){let n=e.data.useComposerStatus({target:e.target,threadKey:e.threadKey}).activeThread?.presetId??null;return c("div",{className:"max-h-[min(280px,36vh)] min-h-0 shrink overflow-y-auto empty:hidden","data-conversation-views":!0,children:e.slots?.renderSlot("conversation.view",{environmentId:e.environmentId,threadId:e.threadId,presetId:n})},e.threadKey)}V();V();function wS(e){return e.turnOutline??e.turns.map((t,n)=>({messageId:t.messageId,ordinal:Math.max(e.turnCount,e.turns.length)-e.turns.length+n+1,...t.error!==null?{failed:!0}:{},...n===e.turns.length-1&&e.status==="waiting"?{waiting:!0}:{}}))}function lB(e,t,n){let o=wS(e),r=[],a=[],s=()=>{if(a.length>=3)r.push({kind:"group",turns:a});else for(let i of a)r.push({kind:"turn",turn:i});a=[]};return o.forEach((i,l)=>{l===0||l===o.length-1||i.failed||i.waiting||i.forkSource||t.has(i.messageId)||n.has(`${e.threadId}:${i.messageId}`)?(s(),r.push({kind:"turn",turn:i})):a.push(i)}),s(),r}var Nr=264,Yr=136,Ah=20,dB=16,cB=16,NX=(Nr+Ah)/3,_X=Nr/2,DX={cards:[],edges:[],ticks:[],width:0,height:0};function TS(e){return`${e}:thread`}function Nh(e,t){return`${e}:turn:${t}`}function uB(e){if(e.threads.length===0)return DX;let t=[...e.threads].sort((y,x)=>y.createdAt.localeCompare(x.createdAt)||y.threadId.localeCompare(x.threadId)),n=new Map,o=[],r=0,a=null;t.forEach((y,x)=>{let w=e.dayOf(y.createdAt);if(x>0&&(r+=NX+(w===a?0:_X)),w!==a){let I=t[x-1],S=I===void 0?0:Date.parse(y.createdAt)-Date.parse(I.createdAt);o.push({x:r,at:y.createdAt,...S>864e5?{gapDays:Math.floor(S/864e5)}:{}})}a=w,n.set(y.threadId,r)});let s=new Map(t.map(y=>[y.threadId,y])),i=new Map;for(let y of t){if(y.forkedFrom===null)continue;let x=i.get(y.forkedFrom.sourceThreadId)??new Set;x.add(y.forkedFrom.sourceMessageId),i.set(y.forkedFrom.sourceThreadId,x)}let l=new Map(t.map(y=>[y.threadId,lB(y,i.get(y.threadId)??new Set,e.revealed??new Set)])),d=new Map,u=[],p=new Map,f=0,m=[];for(let y of t){let x=n.get(y.threadId)??0,w=OX(y,e.expanded,l.get(y.threadId)??[]),I=y.forkedFrom===null?void 0:s.get(y.forkedFrom.sourceThreadId),S=I!==void 0?d.get(I.threadId):void 0,k=S===void 0?0:S+1;for(;k<m.length&&(m[k]??0)+Ah>x;)k+=1;m[k]=x+w,d.set(y.threadId,k),f=Math.max(f,x+w)}let g=Math.max(1,m.length),h=cB*2+g*Yr+(g-1)*dB;for(let y of t){let x=cB+(d.get(y.threadId)??0)*(Yr+dB),w=n.get(y.threadId)??0,I=FX(y,e.expanded,l.get(y.threadId)??[],w,x);u.push(...I),I[0]!==void 0&&p.set(y.threadId,I[0])}let v=[],C=new Map(u.map(y=>[y.id,y]));for(let y of t){let x=y.forkedFrom,w=p.get(y.threadId);if(x===null||w===void 0)continue;let I=C.get(Nh(x.sourceThreadId,x.sourceMessageId))??p.get(x.sourceThreadId);I!==void 0&&v.push({id:`${I.id}->${w.id}`,path:BX(I,w),sourceThreadId:x.sourceThreadId,childThreadId:y.threadId})}return{cards:u,edges:v,ticks:o,width:f,height:h}}function pB(e,t){return t.has(e.threadId)&&wS(e).length>0}function OX(e,t,n){let o=pB(e,t)?n.length:1;return o*Nr+(o-1)*Ah}function FX(e,t,n,o,r){return pB(e,t)?n.map((a,s)=>{let i=a.kind==="turn"?a.turn:a.turns[0];if(i===void 0)throw new Error("Empty turn group");return{id:a.kind==="group"?`${e.threadId}:group:${i.messageId}`:Nh(e.threadId,i.messageId),kind:a.kind,threadId:e.threadId,turnIndex:i.ordinal-1,messageId:i.messageId,...a.kind==="group"?{groupedMessageIds:a.turns.map(l=>l.messageId)}:{},x:o+s*(Nr+Ah),y:r}}):[{id:TS(e.threadId),kind:"thread",threadId:e.threadId,turnIndex:-1,x:o,y:r}]}function BX(e,t){let n=e.x+Nr/2,o=e.y+Yr,r=t.x,a=t.y+Yr/2,s=Math.max(24,(a-o)/2);return`M ${n} ${o} C ${n} ${o+s}, ${r-s} ${a}, ${r} ${a}`}function fB(e,t,n,o=240){if(n.width===0||n.height===0)return!1;let r=e.x*t.scale+t.x,a=e.y*t.scale+t.y;return r+Nr*t.scale>=-o&&a+Yr*t.scale>=-o&&r<=n.width+o&&a<=n.height+o}var _r=24;function hp(e){return{left:0,top:36}}function kS(e,t,n=1){let o=hp(t),r=t.width-o.left-_r*2,a=e.cards.at(-1),s=a===void 0?e.width:a.x+Nr,i=s*n<=r?o.left+_r:t.width-_r-s*n,l=Math.min(o.top+_r/2,t.height-_r-(a===void 0?0:a.y+Yr)*n);return{x:i,y:l,scale:n}}function gB(e,t,n){return{...e,x:e.x+(n.width-t.width)/2,y:e.y+(n.height-t.height)/2}}function hB(e,t){let n=hp(t);if(e.width===0||t.width===0)return{x:n.left+_r,y:n.top+_r/2,scale:1};let o=bB(Math.min((t.width-n.left-_r*2)/e.width,(t.height-n.top-_r*2)/Math.max(1,e.height)),.25,1);return{x:n.left+_r,y:n.top+_r/2,scale:o}}function vB(e,t,n){let o=hp(n),r=o.left+(n.width-o.left)/2,a=o.top+(n.height-o.top)/2;return{scale:t.scale,x:r-(e.x+Nr/2)*t.scale,y:a-(e.y+Yr/2)*t.scale}}function _h(e,t,n){let o=bB(e.scale*t,.25,4),r=(n.x-e.x)/e.scale,a=(n.y-e.y)/e.scale;return{scale:o,x:n.x-r*o,y:n.y-a*o}}function yB(e){return e.ctrlKey||e.metaKey}function CB(e,t,n=48){switch(t){case"ArrowLeft":return{...e,x:e.x+n};case"ArrowRight":return{...e,x:e.x-n};case"ArrowUp":return{...e,y:e.y+n};case"ArrowDown":return{...e,y:e.y-n};default:return null}}function PS(e,t){return t?e<=.55:e<.5}function xB(e,t,n){return{...e,x:e.x+(t.x-n.x)*e.scale,y:e.y+(t.y-n.y)*e.scale}}function bB(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}V();function RS(e){return e.archived?"map.status.archived":HX[e.status]}var HX={running:"map.status.running",waiting:"map.status.waiting",failed:"map.status.failed",done:"map.status.done"};function UX(e){return e===void 0?"":(e.answer||e.error||e.question).trim()}var SB=de(function(t){let{t:n,thread:o}=t,r=t.formatTitle?.(o.title)??o.title,a=UX(o.turns.at(-1)),s=o.loaded?o.turns.length>0:o.turnCount>0;return b("article",{className:"session-map-card","data-status":o.archived?"archived":o.status,"data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":r||n("settings.hiddenUntitled"),style:{left:t.card.x,top:t.card.y},onPointerDown:i=>i.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:i=>{i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),t.onSelect(o.threadId)))},children:[b("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:r||n("settings.hiddenUntitled")})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,b("p",{className:"session-map-meta",children:[c("span",{className:"session-map-status",children:n(RS(o))}),o.loaded?c("span",{children:n("map.turns",{count:o.turnCount})}):null,c("span",{children:t.updatedLabel})]}),o.loaded?c("p",{className:"session-map-preview",children:a||n("map.noReply")}):c("p",{className:"session-map-preview","data-pending":"","aria-hidden":!0}),b("footer",{onClick:i=>i.stopPropagation(),children:[s?c(Y,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onExpand(t.card),children:n("map.expand")}):null,c(Y,{type:"button",size:"xs",variant:"outline",onClick:()=>t.onOpen(o.threadId),children:n("map.open")}),b(Ne,{children:[c(De,{render:c(Y,{type:"button",size:"icon-xs",variant:"ghost","aria-label":n("map.hide"),onClick:()=>t.onHide(o.threadId)}),children:c(Zd,{})}),c(_e,{side:"top",children:n("map.hide")})]})]})]})}),IB=de(function(t){let{t:n,thread:o,card:r}=t,a=t.formatTitle?.(o.title)??o.title,s=o.turns.find(u=>u.messageId===r.messageId),i=o.turnOutline?.find(u=>u.messageId===r.messageId),l=r.turnIndex+1,d=(s?.answer||s?.error||"").trim();return b("article",{className:"session-map-card","data-turn":"","data-status":o.archived?"archived":i?.failed?"failed":i?.waiting?"waiting":l===o.turnCount?o.status:"done","data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":n("map.turnLabel",{index:l,title:a}),style:{left:r.x,top:r.y},onPointerDown:u=>u.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:u=>{u.target===u.currentTarget&&(u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),t.onSelect(o.threadId)))},children:[b("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-ordinal",children:n("map.turnOrdinal",{index:l})}),b("strong",{children:[c("span",{className:"session-map-turn-question",children:s?.question||n(s===void 0?"map.loading":"map.noQuestion")}),c("span",{className:"session-map-compact-title",children:a||n("settings.hiddenUntitled")})]})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,c("p",{className:"session-map-preview","data-error":s?.error!=null&&s.answer.length===0?"":void 0,"data-pending":s===void 0?"":void 0,children:s===void 0?null:d||n("map.noReply")}),b("footer",{onClick:u=>u.stopPropagation(),children:[r.turnIndex===0?c(Y,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onCollapse(r),children:n("map.collapse")}):null,b(Y,{type:"button",size:"xs",variant:"ghost",onClick:()=>{r.messageId!==void 0&&t.onFork(o.threadId,r.messageId)},children:[c(ic,{}),n("map.fork")]})]})]})}),wB=de(function(t){return b("article",{className:"session-map-card session-map-group",tabIndex:0,"aria-label":t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0}),onClick:()=>t.onReveal(t.card),onKeyDown:n=>{n.target===n.currentTarget&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.onReveal(t.card))},"data-status":t.thread.archived?"archived":"done","data-dimmed":t.dimmed?"":void 0,"data-selected":t.selected?"":void 0,onPointerDown:n=>n.stopPropagation(),onPointerEnter:()=>t.onHover(t.thread.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(t.thread.threadId),onBlur:()=>t.onHover(null),style:{left:t.card.x,top:t.card.y},children:[b("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:(t.formatTitle?.(t.thread.title)??t.thread.title)||t.t("settings.hiddenUntitled")})]}),c(Y,{type:"button",size:"sm",variant:"ghost",onClick:n=>{n.stopPropagation(),t.onReveal(t.card)},children:t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0})})]})});function TB({text:e}){return e.length===0?null:c(eo,{className:"session-map-md",text:e})}var KX=3;function kB(e){let{t,thread:n}=e,o=e.formatTitle?.(n.title)??n.title,a=(e.fuller??n).turns.slice(-KX);return b("aside",{className:"session-map-panel","aria-label":o||t("settings.hiddenUntitled"),children:[b("header",{children:[c("strong",{children:o||t("settings.hiddenUntitled")}),c(Y,{type:"button",size:"icon-xs",variant:"ghost","aria-label":t("map.closePanel"),onClick:e.onClose,children:c(Ut,{})})]}),b("p",{className:"session-map-meta","data-status":n.archived?"archived":n.status,children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-status",children:t(RS(n))})]}),b("p",{className:"session-map-meta",children:[c("span",{children:t("map.created",{time:e.formatTime(n.createdAt)})}),c("span",{children:t("map.updated",{time:e.formatTime(n.updatedAt)})}),n.loaded?c("span",{children:t("map.turns",{count:n.turnCount})}):null]}),c(Y,{type:"button",size:"sm",onClick:()=>e.onOpen(n.threadId),children:t("map.open")}),c("h3",{children:t("map.recent")}),e.notice!==null?c(Ja,{title:e.notice}):null,!n.loaded&&e.fuller===null?c(Za,{"aria-label":t("map.loading")}):a.length===0?c(Ja,{title:t("map.noTurns")}):c("ol",{className:"session-map-turns",children:a.map(s=>b("li",{children:[c("p",{className:"session-map-question",children:s.question}),s.answer.length>0?c(TB,{text:s.answer}):s.error!==null?c("p",{className:"session-map-error",children:s.error}):c("p",{className:"session-map-muted",children:t("map.noReply")}),s.answerTruncated||s.questionTruncated?c("p",{className:"session-map-muted",children:t("map.truncated")}):null]},s.messageId))})]})}V();function PB(e){let t=new Map,n=new Map;for(let o of e){if(o.forkedFrom===null)continue;let r=o.forkedFrom.sourceThreadId;t.set(o.threadId,r);let a=n.get(r)??new Set;a.add(o.threadId),n.set(r,a)}return{count:o=>n.get(o)?.size??0,family:o=>{if(o===null)return new Set;let r=t.get(o);return new Set([o,...r===void 0?[]:[r],...n.get(o)??[]])}}}function RB(e,t,n,o,r){return t!==null&&!n.has(e)||o&&!r.has(e)}function LB(e,t,n){if(e.ticks.length===0)return[];let o=0;for(let s=1;s<e.ticks.length&&!(e.ticks[s].x*t.scale+t.x>0);s+=1)o=s;let r=e.ticks[o],a=e.ticks[o+1];return[{...r,gapDays:void 0,sticky:!0,left:Math.min(0,a===void 0?0:a.x*t.scale+t.x-112)},...e.ticks.slice(o+1).flatMap(s=>{let i=s.x*t.scale+t.x;return i<=n.width?[{...s,sticky:!1,left:i}]:[]})]}function EB(e){let t=A(null),n=A(null),o=A(!1),[r,a]=W(null),s=K(()=>PB(Array.from(e.threads.values())),[e.threads]),i=K(()=>s.family(e.selectedThreadId),[s,e.selectedThreadId]),l=A(e.camera),d=A(e.onCamera),u=A(e.onFrame);l.current=e.camera,d.current=e.onCamera,u.current=e.onFrame;let p=A(()=>{}),f=A(null);$(()=>{let I=t.current;if(I===null)return;let S=null,k=0,P=()=>{k=0;let L=S;S=null,L!==null&&d.current(L)},T=L=>{l.current=L,S=L;let O=n.current;O!==null&&(O.style.transform=LS(L),O.style.setProperty("--map-scale",String(L.scale)),o.current=PS(L.scale,o.current),O.toggleAttribute("data-compact",o.current)),k===0&&(k=window.requestAnimationFrame(P))};p.current=T;let R=L=>{L.preventDefault();let O=l.current;if(!yB(L)){T({...O,x:O.x-L.deltaX,y:O.y-L.deltaY});return}let U=I.getBoundingClientRect();T(_h(O,L.deltaY<0?1.08:.92,{x:L.clientX-U.left,y:L.clientY-U.top}))},E=()=>u.current({width:I.clientWidth,height:I.clientHeight});E();let D=new ResizeObserver(E);return D.observe(I),I.addEventListener("wheel",R,{passive:!1}),()=>{D.disconnect(),I.removeEventListener("wheel",R),k!==0&&window.cancelAnimationFrame(k)}},[]),$(()=>{if(f.current!==null)return;let I=n.current;I!==null&&(I.style.transform=LS(e.camera),I.style.setProperty("--map-scale",String(e.camera.scale)),o.current=PS(e.camera.scale,o.current),I.toggleAttribute("data-compact",o.current))},[e.camera]);let m=K(()=>e.layout.cards.filter(I=>fB(I,e.camera,e.frame)),[e.layout,e.camera,e.frame]),g=K(()=>{let I=new Set;for(let S of m)e.threads.get(S.threadId)?.loaded===!1&&I.add(S.threadId);return[...I].sort().join(`
3826
+ `)[0]}),c("div",{className:"flex min-w-0 flex-wrap items-center gap-1 pt-0.5",children:i.options.map(p=>c(Y,{size:"xs",variant:p.tone==="primary"?"default":p.tone==="danger"?"destructive":"outline",disabled:a,onClick:()=>{s(!0),t.onRespond(l,p.id)},children:d(p.label)},p.id))})]})});function bX(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function IS(e,t){if(t?.attachmentsBlocked)return null;let n=bX(t?.customAnswer);if(e.allowFreeform!==!1&&n)return n;let o=Jx(e,t?.selectedOptionLabels),r=e.allowFreeform!==!1&&(t?.attachmentCount??0)>0;return e.multiSelect?o.length>0?o:r?"":null:o[0]??(r?"":null)}function SX(e,t){let n={};for(let o of e){let r=IS(o,t[o.id]);if(r===null)return null;n[o.id]=r}return n}function IX(e,t){return e.reduce((n,o)=>IS(o,t[o.id])!==null?n+1:n,0)}function K2(e,t,n){let o=e.length===0?0:Math.max(0,Math.min(n,e.length-1)),r=e[o]??null,a=r?t[r.id]:void 0,s=r?IS(r,a):null,i=r?.allowFreeform===!1?"":a?.customAnswer??"",l=IX(e,t),d=e.length===0?!0:o>=e.length-1;return{questionIndex:o,activeQuestion:r,activeDraft:a,selectedOptionLabels:r?Jx(r,a?.selectedOptionLabels):[],customAnswer:i,resolvedAnswer:s,usingCustomAnswer:i.trim().length>0,answeredQuestionCount:l,isLastQuestion:d,isComplete:SX(e,t)!==null,canAdvance:s!==null}}var wX={approve:{label:"pendingUserInput.planApprove",description:"pendingUserInput.planApproveHint"},revise:{label:"pendingUserInput.planRevise",description:"pendingUserInput.planReviseHint"},stop:{label:"pendingUserInput.planStop",description:"pendingUserInput.planStopHint"}};function $2(e,t,n){if(n.displayKind==="acknowledge")return{label:e("pendingUserInput.acknowledge"),description:e("pendingUserInput.continueHint")};let o=t.kind==="plan"&&n.planAction!==void 0?wX[n.planAction]:void 0;return o===void 0?{label:n.label,description:n.description??""}:{label:e(o.label),description:e(o.description)}}V();var Mh=de(function({pendingUserInputs:t,respondingRequestIds:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s,shortcuts:i=!0}){if(t.length===0)return null;let l=t[0];return l?c(TX,{prompt:l,isResponding:n.includes(l.requestId),answers:o,questionIndex:r,onToggleOption:a,onAdvance:s,shortcuts:i},l.requestId):null}),TX=de(function({prompt:t,isResponding:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s,shortcuts:i}){let{t:l}=Q(),d=Rt(),u=K2(t.questions,o,r),p=u.activeQuestion,f=A(null),m=A(s),[g,h]=W(null),[v,C]=W(null),y=v!==null&&v===p?.id;$(()=>{m.current=s},[s]),$(()=>{if(!(!p||p.multiSelect||!g)){if(g.questionId!==p.id){h(null);return}u.customAnswer.trim().length===0&&u.selectedOptionLabels.includes(g.optionLabel)&&h(null)}},[p,g,u.customAnswer,u.selectedOptionLabels]),$(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);let x=M((k,P)=>{if(p?.multiSelect){a(k,P);return}h({questionId:k,optionLabel:P}),a(k,P),f.current!==null&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>{f.current=null,m.current()},200)},[p,a]);if(d.pane.useKeydown(k=>{if(!i||!p||n||y||k.metaKey||k.ctrlKey||k.altKey||k.isComposing||k.keyCode===229||rs(k.target))return;let P=Nv(k.key,p.options.length);if(P===null)return;let T=p.options[P];T&&(k.preventDefault(),x(p.id,xd(T)))},{target:"document"}),!p)return null;let w=u.customAnswer.trim().length>0,I=g?.questionId===p.id?g.optionLabel:null,S=I!==null?[I]:w?[]:u.selectedOptionLabels;return b(Hp,{state:"pending",className:"px-3 py-2 sm:px-4",title:p.header,meta:t.questions.length>1?`${r+1}/${t.questions.length}`:void 0,collapse:{collapsed:y,onCollapsedChange:k=>{C(k?p.id:null)},hint:p.question,toggleLabel:l(y?"pendingUserInput.showQuestion":"pendingUserInput.hideQuestion")},children:[c("div",{className:"max-h-[min(45vh,28rem)] overflow-y-auto overscroll-contain break-words text-chat text-foreground","data-pending-user-input-body":p.kind??"question",tabIndex:0,children:p.kind==="plan"?c(eo,{text:p.question,cwd:void 0,isStreaming:!1}):c("p",{className:"whitespace-pre-wrap font-medium",children:p.question})}),p.multiSelect?c("p",{className:"text-chat-row text-muted-foreground",children:l("pendingUserInput.selectOneOrMore")}):null,c(MI,{mode:p.multiSelect?"multiple":"single","aria-label":p.header,disabled:n,selected:S,onToggle:k=>{x(p.id,k)},onReselect:k=>{x(p.id,k)},options:p.options.map((k,P)=>{let T=$2(l,p,k);return{value:xd(k),label:T.label,...T.description&&T.description!==T.label?{description:T.description}:{},...i&&P<9?{trailing:c(pl,{children:P+1})}:{}}})},p.id)]})});V();var q2=de(function({planTitle:t}){let{t:n}=Q();return c("div",{className:"px-3 py-2 sm:px-4",children:b("div",{className:"flex flex-wrap items-center gap-2",children:[c("span",{className:"text-xs font-medium text-muted-foreground",children:n("plan.ready")}),t?c("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground/85",children:t}):null]})})});function V2(e){if(e.occupant.kind!=="approval")return null;let{approval:t}=e.occupant;return c(Lh,{requestId:t.requestId,isResponding:e.respondingRequestIds.includes(t.requestId),options:t.options,keybindings:e.keybindings,declineReasonRelay:t.declineReasonRelay,onRespondToApproval:e.onRespondToApproval})}function W2(e){return e.occupant.kind!=="user-input"?null:c(Mh,{pendingUserInputs:[e.occupant.userInput],respondingRequestIds:e.respondingRequestIds,answers:e.activePendingDraftAnswers,questionIndex:e.activePendingQuestionIndex,onToggleOption:e.onSelectActivePendingUserInputOption,onAdvance:e.onAdvanceActivePendingUserInput})}var G2={approval:{expanded:e=>e.occupant.kind!=="approval"?null:c(mp,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:V2(e),className:"px-3 py-2 sm:px-4"}),collapsed:e=>e.occupant.kind!=="approval"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(mp,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:V2(e),className:"px-3 pt-2 pb-3 sm:px-4"})})},decision:{expanded:e=>e.occupant.kind!=="decision"?null:c(gp,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision}),collapsed:e=>e.occupant.kind!=="decision"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(gp,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision,className:"pt-2 pb-3"})})},"user-input":{expanded:W2,collapsed:e=>b("div",{"data-chat-composer-collapsed-controls":"true",children:[W2(e),e.collapsedPendingRow]})},"plan-follow-up":{expanded:e=>e.activeProposedPlan===null?null:c(q2,{planTitle:a2(e.activeProposedPlan.planMarkdown)??null},e.activeProposedPlan.id),collapsed:null}};function j2(e,t){let n=G2[e.occupant.kind],o=t?n.collapsed:n.expanded;return o===null?null:o(e)}var sDe=Object.keys(G2);function Q2(e){let{composerOccupant:t,showComposerTopDrawer:n,hasBlockingComposerTopDrawer:o,isTasksDrawerOpen:r,isComposerCollapsedMobile:a,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,badges:y,pendingPrimaryAction:x,isSendBusy:w,sendDisabledReason:I,environmentUnavailable:S,noProviderAvailable:k,projectSelectionRequired:P,previousUserInputQuestion:T,handleInterruptPrimaryAction:R,handleImplementPlanInNewThreadPrimaryAction:E}=e,{inlineTasksBadge:D,inlineStashBadge:L,visibleTasksProgress:O,visibleTaskSteps:U,dismissTasks:F,toggleTasksDrawer:_}=y;return b(Ce,{children:[n&&(!r||o)?c("div",{className:"chat-composer-top-drawer","data-chat-composer-top-drawer":"true","data-variant":t?.kind==="approval"?"warning":"info","data-occupant":t?.kind??"none",children:t===null?null:j2({occupant:t,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,collapsedPendingRow:c(r2,{activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,inlineTasksBadge:D,inlineStashBadge:L,pendingPrimaryAction:x,isSendBusy:w,sendDisabledReason:I,isEnvironmentUnavailable:S!==null||k||P,onPreviousActivePendingUserInputQuestion:T,handleInterruptPrimaryAction:R,handleImplementPlanInNewThreadPrimaryAction:E})},a)}):null,r&&!o&&O&&U?c(xD,{onDismiss:F,onCollapse:_,progress:O,steps:U}):null]})}function Y2(e,t){return{images:e.images,terminalContexts:e.terminalContexts,elementContexts:e.elementContexts,browserAnnotations:e.browserAnnotations,reviewComments:e.reviewComments,nonPersistedImageIds:e.nonPersistedImageIds,activeProvider:e.activeProvider,nativeModeByProvider:e.nativeModeByProvider,selectedPluginActionKey:e.selectedPluginActionKey,promptHasText:e.prompt.trim().length>0,hasSendableContent:t({prompt:e.prompt,imageCount:e.images.length,terminalContexts:e.terminalContexts,elementContextCount:e.elementContexts.length+e.browserAnnotations.length+e.reviewComments.length}).hasSendableContent}}function X2(e){let t=e.draft.useStore;return{setComposerDraftPrompt:t(n=>n.setPrompt),setComposerDraftNativeMode:t(n=>n.setNativeMode),addComposerDraftImage:t(n=>n.addImage),addComposerDraftImages:t(n=>n.addImages),removeComposerDraftImage:t(n=>n.removeImage),insertComposerDraftTerminalContext:t(n=>n.insertTerminalContext),removeComposerDraftElementContext:t(n=>n.removeElementContext),removeComposerDraftBrowserAnnotation:t(n=>n.removeBrowserAnnotation),removeComposerDraftReviewComment:t(n=>n.removeReviewComment),clearComposerDraftPromptAndImages:t(n=>n.clearComposerPromptAndImages)}}V();function J2(e){let{onComposerPaste:t,submitComposer:n,exitShellCommandMode:o}=e,r=A({onComposerPaste:t,submitComposer:n,exitShellCommandMode:o});r.current={onComposerPaste:t,submitComposer:n,exitShellCommandMode:o};let a=M(l=>{r.current.onComposerPaste(l)},[]),s=M((l,d)=>{r.current.submitComposer(l,d)},[]),i=M(()=>r.current.exitShellCommandMode(),[]);return{handleComposerPaste:a,handleComposerSubmit:s,handleUnclaimedEscape:i}}V();var Z2=pt(null);function eB({children:e}){let{data:t,target:n,threadKey:o}=Co(),r=t.useComposerStatus({target:n,threadKey:o});return c(Z2.Provider,{value:r,children:e})}function tB(){let e=Dt(Z2);if(e===null)throw new Error("Composer status has not been provided.");return e}var nB=de(function(t){let n=A_(),{data:o,target:r,threadKey:a}=Co(),{activePendingApproval:s,pendingUserInputs:i,activePendingProgress:l,activePendingResolvedAnswers:d,activePendingIsResponding:u,activePendingDraftAnswers:p,activePendingQuestionIndex:f,questionAttachmentsSupported:m,respondingRequestIds:g,occupants:h,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,changeUserInputCustomAnswer:x,advanceUserInput:w,previousUserInputQuestion:I}=o.useComposerPending({target:r,threadKey:a}),{runtimeMode:S,interactionMode:k,lockedProvider:P,providerStatuses:T,activeProjectDefaultModelSelection:R,projectId:E,activeThreadModelSelection:D,activeThreadActualModel:L}=o.useComposerModelContext(r),{activeThreadId:O,activeThread:U,isLocalDraftThread:F,projectSelectionRequired:_,phase:j,isSendBusy:N,sendDisabledReason:z,groupSendDisabledReason:re,unavailableAgentInstanceId:H=null,noAgentChosen:te=!1,environmentUnavailable:q,compactDisabled:J,compactDisabledReason:X}=tB(),{t:se}=Q(),{composerDraftTarget:ce,environmentId:ee,attachmentUploadsCapabilityKnown:ne,supportsAttachmentUploads:ke,routeKind:xe,routeThreadRef:be,draftId:le,forceExpandedOnMobile:Ie,settings:he,keybindings:ie,terminalOpen:Re,gitCwd:ge,promptRef:pe,composerRef:qe,composerImagesRef:ue,composerTerminalContextsRef:Ue,composerElementContextsRef:Xe,sendContextRef:ht,onSend:Qe,onInterrupt:it,interruptArmed:ae=!1,stopping:Le=!1,onCompactContext:Ae,onImplementPlanInNewThread:Ke,onProviderInstanceSelect:gt,onModelSelectionChosen:Wt,handleRuntimeModeChange:Pt,handleInteractionModeChange:oe,handleNativeModeChange:ye,focusComposer:Ee,setThreadError:Ye}=t,Lt=o.useComposerPlan(r),It=Lt.proposedPlan,dn=Lt.tasksProgress,zt=Lt.taskSteps,lt=i.length===0&&k==="plan"&&It!==null,st=A(null),{pendingPrimaryAction:At,onSelectActivePendingUserInputOption:Gt,onRespondToApproval:Nt,onRespondToComposerDecision:nn,onAdvanceActivePendingUserInput:Zt}=cD({t:se,threadId:r.threadId,setThreadError:Ye,promptRef:pe,promptInputRef:st,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,advanceUserInput:w,activePendingProgress:l,activePendingIsResponding:u,activePendingResolvedAnswers:d}),at=t.api,{limits:en}=t.attachments,Pe=at.draft.useThreadDraftSelector(ce,Mo=>Y2(Mo,at.chat.deriveComposerSendState)),Ve=i[0]??null,{questionAttachmentTarget:ft,attachmentTarget:dt,attachmentDocumentKey:vt}=aD({supported:m,attachments:t.attachments,environmentId:ee,threadId:O,requestId:Ve?.requestId??null,question:l?.activeQuestion??null,responding:u,composerDraftTarget:ce}),wt=at.draft.useThreadDraftSelector(dt,rD),Et=wt.images,Xt=Pe.terminalContexts,cn=Pe.elementContexts,Xn=Pe.browserAnnotations,an=Pe.reviewComments,Wo=wt.nonPersistedImageIds,Hn=at.uploads.useStore(Mo=>Mo.uploadsByImageId),Po=!ne&&Et.length>0?se("attachments.capabilityUnknown"):ke?H_({imageIds:Et.map(Mo=>Mo.id),uploadsByImageId:Hn,environmentId:ee},se):null,{setComposerDraftPrompt:we,setComposerDraftNativeMode:ct,addComposerDraftImage:_t,addComposerDraftImages:yt,removeComposerDraftImage:Sn,insertComposerDraftTerminalContext:gn,removeComposerDraftElementContext:on,removeComposerDraftBrowserAnnotation:rn,removeComposerDraftReviewComment:Un,clearComposerDraftPromptAndImages:sn}=X2(at);$(()=>{if(ne){if(!ke){for(let Mo of Et)at.uploads.release(Mo.id);return}at.draft.restoreAttachments();for(let Mo of Et)at.uploads.start({environmentId:ee,image:Mo})}},[ne,Et,ee,ke]);let Ro=l!==null,Go=UD({api:at,t:se,settings:he,composerDraft:Pe,composerDraftTarget:ce,environmentId:ee,gitCwd:ge,routeKind:xe,threadId:r.threadId,activeThread:U,isLocalDraftThread:F,unavailableAgentInstanceId:H,agentNotChosen:te,runtimeMode:S,lockedProvider:P,providerStatuses:T,projectId:E,activeProjectDefaultModelSelection:R,activeThreadModelSelection:D,actualModel:L,compactDisabledReason:X,externalSendDisabledReason:z,attachmentBlockReason:Po,answeringQuestion:Ro,setComposerDraftNativeMode:ct,handleNativeModeChange:ye,onProviderInstanceSelect:gt,onModelSelectionChosen:Wt}),{selectedInstanceId:Ps,noProviderAvailable:Rs,selectedProvider:Ge,selectedModel:Xr,selectedModelChoice:Jr,sendDisabledReason:Fa,isSendDisabled:qi,setModelSendBlockShown:Ba,isModelSendBlocked:jo}=Go,io=z_(ee,ce),[Zr,ea]=W(!1),[Vi,Dn]=W(null),[ta,Wi]=W(null),[je,Lo]=W(!1),[Gi,ji]=W(!1),[Dd,Qi]=W(null),[za,na]=W({key:0,active:!1}),Yi=A(io);fe(()=>{Yi.current!==io&&(Yi.current=io,ea(!1),Dn(null),Lo(!1),ji(!1),Qi(null),na({key:za.key,active:!1}))},[io,za.key]);let lo=Zf("max-sm"),Qo=A(null),Od=A(null),Ha=A(null),Ls=A(null),Ht=A(new Map),{isComposerCollapsedMobile:Eo,blurMobileComposerAfterSend:vp,expandMobileComposer:Fd,scheduleComposerCollapseCheck:Bh,handleFormFocusCapture:zh}=dD({isMobileViewport:lo,forceExpandedOnMobile:Ie,composerEditorRef:Qo,composerSurfaceRef:Ls,composerFormRef:Ha}),Es=M(()=>{ea(!0)},[]),Hh=M(Mo=>{oe(Mo)},[oe]),Yo=s!==null,ot=l?.activeQuestion?.allowFreeform===!1,Ot=h[0]??null,{showTopDrawer:hn,showCollapsedPromptRow:Jn,hasBlocking:Bd}=B_(Ot?.kind??null,Eo),QB=lt||l!==null,{isComposerFooterCompact:YB,isComposerPrimaryActionsCompact:XB}=$_(Ha,QB),JB=GD({routeKind:xe,routeThreadRef:be,draftId:le,selectedProvider:Ge,selectedInstanceId:Ps,selectedModel:Xr,selectedModelChoice:Jr});$(()=>{Dn(null)},[cn,Xn,an,Xt,Xr,Go.selectedModelOptionsForDispatch,Ge]),lD({composerImages:Et,composerImagesRef:ue,composerTerminalContexts:Xt,composerTerminalContextsRef:Ue,composerElementContexts:cn,composerElementContextsRef:Xe});let ZB=vD({activeThreadId:O,isLocalDraftThread:F,isPluginComposer:Go.isPluginComposer,isComposerApprovalState:Yo,hasPendingProgress:l!==null,hasPendingAction:At!==null,memberMentions:o.memberMentions,target:r,promptRef:pe}),Ms=hD({api:at,t:se,limits:en,composerDraftTarget:ce,composerDraft:Pe,composerDocumentKey:io,promptRef:pe,promptInputRef:st,pendingImageCompressionsRef:Ht,setComposerDraftPrompt:we,setModelSendBlockShown:Ba,onSend:Qe,onCompactContext:Ae,blurMobileComposerAfterSend:vp,isMobileViewport:lo,isComposerApprovalState:Yo,activePendingApproval:s,activePendingProgress:l,activePendingResolvedAnswers:d,pendingUserInputCount:i.length,activeThreadId:O,phase:j,isSendBusy:N,environmentUnavailable:q,compactDisabled:J,noProviderAvailable:Rs,isSendDisabled:qi,sendDisabledReason:Fa,groupSendDisabledReason:re,isGroupSend:ZB,isModelSendBlocked:jo,showPlanFollowUpPrompt:lt}),zd=tD({api:at,t:se,limits:en,promptRef:pe,promptInputRef:st,composerEditorRef:Qo,composerImagesRef:ue,composerDraftTarget:ce,setComposerDraftPrompt:we,addComposerDraftImages:yt,clearComposerDraftPromptAndImages:sn,setIsStashMenuOpen:Lo,setStashPulse:na,isComposerCollapsedMobile:Eo,expandMobileComposer:Fd,keybindings:ie,terminalOpen:Re,isComposerModelPickerOpen:Zr,hasPendingUserInputs:i.length>0,isComposerApprovalState:Yo,projectSelectionRequired:_,answeringQuestion:Ro}),Uh=bD({activeThreadId:O,activeThread:U,activeTasksProgress:dn,activeTaskSteps:zt,isTasksDrawerOpen:Gi,setIsTasksDrawerOpen:ji,dismissedTasksTurnId:Dd,setDismissedTasksTurnId:Qi,stashQueue:zd.stashQueue,isStashMenuOpen:je,stashPulse:za,toggleInlineStashMenu:zd.toggleInlineStashMenu,isComposerApprovalState:Yo,externalDrawerAttached:n,showComposerTopDrawer:hn,isComposerCollapsedMobile:Eo,hasBlockingComposerTopDrawer:Bd}),ez=M(Mo=>{Dn(null),Ms.revalidatePromptLength(Mo),Lo(!1)},[Ms.revalidatePromptLength]),{addComposerImages:NS,removeComposerImage:tz,onComposerAttachmentInputChange:nz}=oD({api:at,t:se,limits:en,setThreadError:Ye,activeThreadId:O,answerQuestionsFirst:i.length>0&&ft===null,attachmentTarget:dt,attachmentDocumentKey:vt,supportsAttachmentUploads:ke,attachmentUploadsCapabilityKnown:ne,pendingImageCompressionsRef:Ht,addComposerDraftImage:_t,addComposerDraftImages:yt,removeComposerDraftImage:Sn}),{onComposerPaste:oz,insertComposerTextAtEnd:rz,addDroppedFolders:az,isDragOverComposer:sz,composerMentionDragHandlers:iz,onComposerMentionDragLeaveCapture:lz}=eD({api:at,t:se,addComposerImages:NS,attachments:t.attachments,promptRef:pe,promptInputRef:st,composerEditorRef:Qo,composerFormRef:Ha,composerThreadKey:a,attachmentDocumentKey:vt,attachmentImagesRef:ue,limits:en,supportsAttachmentUploads:ke,attachmentUploadsCapabilityKnown:ne,composerDocumentKey:io,isComposerApprovalState:Yo,pasteBlocked:i.length>0&&ft===null,hasPendingUserInputs:i.length>0,projectSelectionRequired:_,environmentId:ee}),_S=M(()=>{it()},[it]),DS=M(()=>{Ke()},[Ke]),{handleComposerPaste:dz,handleComposerSubmit:cz,handleUnclaimedEscape:uz}=J2({onComposerPaste:oz,submitComposer:Ms.submitComposerOrShellCommand,exitShellCommandMode:Ms.exitShellCommandMode});return iD({composerRef:qe,sendContextRef:ht,api:at,t:se,limits:en,composerData:o,refs:{composerEditorRef:Qo,promptInputRef:st,promptRef:pe,composerImagesRef:ue,composerTerminalContextsRef:Ue,composerElementContextsRef:Xe},composerDraftTarget:ce,activeThread:U,addComposerImages:NS,addDroppedFolders:az,focusComposer:Ee,insertComposerTextAtEnd:rz,insertComposerDraftTerminalContext:gn,composerBrowserAnnotations:Xn,composerReviewComments:an,isComposerApprovalState:Yo,pendingUserInputCount:i.length,projectSelectionRequired:_,noProviderAvailable:Rs,modelState:Go,handleRuntimeModeChange:Pt,runtimeMode:S,setIsComposerModelPickerOpen:ea,setProviderInputSubmissionError:Dn}),c(o2,{formRef:Ha,onSubmit:Ms.submitComposerOrShellCommand,onFocusCapture:zh,onBlurCapture:Bh,dragHandlers:iz,onDragLeaveCapture:lz,badges:Uh,stashQueueLength:zd.stashQueue.length,isStashMenuOpen:je,stashPulse:za,toggleStashMenu:zd.toggleStashMenu,drawers:c(Q2,{composerOccupant:Ot,showComposerTopDrawer:hn,hasBlockingComposerTopDrawer:Bd,isTasksDrawerOpen:Gi,isComposerCollapsedMobile:Eo,respondingRequestIds:g,keybindings:ie,onRespondToApproval:Nt,onRespondToDecision:nn,activePendingDraftAnswers:p,activePendingQuestionIndex:f,onSelectActivePendingUserInputOption:Gt,onAdvanceActivePendingUserInput:Zt,activeProposedPlan:It,activePendingProgress:l,isPendingUserInputChoiceOnly:ot,expandMobileComposer:Fd,badges:Uh,pendingPrimaryAction:At,isSendBusy:N,sendDisabledReason:Fa,environmentUnavailable:q,noProviderAvailable:Rs,projectSelectionRequired:_,previousUserInputQuestion:I,handleInterruptPrimaryAction:_S,handleImplementPlanInNewThreadPrimaryAction:DS}),children:c(n2,{props:t,composerDraft:Pe,model:Go,traits:JB,submit:Ms,stash:zd,badges:Uh,uploadsByImageId:Hn,composerImages:Et,nonPersistedComposerImageIds:Wo,removeComposerImage:tz,removeComposerDraftBrowserAnnotation:rn,removeComposerDraftReviewComment:Un,removeComposerDraftElementContext:on,onComposerAttachmentInputChange:nz,surfaceRef:Ls,composerAttachmentInputRef:Od,promptInputRef:st,composerEditorRef:Qo,composerMenuAnchor:ta,setComposerMenuAnchor:Wi,composerDocumentKey:io,isComposerCollapsedMobile:Eo,expandMobileComposer:Fd,isDragOverComposer:sz,isComposerApprovalState:Yo,showCollapsedMobilePromptRow:Jn,activePendingProgress:l,pendingUserInputs:i,changeUserInputCustomAnswer:x,pendingPrimaryAction:At,approvalDetail:s?.detail??null,handleComposerPaste:dz,handleComposerSubmit:cz,onPromptEdited:ez,handleUnclaimedEscape:uz,openModelPicker:Es,switchInteractionMode:Hh,providerInputSubmissionError:Vi,isStashMenuOpen:je,isComposerFooterCompact:YB,isComposerPrimaryActionsCompact:XB,isMobileViewport:lo,isComposerModelPickerOpen:Zr,setIsComposerModelPickerOpen:ea,showPlanFollowUpPrompt:lt,compactDisabled:J,compactThreadContext:Ms.compactThreadContext,status:{projectSelectionRequired:_,groupSendDisabledReason:re,isSendBusy:N,environmentUnavailable:q,interruptArmed:ae,stopping:Le,agentNotChosen:te,unavailableAgentInstanceId:H,lockedProvider:P,phase:j,activeThread:U,interactionMode:k,runtimeMode:S},actions:{previousUserInputQuestion:I,handleInterruptPrimaryAction:_S,handleImplementPlanInNewThreadPrimaryAction:DS}})})});function oB(e){let{composerRef:t,...n}=e;return c(pd,{value:n.api,children:c(nB,{...n,composerRef:t})})}function _d({section:e,resetKey:t,children:n}){return c(Tl,{resetKey:t,fallback:o=>kX(e,o),children:n})}function kX(e,t){return c(PX,{section:e,error:t})}function PX({section:e,error:t}){let{t:n}=et();return b("div",{role:"status","data-conversation-section-error":e,className:e==="composer"||e==="queue"?"pointer-events-auto mx-auto flex w-full max-w-3xl items-start gap-2 rounded-lg border border-destructive/30 bg-background px-3 py-2 text-sm":"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",children:[c(Jt,{"aria-hidden":!0,className:"size-4 shrink-0 text-destructive-foreground"}),b("div",{className:"min-w-0",children:[c("p",{className:"font-medium text-foreground",children:n(`timeline.sectionUnavailable.${e}`)}),c("p",{className:"whitespace-pre-wrap break-words text-muted-foreground",children:n("timeline.sectionUnavailableHint",{reason:t.message})})]})]})}function rB({hostVersion:e,scopeClass:t}){let{t:n}=et();return b("div",{role:"status","data-conversation-host-data-mismatch":!0,className:G("flex min-h-0 min-w-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",t),children:[c(Jt,{"aria-hidden":!0,className:"size-5 text-destructive-foreground"}),c("p",{className:"font-medium text-foreground",children:n("timeline.hostDataMismatchTitle")}),c("p",{className:"max-w-md text-muted-foreground",children:n("timeline.hostDataMismatchDescription",{host:e??0,plugin:Kd})})]})}V();function aB(e){let t=Tn();$(()=>{let n=e.current;if(!n)return;let o=r=>{let a=r.detail?.reference;a&&t.openThread({environmentId:a.environmentId,threadId:a.threadId})};return n.addEventListener(Ji,o),()=>n.removeEventListener(Ji,o)},[t,e])}function sB({data:e,target:t,slots:n,children:o}){return c(GI,{data:e,target:t,children:c(Ev,{value:n,children:o})})}function iB(e){let{data:t}=e;return t?.version!==Kd?c(rB,{hostVersion:t?.version??null,scopeClass:e.scopeClass}):c(Mp.Provider,{value:e.scope.active,children:c(EX,{...e,data:t})})}var RX=de(function({threadKey:t,onModeChange:n,summaryContext:o}){let[r]=xt("turn-navigator",t,null),a=M(s=>{n("chat"),r?.onSelect(s)},[n,r]);return r===null?null:c(aw,{...r,placement:"inline",onSelect:a,summaryContext:o})});function LX({slots:e,children:t}){let{data:n,target:o,threadKey:r}=Co(),a=n.useComposerPending({target:o,threadKey:r});return e?.renderSlotChain("conversation.composer",{occupants:a.occupants},t)??t}function EX(e){let{scope:t,mode:n,timeline:o,trajectory:r,composer:a,data:s}=e,[,i]=xt("turn-navigator",t.threadKey,null),l=a.draftHero.active,d=a.sessionActions,u=a.terminalControl,p=a.agentsControl,{mode:f,onModeChange:m}=n,g=K(()=>({data:s,target:{environmentId:t.environmentId,threadId:t.threadId},threadKey:t.threadKey,openTrajectory:()=>m("trajectory"),onOpenFileDiff:o.onOpenFileDiff}),[s,t.environmentId,t.threadId,t.threadKey,m,o.onOpenFileDiff]),h=K(()=>l?b(Ce,{children:[d,c("div",{className:"min-w-0 flex-1"}),u]}):b(Ce,{children:[d,c(KI,{mode:f,onModeChange:m}),c("div",{className:"min-w-0 flex-1"}),u,p,c(RX,{threadKey:t.threadKey,onModeChange:m,summaryContext:g})]}),[l,d,u,p,f,m,t.threadKey,g]),{belowSlot:v,teamDock:C,draftHero:y,onOverlayElementChange:x,sessionActions:w,terminalControl:I,agentsControl:S,contextStrip:k,...P}=a,T=c(oB,{...P,attachments:e.attachments,firstRow:h}),R=K(()=>({environmentId:t.environmentId,threadId:t.threadId}),[t.environmentId,t.threadId]),[E,D]=W(null),L=M(xe=>D(xe?{key:t.threadKey,value:xe}:null),[t.threadKey]),O=E?.key===t.threadKey?E.value:null,[U,F]=xt("trajectory-reveal",t.threadKey,null),_=M(xe=>{n.onModeChange("chat"),F(be=>({rowId:xe,nonce:(be?.nonce??0)+1}))},[n,F]),j=M(()=>F(null),[F]),N=A(null);aB(N);let{t:z}=Q(),re=A(a.api);re.current=a.api;let H=M(xe=>re.current.notify.warning(z(`timeline.quote.${xe}`)),[z]),te=M(()=>re.current.notify.warning(z("forkRelations.messageMissing")),[z]),[q,J]=xt("timeline-quote-reveal",t.threadKey,null);$(()=>{let xe=N.current;if(!xe)return;let be=le=>{let Ie=le.detail?.quote;if(Ie){if(Ie.environmentId!==R.environmentId||Ie.threadId!==R.threadId){H("otherThread");return}n.onModeChange("chat"),J({quote:Ie})}};return xe.addEventListener(wp,be),()=>xe.removeEventListener(wp,be)},[n,J,R.environmentId,R.threadId,H]);let X=M(xe=>{J(null),xe==="message-missing"&&H("messageMissing"),xe==="passage-missing"&&H("passageMissing")},[J,H]),se=K(()=>({data:s,target:R,threadKey:t.threadKey}),[s,R,t.threadKey]),{controlRef:ce,...ee}=o,ne=s.useChatWindow({target:R,threadKey:t.threadKey,visible:t.visible&&n.mode==="chat"}),ke=vk({inputKey:t.threadKey,visible:t.visible,endInset:o.contentInsetEndAdjustment,derive:e.derive,onReturnToLatest:ne.onReturnToLatest,controlRef:ce});return c(sB,{slots:a.slots,data:s,target:R,children:b("div",{ref:N,className:G("relative flex min-h-0 min-w-0 flex-1 flex-col",e.scopeClass),"data-conversation-surface":!0,children:[s.useMessageReveal?c(MX,{read:s.useMessageReveal,target:R,onChange:L,active:t.active&&t.visible,onModeChange:n.onModeChange},t.threadKey):null,c(AX,{data:s,target:R,threadKey:t.threadKey,environmentId:t.environmentId,threadId:t.threadId,slots:a.slots}),c(iw,{data:s,target:R,threadKey:t.threadKey,surfaceRef:N}),c($I,{chat:b(_d,{section:"chat",resetKey:t.threadKey,children:[c(uk,{data:s,target:R,visible:t.visible,...ee,paneActive:t.active,liveFollowEnabled:ke.liveFollowEnabled,scrollerRef:ke.bindTimelineHandle,onRowsChange:ke.onRowsChange,onIsAtEndChange:ke.onIsAtEndChange,onManualNavigation:ke.onManualNavigation,onDisclosureNavigation:ke.onDisclosureNavigation,loadEarlier:ne.loadEarlier,loadLater:ne.loadLater,pagingBlockedByInteraction:ne.pagingBlockedByInteraction,restoringHistory:ne.restoringHistory??!1,onVisibleTurnRangeChange:ne.onVisibleTurnRangeChange,onReturnToLatest:ne.loadLater===null?null:ke.returnToEnd,onTurnNavigatorChange:i,revealMessageRequest:U,messageReveal:t.active?O:null,onMessageRevealMissing:te,revealQuoteRequest:q,onRevealQuoteDone:X,onRevealMessageHandled:j}),c(fk,{data:s,target:R,bottomInset:o.contentInsetEndAdjustment,showScrollToEnd:ke.showScrollToEnd,onScrollToEnd:ke.returnToEnd})]},"chat"),mode:n.mode,trajectory:c(_d,{section:"trajectory",resetKey:t.threadKey,children:c(Ek,{data:s,target:R,inputKey:t.threadKey,paneVisible:t.visible&&n.mode==="trajectory",timestampFormat:r.timestampFormat,onOpenInChat:_,onOpenFileDiff:o.onOpenFileDiff})},"trajectory"),visible:t.visible}),c(F_,{api:a.api,data:s,draftId:a.draftId,target:R,threadKey:t.threadKey,belowSlot:a.belowSlot,teamDock:a.teamDock,composer:c(_d,{section:"composer",resetKey:t.threadKey,children:c(Bf,{value:se,children:c(eB,{children:c(LX,{slots:a.slots,children:T})})})}),draftHero:a.draftHero,slots:a.slots,environmentId:t.environmentId,threadId:t.threadId,onOverlayElementChange:a.onOverlayElementChange,questions:c(_d,{section:"composer",resetKey:t.threadKey,children:c(T_,{data:s,target:R})}),queue:c(_d,{section:"queue",resetKey:t.threadKey,children:c(w_,{data:s,target:R,inputKey:t.threadKey,attachments:e.attachments})})})]})})}function MX({read:e,target:t,onChange:n,active:o,onModeChange:r}){let a=e(t);return $(()=>{n(a)},[a,n]),$(()=>()=>n(null),[n]),$(()=>{o&&a.request&&r("chat")},[o,a.request,r]),null}function AX(e){let n=e.data.useComposerStatus({target:e.target,threadKey:e.threadKey}).activeThread?.presetId??null;return c("div",{className:"max-h-[min(280px,36vh)] min-h-0 shrink overflow-y-auto empty:hidden","data-conversation-views":!0,children:e.slots?.renderSlot("conversation.view",{environmentId:e.environmentId,threadId:e.threadId,presetId:n})},e.threadKey)}V();V();function wS(e){return e.turnOutline??e.turns.map((t,n)=>({messageId:t.messageId,ordinal:Math.max(e.turnCount,e.turns.length)-e.turns.length+n+1,...t.error!==null?{failed:!0}:{},...n===e.turns.length-1&&e.status==="waiting"?{waiting:!0}:{}}))}function lB(e,t,n){let o=wS(e),r=[],a=[],s=()=>{if(a.length>=3)r.push({kind:"group",turns:a});else for(let i of a)r.push({kind:"turn",turn:i});a=[]};return o.forEach((i,l)=>{l===0||l===o.length-1||i.failed||i.waiting||i.forkSource||t.has(i.messageId)||n.has(`${e.threadId}:${i.messageId}`)?(s(),r.push({kind:"turn",turn:i})):a.push(i)}),s(),r}var Nr=264,Yr=136,Ah=20,dB=16,cB=16,NX=(Nr+Ah)/3,_X=Nr/2,DX={cards:[],edges:[],ticks:[],width:0,height:0};function TS(e){return`${e}:thread`}function Nh(e,t){return`${e}:turn:${t}`}function uB(e){if(e.threads.length===0)return DX;let t=[...e.threads].sort((y,x)=>y.createdAt.localeCompare(x.createdAt)||y.threadId.localeCompare(x.threadId)),n=new Map,o=[],r=0,a=null;t.forEach((y,x)=>{let w=e.dayOf(y.createdAt);if(x>0&&(r+=NX+(w===a?0:_X)),w!==a){let I=t[x-1],S=I===void 0?0:Date.parse(y.createdAt)-Date.parse(I.createdAt);o.push({x:r,at:y.createdAt,...S>864e5?{gapDays:Math.floor(S/864e5)}:{}})}a=w,n.set(y.threadId,r)});let s=new Map(t.map(y=>[y.threadId,y])),i=new Map;for(let y of t){if(y.forkedFrom===null)continue;let x=i.get(y.forkedFrom.sourceThreadId)??new Set;x.add(y.forkedFrom.sourceMessageId),i.set(y.forkedFrom.sourceThreadId,x)}let l=new Map(t.map(y=>[y.threadId,lB(y,i.get(y.threadId)??new Set,e.revealed??new Set)])),d=new Map,u=[],p=new Map,f=0,m=[];for(let y of t){let x=n.get(y.threadId)??0,w=OX(y,e.expanded,l.get(y.threadId)??[]),I=y.forkedFrom===null?void 0:s.get(y.forkedFrom.sourceThreadId),S=I!==void 0?d.get(I.threadId):void 0,k=S===void 0?0:S+1;for(;k<m.length&&(m[k]??0)+Ah>x;)k+=1;m[k]=x+w,d.set(y.threadId,k),f=Math.max(f,x+w)}let g=Math.max(1,m.length),h=cB*2+g*Yr+(g-1)*dB;for(let y of t){let x=cB+(d.get(y.threadId)??0)*(Yr+dB),w=n.get(y.threadId)??0,I=FX(y,e.expanded,l.get(y.threadId)??[],w,x);u.push(...I),I[0]!==void 0&&p.set(y.threadId,I[0])}let v=[],C=new Map(u.map(y=>[y.id,y]));for(let y of t){let x=y.forkedFrom,w=p.get(y.threadId);if(x===null||w===void 0)continue;let I=C.get(Nh(x.sourceThreadId,x.sourceMessageId))??p.get(x.sourceThreadId);I!==void 0&&v.push({id:`${I.id}->${w.id}`,path:BX(I,w),sourceThreadId:x.sourceThreadId,childThreadId:y.threadId})}return{cards:u,edges:v,ticks:o,width:f,height:h}}function pB(e,t){return t.has(e.threadId)&&wS(e).length>0}function OX(e,t,n){let o=pB(e,t)?n.length:1;return o*Nr+(o-1)*Ah}function FX(e,t,n,o,r){return pB(e,t)?n.map((a,s)=>{let i=a.kind==="turn"?a.turn:a.turns[0];if(i===void 0)throw new Error("Empty turn group");return{id:a.kind==="group"?`${e.threadId}:group:${i.messageId}`:Nh(e.threadId,i.messageId),kind:a.kind,threadId:e.threadId,turnIndex:i.ordinal-1,messageId:i.messageId,...a.kind==="group"?{groupedMessageIds:a.turns.map(l=>l.messageId)}:{},x:o+s*(Nr+Ah),y:r}}):[{id:TS(e.threadId),kind:"thread",threadId:e.threadId,turnIndex:-1,x:o,y:r}]}function BX(e,t){let n=e.x+Nr/2,o=e.y+Yr,r=t.x,a=t.y+Yr/2,s=Math.max(24,(a-o)/2);return`M ${n} ${o} C ${n} ${o+s}, ${r-s} ${a}, ${r} ${a}`}function fB(e,t,n,o=240){if(n.width===0||n.height===0)return!1;let r=e.x*t.scale+t.x,a=e.y*t.scale+t.y;return r+Nr*t.scale>=-o&&a+Yr*t.scale>=-o&&r<=n.width+o&&a<=n.height+o}var _r=24;function hp(e){return{left:0,top:36}}function kS(e,t,n=1){let o=hp(t),r=t.width-o.left-_r*2,a=e.cards.at(-1),s=a===void 0?e.width:a.x+Nr,i=s*n<=r?o.left+_r:t.width-_r-s*n,l=Math.min(o.top+_r/2,t.height-_r-(a===void 0?0:a.y+Yr)*n);return{x:i,y:l,scale:n}}function gB(e,t,n){return{...e,x:e.x+(n.width-t.width)/2,y:e.y+(n.height-t.height)/2}}function hB(e,t){let n=hp(t);if(e.width===0||t.width===0)return{x:n.left+_r,y:n.top+_r/2,scale:1};let o=bB(Math.min((t.width-n.left-_r*2)/e.width,(t.height-n.top-_r*2)/Math.max(1,e.height)),.25,1);return{x:n.left+_r,y:n.top+_r/2,scale:o}}function vB(e,t,n){let o=hp(n),r=o.left+(n.width-o.left)/2,a=o.top+(n.height-o.top)/2;return{scale:t.scale,x:r-(e.x+Nr/2)*t.scale,y:a-(e.y+Yr/2)*t.scale}}function _h(e,t,n){let o=bB(e.scale*t,.25,4),r=(n.x-e.x)/e.scale,a=(n.y-e.y)/e.scale;return{scale:o,x:n.x-r*o,y:n.y-a*o}}function yB(e){return e.ctrlKey||e.metaKey}function CB(e,t,n=48){switch(t){case"ArrowLeft":return{...e,x:e.x+n};case"ArrowRight":return{...e,x:e.x-n};case"ArrowUp":return{...e,y:e.y+n};case"ArrowDown":return{...e,y:e.y-n};default:return null}}function PS(e,t){return t?e<=.55:e<.5}function xB(e,t,n){return{...e,x:e.x+(t.x-n.x)*e.scale,y:e.y+(t.y-n.y)*e.scale}}function bB(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}V();function RS(e){return e.archived?"map.status.archived":HX[e.status]}var HX={running:"map.status.running",waiting:"map.status.waiting",failed:"map.status.failed",done:"map.status.done"};function UX(e){return e===void 0?"":(e.answer||e.error||e.question).trim()}var SB=de(function(t){let{t:n,thread:o}=t,r=t.formatTitle?.(o.title)??o.title,a=UX(o.turns.at(-1)),s=o.loaded?o.turns.length>0:o.turnCount>0;return b("article",{className:"session-map-card","data-status":o.archived?"archived":o.status,"data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":r||n("settings.hiddenUntitled"),style:{left:t.card.x,top:t.card.y},onPointerDown:i=>i.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:i=>{i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),t.onSelect(o.threadId)))},children:[b("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:r||n("settings.hiddenUntitled")})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,b("p",{className:"session-map-meta",children:[c("span",{className:"session-map-status",children:n(RS(o))}),o.loaded?c("span",{children:n("map.turns",{count:o.turnCount})}):null,c("span",{children:t.updatedLabel})]}),o.loaded?c("p",{className:"session-map-preview",children:a||n("map.noReply")}):c("p",{className:"session-map-preview","data-pending":"","aria-hidden":!0}),b("footer",{onClick:i=>i.stopPropagation(),children:[s?c(Y,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onExpand(t.card),children:n("map.expand")}):null,c(Y,{type:"button",size:"xs",variant:"outline",onClick:()=>t.onOpen(o.threadId),children:n("map.open")}),b(Ne,{children:[c(De,{render:c(Y,{type:"button",size:"icon-xs",variant:"ghost","aria-label":n("map.hide"),onClick:()=>t.onHide(o.threadId)}),children:c(Zd,{})}),c(_e,{side:"top",children:n("map.hide")})]})]})]})}),IB=de(function(t){let{t:n,thread:o,card:r}=t,a=t.formatTitle?.(o.title)??o.title,s=o.turns.find(u=>u.messageId===r.messageId),i=o.turnOutline?.find(u=>u.messageId===r.messageId),l=r.turnIndex+1,d=(s?.answer||s?.error||"").trim();return b("article",{className:"session-map-card","data-turn":"","data-status":o.archived?"archived":i?.failed?"failed":i?.waiting?"waiting":l===o.turnCount?o.status:"done","data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":n("map.turnLabel",{index:l,title:a}),style:{left:r.x,top:r.y},onPointerDown:u=>u.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:u=>{u.target===u.currentTarget&&(u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),t.onSelect(o.threadId)))},children:[b("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-ordinal",children:n("map.turnOrdinal",{index:l})}),b("strong",{children:[c("span",{className:"session-map-turn-question",children:s?.question||n(s===void 0?"map.loading":"map.noQuestion")}),c("span",{className:"session-map-compact-title",children:a||n("settings.hiddenUntitled")})]})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,c("p",{className:"session-map-preview","data-error":s?.error!=null&&s.answer.length===0?"":void 0,"data-pending":s===void 0?"":void 0,children:s===void 0?null:d||n("map.noReply")}),b("footer",{onClick:u=>u.stopPropagation(),children:[r.turnIndex===0?c(Y,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onCollapse(r),children:n("map.collapse")}):null,b(Y,{type:"button",size:"xs",variant:"ghost",onClick:()=>{r.messageId!==void 0&&t.onFork(o.threadId,r.messageId)},children:[c(ic,{}),n("map.fork")]})]})]})}),wB=de(function(t){return b("article",{className:"session-map-card session-map-group",tabIndex:0,"aria-label":t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0}),onClick:()=>t.onReveal(t.card),onKeyDown:n=>{n.target===n.currentTarget&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.onReveal(t.card))},"data-status":t.thread.archived?"archived":"done","data-dimmed":t.dimmed?"":void 0,"data-selected":t.selected?"":void 0,onPointerDown:n=>n.stopPropagation(),onPointerEnter:()=>t.onHover(t.thread.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(t.thread.threadId),onBlur:()=>t.onHover(null),style:{left:t.card.x,top:t.card.y},children:[b("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:(t.formatTitle?.(t.thread.title)??t.thread.title)||t.t("settings.hiddenUntitled")})]}),c(Y,{type:"button",size:"sm",variant:"ghost",onClick:n=>{n.stopPropagation(),t.onReveal(t.card)},children:t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0})})]})});function TB({text:e}){return e.length===0?null:c(eo,{className:"session-map-md",text:e})}var KX=3;function kB(e){let{t,thread:n}=e,o=e.formatTitle?.(n.title)??n.title,a=(e.fuller??n).turns.slice(-KX);return b("aside",{className:"session-map-panel","aria-label":o||t("settings.hiddenUntitled"),children:[b("header",{children:[c("strong",{children:o||t("settings.hiddenUntitled")}),c(Y,{type:"button",size:"icon-xs",variant:"ghost","aria-label":t("map.closePanel"),onClick:e.onClose,children:c(Ut,{})})]}),b("p",{className:"session-map-meta","data-status":n.archived?"archived":n.status,children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-status",children:t(RS(n))})]}),b("p",{className:"session-map-meta",children:[c("span",{children:t("map.created",{time:e.formatTime(n.createdAt)})}),c("span",{children:t("map.updated",{time:e.formatTime(n.updatedAt)})}),n.loaded?c("span",{children:t("map.turns",{count:n.turnCount})}):null]}),c(Y,{type:"button",size:"sm",onClick:()=>e.onOpen(n.threadId),children:t("map.open")}),c("h3",{children:t("map.recent")}),e.notice!==null?c(Ja,{title:e.notice}):null,!n.loaded&&e.fuller===null?c(Za,{"aria-label":t("map.loading")}):a.length===0?c(Ja,{title:t("map.noTurns")}):c("ol",{className:"session-map-turns",children:a.map(s=>b("li",{children:[c("p",{className:"session-map-question",children:s.question}),s.answer.length>0?c(TB,{text:s.answer}):s.error!==null?c("p",{className:"session-map-error",children:s.error}):c("p",{className:"session-map-muted",children:t("map.noReply")}),s.answerTruncated||s.questionTruncated?c("p",{className:"session-map-muted",children:t("map.truncated")}):null]},s.messageId))})]})}V();function PB(e){let t=new Map,n=new Map;for(let o of e){if(o.forkedFrom===null)continue;let r=o.forkedFrom.sourceThreadId;t.set(o.threadId,r);let a=n.get(r)??new Set;a.add(o.threadId),n.set(r,a)}return{count:o=>n.get(o)?.size??0,family:o=>{if(o===null)return new Set;let r=t.get(o);return new Set([o,...r===void 0?[]:[r],...n.get(o)??[]])}}}function RB(e,t,n,o,r){return t!==null&&!n.has(e)||o&&!r.has(e)}function LB(e,t,n){if(e.ticks.length===0)return[];let o=0;for(let s=1;s<e.ticks.length&&!(e.ticks[s].x*t.scale+t.x>0);s+=1)o=s;let r=e.ticks[o],a=e.ticks[o+1];return[{...r,gapDays:void 0,sticky:!0,left:Math.min(0,a===void 0?0:a.x*t.scale+t.x-112)},...e.ticks.slice(o+1).flatMap(s=>{let i=s.x*t.scale+t.x;return i<=n.width?[{...s,sticky:!1,left:i}]:[]})]}function EB(e){let t=A(null),n=A(null),o=A(!1),[r,a]=W(null),s=K(()=>PB(Array.from(e.threads.values())),[e.threads]),i=K(()=>s.family(e.selectedThreadId),[s,e.selectedThreadId]),l=A(e.camera),d=A(e.onCamera),u=A(e.onFrame);l.current=e.camera,d.current=e.onCamera,u.current=e.onFrame;let p=A(()=>{}),f=A(null);$(()=>{let I=t.current;if(I===null)return;let S=null,k=0,P=()=>{k=0;let L=S;S=null,L!==null&&d.current(L)},T=L=>{l.current=L,S=L;let O=n.current;O!==null&&(O.style.transform=LS(L),O.style.setProperty("--map-scale",String(L.scale)),o.current=PS(L.scale,o.current),O.toggleAttribute("data-compact",o.current)),k===0&&(k=window.requestAnimationFrame(P))};p.current=T;let R=L=>{L.preventDefault();let O=l.current;if(!yB(L)){T({...O,x:O.x-L.deltaX,y:O.y-L.deltaY});return}let U=I.getBoundingClientRect();T(_h(O,L.deltaY<0?1.08:.92,{x:L.clientX-U.left,y:L.clientY-U.top}))},E=()=>u.current({width:I.clientWidth,height:I.clientHeight});E();let D=new ResizeObserver(E);return D.observe(I),I.addEventListener("wheel",R,{passive:!1}),()=>{D.disconnect(),I.removeEventListener("wheel",R),k!==0&&window.cancelAnimationFrame(k)}},[]),$(()=>{if(f.current!==null)return;let I=n.current;I!==null&&(I.style.transform=LS(e.camera),I.style.setProperty("--map-scale",String(e.camera.scale)),o.current=PS(e.camera.scale,o.current),I.toggleAttribute("data-compact",o.current))},[e.camera]);let m=K(()=>e.layout.cards.filter(I=>fB(I,e.camera,e.frame)),[e.layout,e.camera,e.frame]),g=K(()=>{let I=new Set;for(let S of m)e.threads.get(S.threadId)?.loaded===!1&&I.add(S.threadId);return[...I].sort().join(`
3827
3827
  `)},[m,e.threads]),h=A(e.onVisible);h.current=e.onVisible,$(()=>{g.length>0&&h.current(g.split(`
3828
3828
  `))},[g]);let v=K(()=>{let I=new Map;for(let S of m){if(S.kind!=="turn"||S.messageId===void 0||e.threads.get(S.threadId)?.turns.some(P=>P.messageId===S.messageId))continue;let k=I.get(S.threadId)??[];k.push(S.messageId),I.set(S.threadId,k)}return I},[m,e.threads]),C=JSON.stringify(Array.from(v)),y=A(e.onVisibleTurns);y.current=e.onVisibleTurns,$(()=>{for(let[I,S]of v)y.current(I,S)},[C]);let x=hp(e.frame),{camera:w}=e;return b("div",{ref:t,className:"session-map-stage",tabIndex:0,"aria-label":e.t("map.pan"),onKeyDown:I=>{if(I.target!==I.currentTarget)return;let S=CB(l.current,I.key);S!==null&&(I.preventDefault(),e.onCamera(S))},onPointerDown:I=>{I.button===0&&(f.current={x:l.current.x,y:l.current.y,px:I.clientX,py:I.clientY},I.currentTarget.setPointerCapture(I.pointerId))},onPointerMove:I=>{let S=f.current;S!==null&&p.current({...l.current,x:S.x+I.clientX-S.px,y:S.y+I.clientY-S.py})},onPointerUp:I=>{f.current=null,I.currentTarget.hasPointerCapture(I.pointerId)&&I.currentTarget.releasePointerCapture(I.pointerId)},children:[b("div",{ref:n,className:"session-map-world","data-compact":o.current?"":void 0,style:{transform:LS(w),"--map-scale":w.scale},children:[c("svg",{className:"session-map-edges",width:"1",height:"1","aria-hidden":!0,children:e.layout.edges.filter(I=>[e.selectedThreadId,r].some(S=>S!==null&&(I.sourceThreadId===S||I.childThreadId===S))).map(I=>c("path",{d:I.path},I.id))}),m.map(I=>{let S=e.threads.get(I.threadId);if(S===void 0)return null;let k={formatTitle:e.formatTitle,selected:e.selectedThreadId===S.threadId,matched:e.matches.has(S.threadId),current:e.currentMatch===S.threadId,dimmed:RB(S.threadId,e.selectedThreadId,i,e.searching,e.matches),forkCount:s.count(S.threadId),onHover:a};return I.kind==="group"?c(wB,{...k,t:e.t,card:I,thread:S,onReveal:e.onReveal},I.id):I.kind==="thread"?c(SB,{...k,t:e.t,card:I,thread:S,updatedLabel:e.formatTime(S.updatedAt),onSelect:e.onSelect,onExpand:e.onExpand,onOpen:e.onOpen,onHide:e.onHide},I.id):c(IB,{...k,t:e.t,card:I,thread:S,onSelect:e.onSelect,onCollapse:e.onCollapse,onFork:e.onFork},I.id)})]}),c("div",{className:"session-map-ruler",style:{left:x.left,height:x.top},"aria-hidden":!0,children:LB(e.layout,w,e.frame).map(I=>b("span",{"data-sticky-day":I.sticky?"":void 0,style:{left:I.left,...I.sticky?{width:112}:{}},children:[I.gapDays===void 0?null:c("small",{className:"session-map-gap",children:e.t("map.gapDays",{count:I.gapDays})}),e.formatDay(I.at)]},I.at))}),e.children]})}function LS(e){return`translate(${e.x}px, ${e.y}px) scale(${e.scale})`}function MB(e){let{t}=e,n=e.width<720;return b("header",{className:"session-map-bar",children:[c("span",{className:"session-map-count","aria-live":"polite",children:e.pending?t("map.loading"):t("map.sessions",{count:e.count})}),b("div",{className:"session-map-actions",children:[b("div",{className:"session-map-search",children:[c(II,{value:e.query,size:"sm","aria-label":t("map.search"),placeholder:t("map.search"),onValueChange:e.onQuery,onKeyDown:o=>{o.key!=="Enter"||e.matches===0||(o.preventDefault(),e.onNextMatch(o.shiftKey))}}),e.query.trim()?c("span",{className:"session-map-muted","aria-live":"polite",children:e.matches===0?t("map.searchNone"):t("map.searchCount",{index:e.matchIndex%e.matches+1,count:e.matches})}):null]}),n?null:b(Np,{className:"session-map-check",children:[c(_p,{checked:e.showArchived,"aria-label":t("map.showArchived"),onCheckedChange:e.onShowArchived}),c("span",{children:t("map.showArchived")})]}),b("div",{className:"session-map-zoom",children:[c(Y,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("map.zoomOut"),onClick:()=>e.onZoom(1/1.2),children:c(vc,{})}),b("span",{"aria-label":t("map.zoom",{percent:Math.round(e.scale*100)}),children:[Math.round(e.scale*100),"%"]}),c(Y,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("map.zoomIn"),onClick:()=>e.onZoom(1.2),children:c(bc,{})})]}),n?b(Kn,{children:[c(Vn,{render:c(Y,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("map.more")}),children:c(co,{})}),b(qn,{align:"end",children:[b($n,{role:"menuitemcheckbox","aria-checked":e.showArchived,onClick:()=>e.onShowArchived(!e.showArchived),children:[e.showArchived?c(Zn,{}):null,t("map.showArchived")]}),b($n,{onClick:e.onFit,children:[c(tl,{}),t("map.fit")]}),b($n,{onClick:e.onLatest,children:[c(nl,{}),t("map.latest")]})]})]}):[{key:"map.fit",icon:c(tl,{}),click:e.onFit},{key:"map.latest",icon:c(nl,{}),click:e.onLatest}].map(o=>b(Ne,{children:[c(De,{render:c(Y,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t(o.key),onClick:o.click}),children:o.icon}),c(_e,{children:t(o.key)})]},o.key))]})]})}function AB(e,t,n){let o=t.trim().toLocaleLowerCase();return o.length===0?[]:e.filter(r=>{let a=r.turns.at(-1);return`${r.title}
3829
3829
  ${n?.(r.title)??r.title}